]> git.baikalelectronics.ru Git - kernel.git/commit
net: socket: add check for negative optlen in compat setsockopt
authorJann Horn <jannh@google.com>
Wed, 20 Feb 2019 21:34:54 +0000 (22:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Feb 2019 19:49:28 +0000 (11:49 -0800)
commit5a82f06337621b42a5ea5ca9577d7a8c27597d6b
tree4cf2045a11e399b9fc4a6930be848a3554c7d752
parentbe9bc26b5b40f78d055c9bb70a4f1cfbdaf37e6f
net: socket: add check for negative optlen in compat setsockopt

__sys_setsockopt() already checks for `optlen < 0`. Add an equivalent check
to the compat path for robustness. This has to be `> INT_MAX` instead of
`< 0` because the signedness of `optlen` is different here.

Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/compat.c