]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: fix string set id check
authorMichal Kubecek <mkubecek@suse.cz>
Mon, 14 Dec 2020 13:25:01 +0000 (14:25 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 16 Dec 2020 19:15:11 +0000 (11:15 -0800)
commit9b4ac34276c077f9103c60bcf99db7e4ae02cfdd
tree493fa3c6ff755322258892c77dc8f9a99835608c
parent072498f4f6addd6a3e4d26ff9427b88d947b1b1a
ethtool: fix string set id check

Syzbot reported a shift of a u32 by more than 31 in strset_parse_request()
which is undefined behavior. This is caused by range check of string set id
using variable ret (which is always 0 at this point) instead of id (string
set id from request).

Fixes: d7bef0af95e3 ("ethtool: provide string sets with STRSET_GET request")
Reported-by: syzbot+96523fb438937cd01220@syzkaller.appspotmail.com
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Link: https://lore.kernel.org/r/b54ed5c5fd972a59afea3e1badfb36d86df68799.1607952208.git.mkubecek@suse.cz
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/strset.c