can: raw: add missing refcount for memory leak fix
mainline inclusion from mainline-v6.5 commit c275a176 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7PM10 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c275a176e4b69868576e543409927ae75e3a3288 --------------------------- Commit ee8b94c8 ("can: raw: fix receiver memory leak") introduced a new reference to the CAN netdevice that has assigned CAN filters. But this new ro->dev reference did not maintain its own refcount which lead to another KASAN use-after-free splat found by Eric Dumazet. This patch ensures a proper refcount for the CAN nedevice. Fixes: ee8b94c8 ("can: raw: fix receiver memory leak") Reported-by:Eric Dumazet <edumazet@google.com> Cc: Ziyang Xuan <william.xuanziyang@huawei.com> Signed-off-by:
Oliver Hartkopp <socketcan@hartkopp.net> Link: https://lore.kernel.org/r/20230821144547.6658-3-socketcan@hartkopp.net Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Conflicts: net/can/raw.c Signed-off-by:
Ziyang Xuan <william.xuanziyang@huawei.com>
Loading
Please sign in to comment