From: Sungwoo Kim <iam@sung-woo.kim>
Cc: daveti@purdue.edu, Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: msft: fix slab-use-after-free in msft_do_close()
Date: Sat, 27 Apr 2024 23:47:53 -0400 [thread overview]
Message-ID: <CAJNyHpJjRoJNUY25MrsAhxdsCVZJVu2AXcstO_t31_xtLWFGJw@mail.gmail.com> (raw)
In-Reply-To: <20240427051934.879051-1-iam@sung-woo.kim>
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.
prev parent reply other threads:[~2024-04-28 3:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-27 5:19 [PATCH] Bluetooth: msft: fix slab-use-after-free in msft_do_close() Sungwoo Kim
2024-04-28 3:47 ` Sungwoo Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJNyHpJjRoJNUY25MrsAhxdsCVZJVu2AXcstO_t31_xtLWFGJw@mail.gmail.com \
--to=iam@sung-woo.kim \
--cc=daveti@purdue.edu \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).