linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Yang Li <yang.li@amlogic.com>
Cc: 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 v2] Bluetooth: iso: Fix UAF on iso_sock_disconn
Date: Thu, 6 Nov 2025 09:20:40 +0100	[thread overview]
Message-ID: <f756b92a-272e-4d33-9126-0ce891df6ac0@molgen.mpg.de> (raw)
In-Reply-To: <20251106-kernel_panic-v2-1-f4ee57845eec@amlogic.com>

Dear Yang,


Thank you for the patch.

Am 06.11.25 um 03:40 schrieb Yang Li via B4 Relay:
> From: Yang Li <yang.li@amlogic.com>
> 
> When the phone stops audio sharing, it terminates the BIG first
> and then sends BASS modify and remove operation codes to clear
> the shared BIG. If a BIG sync lost event occurs at the same time,
> the BIG connection may already be deleted. Releasing the socket
> in this case can lead to a NULL connection pointer.
> 
> kernel panic: Unable to handle kernel read from unreadable
> memory at virtual address 00000000000003d8
> Call trace:
>   iso_sock_disconn+0x110/0x1c8
>   __iso_sock_close+0x50/0x164
>   iso_sock_release+0x48/0xf0
>   __sock_release+0x40/0xb4
>   sock_close+0x18/0x28
>   __fput+0xd8/0x28c
>   __fput_sync+0x50/0x5c
>   __arm64_sys_close+0x38/0x7c
>   invoke_syscall+0x48/0x118
>   el0_svc_common.constprop.0+0x40/0xe0
>   do_el0_svc_compat+0x1c/0x34
>   el0_svc_compat+0x30/0x88
>   el0t_32_sync_handler+0x90/0x140
>   el0t_32_sync+0x198/0x19c
> 
> Signed-off-by: Yang Li <yang.li@amlogic.com>
> ---
> Changes in v2:
> - Add description about this problem
> - Link to v1: https://lore.kernel.org/r/20251105-kernel_panic-v1-1-88637054c6b9@amlogic.com
> ---
>   net/bluetooth/iso.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
> index 74ec7d125c88..89c7700ceb81 100644
> --- a/net/bluetooth/iso.c
> +++ b/net/bluetooth/iso.c
> @@ -838,14 +838,14 @@ static void __iso_sock_close(struct sock *sk)
>   	case BT_CONNECT:
>   	case BT_CONNECTED:
>   	case BT_CONFIG:
> -		if (iso_pi(sk)->conn->hcon)
> +		if (iso_pi(sk)->conn && iso_pi(sk)->conn->hcon)
>   			iso_sock_disconn(sk);
>   		else
>   			iso_chan_del(sk, ECONNRESET);
>   		break;
>   
>   	case BT_CONNECT2:
> -		if (iso_pi(sk)->conn->hcon &&
> +		if (iso_pi(sk)->conn && iso_pi(sk)->conn->hcon &&
>   		    (test_bit(HCI_CONN_PA_SYNC, &iso_pi(sk)->conn->hcon->flags) ||
>   		    test_bit(HCI_CONN_PA_SYNC_FAILED, &iso_pi(sk)->conn->hcon->flags)))
>   			iso_sock_disconn(sk);

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul

      parent reply	other threads:[~2025-11-06  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  2:40 [PATCH v2] Bluetooth: iso: Fix UAF on iso_sock_disconn Yang Li via B4 Relay
2025-11-06  3:15 ` [v2] " bluez.test.bot
2025-11-06  8:20 ` Paul Menzel [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=f756b92a-272e-4d33-9126-0ce891df6ac0@molgen.mpg.de \
    --to=pmenzel@molgen.mpg.de \
    --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 \
    --cc=yang.li@amlogic.com \
    /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 NNTP newsgroup(s).