Re: [PATCH net] ethtool: fix stack overflow in ethnl_parse_bitset()

From: Jakub Kicinski
Date: Wed Dec 09 2020 - 18:57:01 EST


On Tue, 8 Dec 2020 23:13:51 +0100 (CET) Michal Kubecek wrote:
> 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: 88db6d1e4f62 ("ethtool: add ethnl_parse_bitset() helper")
> Reported-by: syzbot+9d39fa49d4df294aab93@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Michal Kubecek <mkubecek@xxxxxxx>

Applied, thank you!