All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: Yuan Tan <ytan089@ucr.edu>,
	ojeda@kernel.org, boqun@kernel.org,
	rust-for-linux@vger.kernel.org
Cc: zhiyunq@cs.ucr.edu, ardalan@uci.edu, pgovind2@uci.edu,
	dzueck@uci.edu, Yuan Tan <ytan089@ucr.edu>
Subject: Re: [PATCH 0/1] rust: block: mq: make GenDisk Send impl sound
Date: Fri, 05 Jun 2026 14:04:01 +0200	[thread overview]
Message-ID: <87pl25i47i.fsf@kernel.org> (raw)
In-Reply-To: <cover.1780633578.git.ytan089@ucr.edu>

Hi,

Yuan Tan <ytan089@ucr.edu> writes:

> Hi Linux kernel maintainers,
>
> We are developing a tool called FerroLens to detect potential unsound
> behavior in Rust code in the Linux kernel. FerroLens reported the following
> bug in rust/kernel/gendisk.rs.
>
> Gendisk is marked as Send although the fields it contains may not be.
> Specifically, the QueueData held in the raw gendisk pointer may not be safe
> to send across threads. Therefore, sending the Gendisk from one thread to
> another and dropping on a different thread may cause unsound behavior.
>
> Additionally, Gendisk contains an Arc<TagSet<T>>. This Arc would be Send
> and Sync if the underlying TagSet<T> were Send and Sync. But this is not
> explicitly derived, although it can be, since the API does not modify the
> TagSet.

Thanks for the patch. The `GenDisk` `Send` fix looks correct to me.

The implementation of `Send` and `Sync` for `TagSet` is not a fix, and
it was already sent to list [1]. It does however suffer the same issue
that you described for `GenDisk`, so I will address this when I send v2.

FYI, I did not receive your email in my inbox, I saw it on list. It
might be rejected by Proton for some reason.

Best regards,
Andreas Hindborg

[1] https://lore.kernel.org/rust-for-linux/20260216-rnull-v6-19-rc5-send-v1-42-de9a7af4b469@kernel.org/



  parent reply	other threads:[~2026-06-05 12:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05  4:49 [PATCH 0/1] rust: block: mq: make GenDisk Send impl sound Yuan Tan
2026-06-05  4:49 ` [PATCH 1/1] " Yuan Tan
2026-06-05 12:04 ` Andreas Hindborg [this message]
2026-06-08 10:14   ` [PATCH 0/1] " Andreas Hindborg
2026-06-05 13:50 ` Gary Guo

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=87pl25i47i.fsf@kernel.org \
    --to=a.hindborg@kernel.org \
    --cc=ardalan@uci.edu \
    --cc=boqun@kernel.org \
    --cc=dzueck@uci.edu \
    --cc=ojeda@kernel.org \
    --cc=pgovind2@uci.edu \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=ytan089@ucr.edu \
    --cc=zhiyunq@cs.ucr.edu \
    /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.