Skip to content

Instantly share code, notes, and snippets.

@henriquebritoM
Created September 6, 2026 20:42
Show Gist options
  • Select an option

  • Save henriquebritoM/87b3b041bb5622e095b6b138fc9b5b28 to your computer and use it in GitHub Desktop.

Select an option

Save henriquebritoM/87b3b041bb5622e095b6b138fc9b5b28 to your computer and use it in GitHub Desktop.
diff for copy_file_range SMAP violation on compat_linux
Index: linux_file.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_file.c,v
retrieving revision 1.133
diff -u -u -r1.133 linux_file.c
--- linux_file.c 1 Oct 2024 17:46:51 -0000 1.133
+++ linux_file.c 28 Aug 2026 13:53:12 -0000
@@ -1123,11 +1123,9 @@
DPRINTF("%s: Input or output is a directory\n", __func__);
goto out;
}
- if ((SCARG(uap, off_in) != NULL && *SCARG(uap, off_in) < 0) ||
- (SCARG(uap, off_out) != NULL && *SCARG(uap, off_out) < 0) ||
- vattr_in.va_type != VREG || vattr_out.va_type != VREG) {
+ if (vattr_in.va_type != VREG || vattr_out.va_type != VREG) {
error = EINVAL;
- DPRINTF("%s: Invalid offset or file type\n", __func__);
+ DPRINTF("%s: Invalid file type\n", __func__);
goto out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment