lkml.org 
[lkml]   [2024]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Bluetooth: msft: fix slab-use-after-free in msft_do_close()
Hello,

Could you not apply this? I found an error.

On Sat, Apr 27, 2024 at 1:19 AM Sungwoo Kim <iam@sung-woo.kim> wrote:
>
> +
> +static struct msft_data *msft_data_hold_unless_zero(struct msft_data *msft)
> +{
> + BT_DBG("msft %p orig refcnt %u", msft, kref_read(&msft->kref));

Here, msft could be NULL. &msft->kref causes a null-ptr-deref error.
I already sent a v2 patch fixing this.

> +
> + if (!msft)
> + return NULL;
> +
> + if (!kref_get_unless_zero(&msft->kref))
> + return NULL;
> +
> + return msft;
> +}
> +

Thanks,
Sungwoo.

\
 
 \ /
  Last update: 2024-05-27 18:06    [W:0.057 / U:1.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site