All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nagamani PV <nagamani@linux.ibm.com>
To: sashiko-reviews@lists.linux.dev
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH net-next] net/iucv: fix UAF in afiucv_netdev_event()
Date: Thu, 17 Sep 2026 12:59:01 +0530	[thread overview]
Message-ID: <43395bfc-f41b-43ca-9be0-9dbeeb3fa614@linux.ibm.com> (raw)
In-Reply-To: <20260804182120.535961F00A3F@smtp.kernel.org>



On 04/08/26 11:51 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> 
> New issues:
> - [High] The patch introduces a sleep-in-atomic-context bug by calling a sleepable memory allocation function while holding a spinlock (`read_lock_bh`) that disables bottom halves.
> 

Correct.  Fixed in v2 by a two-pass design: iucv_send_ctrl() is only
called in Pass 2, after read_unlock_bh().  Pass 1 uses GFP_ATOMIC.

> Pre-existing issues:
> - [High] Socket state, shutdown flags, and transmissions are manipulated locklessly, leading to data races, lost state updates, and a potential NULL pointer dereference if the socket is orphaned concurrently.
> 

Correct.  All three sub-findings confirmed with KCSAN on IBM Z.
Fixed in v2: Pass 2 acquires lock_sock() per socket, serialising
sk->sk_state, sk->sk_shutdown, and iucv_send_ctrl() against
iucv_sock_close() and sock_orphan().

Pass 1 reads iucv->hs_dev under read_lock_bh while iucv_sock_close()
writes hs_dev = NULL under lock_sock() — orthogonal locks. READ_ONCE()
/ WRITE_ONCE() document the intentional concurrent access and suppress
KCSAN reports on those accesses.

v2 posted to netdev:
  https://lore.kernel.org/netdev/20260917071706.23831-1-nagamani@linux.ibm.com/

Validated with KASAN + KCSAN TAP on IBM Z.

Thanks,
Nagamani PV


  reply	other threads:[~2026-09-17  7:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 18:20 [PATCH net-next] net/iucv: fix UAF in afiucv_netdev_event() Nagamani PV
2026-08-04  8:33 ` Alexandra Winter
2026-08-04 12:52   ` Nagamani PV
2026-08-04 13:30     ` Alexandra Winter
2026-09-17  7:32       ` Nagamani PV
2026-08-04 18:21 ` sashiko-bot
2026-09-17  7:29   ` Nagamani PV [this message]
2026-09-17  7:17 ` [PATCH net v2] net/iucv: fix races " Nagamani PV
2026-09-17  7:28   ` sashiko-bot
2026-09-17 14:01   ` Alexandra Winter
2026-09-18  8:58     ` Nagamani PV
2026-09-21  7:36   ` netdev-bot+sashiko

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=43395bfc-f41b-43ca-9be0-9dbeeb3fa614@linux.ibm.com \
    --to=nagamani@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.