diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-19 19:23:33 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-19 19:23:33 -1000 |
| commit | 4e60e85129ae142720ae1fd12c535317a64906b2 (patch) | |
| tree | 647e93813f6de6937929d7043988e8eafebde654 /scripts/Makefile.thinlto | |
| parent | 94905fcbd9e225dd931aa543071d2fa55704206a (diff) | |
| download | linux-4e60e85129ae142720ae1fd12c535317a64906b2.tar.gz linux-4e60e85129ae142720ae1fd12c535317a64906b2.zip | |
net: use put_user() for msghdr results written back to user space
____sys_recvmsg() writes msg_flags and msg_controllen back with
__put_user(), and the compat sendmmsg()/recvmmsg() loops write msg_len
the same way. None of these has an access_ok() of its own: they rely on
the earlier copy_from_user() of the message header having checked the
range. For the compat msg_len that is not even true, since msg_len
lives after the compat_msghdr that was copied. It is only safe because
compat pointers are 32-bit. The native mmsg paths already use
put_user().
Use put_user() everywhere. On x86 that adds a couple of instructions to
check the address, on a path that has to enable and disable user access
for each write anyway.
This is part of getting rid of __get_user() and __put_user() entirely.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
