The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Lee Jones <lee@kernel.org>, Evgeniy Polyakov <zbr@ioremap.net>,
	David Fries <David@Fries.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 2/6] w1: Synchronise thread teardown with netlink callbacks
Date: Wed, 2 Dec 2026 11:38:56 +0100	[thread overview]
Message-ID: <428f86e0-de8a-4fa7-95ab-46f68bbecd4c@kernel.org> (raw)
In-Reply-To: <40c82de262ee4eaf8609b99520fc6861206f37d4.1796204137.git.lee@kernel.org>

On 02/12/2026 10:36, Lee Jones wrote:
> When __w1_remove_master_device() stops dev->thread via kthread_stop(),
> a concurrent w1_cn_callback() that already holds a reference on dev can
> still call wake_up_process(dev->thread) after the kthread task_struct
> has been freed, causing a use-after-free.  In addition, draining queued
> netlink commands via w1_process_cb() during teardown can execute
> W1_CMD_SLAVE_ADD or W1_CMD_SEARCH after the master has already detached
> all slaves, re-attaching a slave and leaving dev->refcnt permanently
> non-zero.
> 

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Best regards,
Krzysztof

  reply	other threads:[~2026-12-02 10:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  9:36 [PATCH 0/6] w1: Fix Critical and High issues reported by Sashiko Lee Jones
2026-12-02  9:36 ` [PATCH 1/6] w1: Free slave structure in w1_slave_release() Lee Jones
2026-12-02 10:38   ` Krzysztof Kozlowski
2026-12-02 10:43     ` Krzysztof Kozlowski
2026-12-02  9:36 ` [PATCH 2/6] w1: Synchronise thread teardown with netlink callbacks Lee Jones
2026-12-02 10:38   ` Krzysztof Kozlowski [this message]
2026-12-02  9:36 ` [PATCH 3/6] w1: Return actual bytes read from w1_read_block() and rw_read() Lee Jones
2026-12-02 10:54   ` Krzysztof Kozlowski
2026-12-02  9:36 ` [PATCH 4/6] w1: Protect w1_masters traversal with w1_mlock during removal Lee Jones
2026-12-02 10:44   ` Krzysztof Kozlowski
2026-12-02  9:36 ` [PATCH 5/6] w1: ds28e04: Always allocate family data to avoid NULL dereference Lee Jones
2026-12-02 10:45   ` Krzysztof Kozlowski
2026-12-02  9:36 ` [PATCH 6/6] w1: sgi: Add timeout to sgi_w1_wait() polling loop Lee Jones
2026-12-02 10:46   ` Krzysztof Kozlowski
2026-12-02  9:45 ` [PATCH 0/6] w1: Fix Critical and High issues reported by Sashiko Greg Kroah-Hartman
2026-12-02 10:23   ` Lee Jones
2026-12-02 10:30     ` Greg Kroah-Hartman

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=428f86e0-de8a-4fa7-95ab-46f68bbecd4c@kernel.org \
    --to=krzk@kernel.org \
    --cc=David@Fries.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /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