aboutsummaryrefslogtreecommitdiffstats
path: root/net/bpfilter
diff options
context:
space:
mode:
authorWenwen Wang <wang6495@umn.edu>2018-10-05 08:48:27 -0500
committerDavid S. Miller <davem@davemloft.net>2018-10-05 11:47:19 -0700
commit2c05d88818ab6571816b93edce4d53703870d7ae (patch)
tree5d9764c00549b793eb582c06f87be24ff7d3f67a /net/bpfilter
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf (diff)
downloadlinux-dev-2c05d88818ab6571816b93edce4d53703870d7ae.tar.xz
linux-dev-2c05d88818ab6571816b93edce4d53703870d7ae.zip
net: cxgb3_main: fix a missing-check bug
In cxgb_extension_ioctl(), the command of the ioctl is firstly copied from the user-space buffer 'useraddr' to 'cmd' and checked through the switch statement. If the command is not as expected, an error code EOPNOTSUPP is returned. In the following execution, i.e., the cases of the switch statement, the whole buffer of 'useraddr' is copied again to a specific data structure, according to what kind of command is requested. However, after the second copy, there is no re-check on the newly-copied command. Given that the buffer 'useraddr' is in the user space, a malicious user can race to change the command between the two copies. By doing so, the attacker can supply malicious data to the kernel and cause undefined behavior. This patch adds a re-check in each case of the switch statement if there is a second copy in that case, to re-check whether the command obtained in the second copy is the same as the one in the first copy. If not, an error code EINVAL is returned. Signed-off-by: Wenwen Wang <wang6495@umn.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bpfilter')
0 files changed, 0 insertions, 0 deletions