lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1] hamradio: remove needs_free_netdev to avoid UAF
On Thu, 11 Nov 2021 22:14:02 +0800 Lin Ma wrote:
> The former patch "defer 6pack kfree after unregister_netdev" reorders
> the kfree of two buffer after the unregister_netdev to prevent the race
> condition. It also adds free_netdev() function in sixpack_close(), which
> is a direct copy from the similar code in mkiss_close().
>
> However, in sixpack driver, the flag needs_free_netdev is set to true in
> sp_setup(), hence the unregister_netdev() will free the netdev
> automatically. Therefore, as the sp is netdev_priv, use-after-free
> occurs.
>
> This patch removes the needs_free_netdev = true and just let the
> free_netdev to finish this deallocation task.
>
> Signed-off-by: Lin Ma <linma@zju.edu.cn>

Fixes: 0b9111922b1f ("hamradio: defer 6pack kfree after unregister_netdev")

\
 
 \ /
  Last update: 2021-11-12 02:55    [W:0.027 / U:1.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site