Commit 1465036b authored by Michal Luczaj's avatar Michal Luczaj Committed by Paolo Abeni
Browse files

llc: Improve setsockopt() handling of malformed user input



copy_from_sockptr() is used incorrectly: return value is the number of
bytes that could not be copied. Since it's deprecated, switch to
copy_safe_from_sockptr().

Note: Keeping the `optlen != sizeof(int)` check as copy_safe_from_sockptr()
by itself would also accept optlen > sizeof(int). Which would allow a more
lenient handling of inputs.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Suggested-by: default avatarDavid Wei <dw@davidwei.uk>
Signed-off-by: default avatarMichal Luczaj <mhal@rbox.co>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 5dfd7d94
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment