linux_dsm_epyc7002/drivers/net/ethernet/chelsio
Wenwen Wang 2c05d88818 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>
2018-10-05 11:47:19 -07:00
..
cxgb net: chelsio: cxgb2: remove unused array pci_speed 2018-08-10 10:24:50 -07:00
cxgb3 net: cxgb3_main: fix a missing-check bug 2018-10-05 11:47:19 -07:00
cxgb4 cxgb4: fix abort_req_rss6 struct 2018-09-11 09:02:02 -06:00
cxgb4vf net: chelsio: Use zeroing memory allocator instead of allocator/memset 2018-06-04 16:07:30 -04:00
libcxgb libcxgb: replace vmalloc and memset with vzalloc 2018-07-21 16:32:59 -07:00
Kconfig cxgb4: enable ZLIB_DEFLATE when building cxgb4 2018-01-24 10:56:59 -05:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00