linux-stable/include
Eric Dumazet 6309863b31 net: add copy_safe_from_sockptr() helper
copy_from_sockptr() helper is unsafe, unless callers
did the prior check against user provided optlen.

Too many callers get this wrong, lets add a helper to
fix them and avoid future copy/paste bugs.

Instead of :

   if (optlen < sizeof(opt)) {
       err = -EINVAL;
       break;
   }
   if (copy_from_sockptr(&opt, optval, sizeof(opt)) {
       err = -EFAULT;
       break;
   }

Use :

   err = copy_safe_from_sockptr(&opt, sizeof(opt),
                                optval, optlen);
   if (err)
       break;

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240408082845.3957374-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-04-09 17:00:16 -07:00
..
acpi ACPI updates for 6.9-rc1 2024-03-13 11:54:05 -07:00
asm-generic export.h: remove include/asm-generic/export.h 2024-03-28 11:04:20 +09:00
clocksource
crypto This update includes the following changes: 2024-03-15 14:46:54 -07:00
drm drm fixes for 6.9-rc1 2024-03-21 19:04:31 -07:00
dt-bindings Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
keys
kunit
kvm KVM: arm64: Fix host-programmed guest events in nVHE 2024-03-26 01:51:44 -07:00
linux net: add copy_safe_from_sockptr() helper 2024-04-09 17:00:16 -07:00
math-emu
media media updates for v6.9-rc1 2024-03-15 11:36:54 -07:00
memory
misc
net geneve: fix header validation in geneve[6]_xmit_skb 2024-04-08 11:51:04 +01:00
pcmcia
ras
rdma
rv
scsi scsi: sd: Fix TCG OPAL unlock on system resume 2024-03-25 15:46:12 -04:00
soc Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
sound sound fixes for 6.9-rc2 2024-03-28 14:54:49 -07:00
target
trace tracing: Just use strcmp() for testing __string() and __assign_str() match 2024-03-19 11:23:30 -07:00
uapi SCSI fixes on 20240330 2024-03-30 13:44:52 -07:00
ufs scsi: ufs: core: Add config_scsi_dev vops comment 2024-03-10 18:10:24 -04:00
vdso
video
xen