All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Matthew Maurer <mmaurer@google.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Isaac J. Manjarres" <isaacmanjarres@google.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: miscdevice: Export vtable testing
Date: Sat, 28 Jun 2025 07:07:08 +0100	[thread overview]
Message-ID: <2025062845-periscope-crayfish-e69a@gregkh> (raw)
In-Reply-To: <CAGSQo03_FTLyYpvLRO8pFzZ1_aCu+i2-Xp5GVYVDzEg5MKGyPQ@mail.gmail.com>

On Fri, Jun 27, 2025 at 04:46:04PM -0700, Matthew Maurer wrote:
> On Fri, Jun 27, 2025 at 4:42 PM Matthew Maurer <mmaurer@google.com> wrote:
> >
> > A common pattern in the kernel is to test whether a file belongs to a
> > particular driver by checking its `f_op` struct against an expected
> > value. This provides a safe way to perform that test for `MiscDevice`
> > implementations without needing to directly expose the vtable.
> >
> > Signed-off-by: Matthew Maurer <mmaurer@google.com>
> 
> Additionally, we have a sample user[1] of this in the Android ashmem
> wrapper. They're currently working around it by grabbing the vtable
> out of the registration and testing manually.
> 
> [1]: https://android-review.git.corp.google.com/c/kernel/common/+/3477511

As ashmem isn't going to be upstream, it's hard for us to treat this as
a real user :)


  reply	other threads:[~2025-06-28  6:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 23:42 [PATCH] rust: miscdevice: Export vtable testing Matthew Maurer
2025-06-27 23:46 ` Matthew Maurer
2025-06-28  6:07   ` Greg KH [this message]
2025-06-28  3:55 ` Benno Lossin
2025-06-28  6:06 ` Greg KH

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=2025062845-periscope-crayfish-e69a@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=isaacmanjarres@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=mmaurer@google.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.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.