Skip to content
Commit a770bf51 authored by Michal Kubecek's avatar Michal Kubecek Committed by Jakub Kicinski
Browse files

ethtool: fix stack overflow in ethnl_parse_bitset()



Syzbot reported a stack overflow in bitmap_from_arr32() called from
ethnl_parse_bitset() when bitset from netlink message is longer than
target bitmap length. While ethnl_compact_sanity_checks() makes sure that
trailing part is all zeros (i.e. the request does not try to touch bits
kernel does not recognize), we also need to cap change_bits to nbits so
that we don't try to write past the prepared bitmaps.

Fixes: 88db6d1e ("ethtool: add ethnl_parse_bitset() helper")
Reported-by: default avatar <syzbot+9d39fa49d4df294aab93@syzkaller.appspotmail.com>
Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
Link: https://lore.kernel.org/r/3487ee3a98e14cd526f55b6caaa959d2dcbcad9f.1607465316.git.mkubecek@suse.cz


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a379b01c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment