opnsense-src/sys/compat
Mark Johnston bcff2fdf8e freebsd32: Fix a double copyin in sendmsg() and recvmsg()
freebsd32_sendmsg() and freebsd32_recvmsg() both copyin the message
header twice, once directly and once in freebsd32_copyinmsghdr().  The
iovec length from the former is used when copying in msg_iov, but the
rest of the kernel uses the iovec length from the latter.  When
kern_sendit() and kern_recvit() iterate over the iovec to compute the
residual for I/O, they can therefore end up walking past the end of the
copied in iovec, either resulting in a system call error, userspace
memory corruption from uiomove() with invalid iovecs, or a kernel page
fault if the copied-in iovec is followed by an unmapped KVA region.

Reported by:	syzbot+7cc64cd0c49605acd421@syzkaller.appspotmail.com
Reviewed by:	kib, emaste
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fea1a98ead)
2021-09-26 11:55:05 -04:00
..
cloudabi cloudabi and linux ABIs: do not call umtx_thread_cleanup() from thr_exit syscall 2021-07-22 01:11:52 +03:00
cloudabi32 regen syscall files after 0bd5d81f1e 2021-05-19 20:32:47 -04:00
cloudabi64 regen syscall files after 0bd5d81f1e 2021-05-19 20:32:47 -04:00
freebsd32 freebsd32: Fix a double copyin in sendmsg() and recvmsg() 2021-09-26 11:55:05 -04:00
ia32 Do not call FreeBSD-ABI specific code for all ABIs 2021-07-22 01:11:52 +03:00
lindebugfs Add emulation support for the Linux kcov(4) ioctl API. 2020-09-04 00:12:28 +00:00
linprocfs Make MAXPHYS tunable. Bump MAXPHYS to 1M. 2020-11-28 12:12:51 +00:00
linsysfs Add emulation support for the Linux kcov(4) ioctl API. 2020-09-04 00:12:28 +00:00
linux cloudabi and linux ABIs: do not call umtx_thread_cleanup() from thr_exit syscall 2021-07-22 01:11:52 +03:00
linuxkpi/common direct commit: fix KBI for pci_dev 2021-09-22 09:00:16 -06:00
ndis compat: clean up empty lines in .c and .h files 2020-09-01 21:24:33 +00:00
x86bios Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00