netrom: fix api breakage in nr_setsockopt()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 7 Jan 2022 07:12:10 +0000 (10:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:04:00 +0000 (11:04 +0100)
commitaf5dcf968ebe69bd8c24ba7359aae002f8b4cdd9
tree64be4d1d83c6ad88a76b72cc62768e1677534633
parent7b9986a0425a83dc763222667ceb67036ac15640
netrom: fix api breakage in nr_setsockopt()

[ Upstream commit dc35616e6c2907b0c0c391a205802d8880f7fd85 ]

This needs to copy an unsigned int from user space instead of a long to
avoid breaking user space with an API change.

I have updated all the integer overflow checks from ULONG to UINT as
well.  This is a slight API change but I do not expect it to affect
anything in real life.

Fixes: 3087a6f36ee0 ("netrom: fix copying in user data in nr_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/netrom/af_netrom.c