aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/output_core.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2017-07-19 18:46:59 +0100
committerDavid S. Miller <davem@davemloft.net>2017-07-19 22:48:02 -0700
commit1e6c22aef28364dcc5f03c04a05ec463bc2b3431 (patch)
tree1ca42b7dbc6fc046a66b106936bcb63f4d330ad3 /net/ipv6/output_core.c
parentRevert "rtnetlink: Do not generate notifications for CHANGEADDR event" (diff)
downloadlinux-dev-1e6c22aef28364dcc5f03c04a05ec463bc2b3431.tar.xz
linux-dev-1e6c22aef28364dcc5f03c04a05ec463bc2b3431.zip
net: tehuti: don't process data if it has not been copied from userspace
The array data is only populated with valid information from userspace if cmd != SIOCDEVPRIVATE, other cases the array contains garbage on the stack. The subsequent switch statement acts on a subcommand in data[0] which could be any garbage value if cmd is SIOCDEVPRIVATE which seems incorrect to me. Instead, just return EOPNOTSUPP for the case where cmd == SIOCDEVPRIVATE to avoid this issue. As a side note, I suspect that the original intention of the code was for this ioctl to work just for cmd == SIOCDEVPRIVATE (and the current logic is reversed). However, I don't wont to change the current semantics in case any userspace code relies on this existing behaviour. Detected by CoverityScan, CID#139647 ("Uninitialized scalar variable") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/output_core.c')
0 files changed, 0 insertions, 0 deletions