]> git.baikalelectronics.ru Git - kernel.git/commit
ax25: uninitialized variable in ax25_setsockopt()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 7 Jan 2022 07:13:12 +0000 (10:13 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jan 2022 14:10:26 +0000 (14:10 +0000)
commit6652bc4b075aef4bcfe4749497755808b1aef711
tree0877e10b928746b1f3c0c09628475a6dd471e859
parentf8d44e3cad678ad6e1ec41d115a4a13633baf65b
ax25: uninitialized variable in ax25_setsockopt()

The "opt" variable is unsigned long but we only copy 4 bytes from
the user so the lower 4 bytes are uninitialized.

I have changed the integer overflow checks from ULONG to UINT as well.
This is a slight API change but I don't expect it to break anything.

Fixes: cf0058199c0b ("net: pass a sockptr_t into ->setsockopt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ax25/af_ax25.c