ax25: uninitialized variable in ax25_setsockopt()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 7 Jan 2022 07:13:12 +0000 (10:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:03 +0000 (10:54 +0100)
commit0d04479857bc36de267a183d4889dd713cef18dd
treee75aed30728098fbe04984525cc08f812849481a
parent27e9910c4516c829a12286be3501e0e80d8028ee
ax25: uninitialized variable in ax25_setsockopt()

[ Upstream commit 9371937092d5fd502032c1bb4475b36b39b1f1b3 ]

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: a7b75c5a8c41 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ax25/af_ax25.c