io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Pavel Begunkov <asml.silence@gmail.com>, io-uring@vger.kernel.org
Subject: Re: [PATCH v3 1/6] io_uring/mock: add basic infra for test mock files
Date: Fri, 30 May 2025 07:20:46 -0600	[thread overview]
Message-ID: <9e60b9d1-4f95-4c37-975c-102d2b5ad4a2@kernel.dk> (raw)
In-Reply-To: <d367cb31-32eb-4d69-8d71-03ea8c18e11b@gmail.com>

On 5/30/25 6:21 AM, Pavel Begunkov wrote:
> On 5/30/25 12:48, Jens Axboe wrote:
>> On 5/30/25 5:45 AM, Pavel Begunkov wrote:
>>> On 5/30/25 12:31, Jens Axboe wrote:
>>>> On 5/30/25 2:38 AM, Pavel Begunkov wrote:
>>>>> io_uring commands provide an ioctl style interface for files to
>>>>> implement file specific operations. io_uring provides many features and
>>>>> advanced api to commands, and it's getting hard to test as it requires
>>>>> specific files/devices.
>>>>>
>>>>> Add basic infrastucture for creating special mock files that will be
>>>>> implementing the cmd api and using various io_uring features we want to
>>>>> test. It'll also be useful to test some more obscure read/write/polling
>>>>> edge cases in the future.
>>>>
>>>> Do we want to have the creation of a mock file be a privileged
>>>> operation?
>>>
>>> It doesn't do anything that would warrant that, maybe just yet.
>>> Do you mean from the security perspective? i.e. making sure a
>>> user can't exploit it if there is anything to be exploited.
>>> I'd really hope nobody would compile this thing for non-test
>>> kernels. Maybe I should make it dependent on lockdep to enforce
>>> it.
>>
>> People do all sorts of weird stuff. I know it doesn't do anything
>> that warrants making it root only, but at least as root only, any
>> side effects will be limited to that. I think that'd be better than
>> making it forcibly depend on something unrelated (but debug'y) like
>> lockdep.
> 
> I don't hate the CAP_ADMIN idea, I'll add it, but making it
> dependent on something incompatible with production kernels is
> the only way to ensure it's used in the intended way.

But any kind of dependency like lockdep will mean that I cannot run
testing without lockdep, or whatever else the dependency might be. I
think that'd be rather unfortunate, I tend to test with both a "stock"
kind of config, and a KASAN && PROVE_LOCKING setup.

So I really don't think we should limit ourselves that way, attempting
to stop a weird use case by adding artificial dependencies.

-- 
Jens Axboe

  reply	other threads:[~2025-05-30 13:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-30  8:38 [PATCH v3 0/6] io_uring/mock: add basic infra for test mock files Pavel Begunkov
2025-05-30  8:38 ` [PATCH v3 1/6] " Pavel Begunkov
2025-05-30 11:31   ` Jens Axboe
2025-05-30 11:45     ` Pavel Begunkov
2025-05-30 11:48       ` Jens Axboe
2025-05-30 12:21         ` Pavel Begunkov
2025-05-30 13:20           ` Jens Axboe [this message]
2025-05-30  8:38 ` [PATCH v3 2/6] io_uring/mock: add cmd using vectored regbufs Pavel Begunkov
2025-05-30  8:38 ` [PATCH v3 3/6] io_uring/mock: add sync read/write Pavel Begunkov
2025-05-30  8:38 ` [PATCH v3 4/6] io_uring/mock: allow to choose FMODE_NOWAIT Pavel Begunkov
2025-05-30  8:38 ` [PATCH v3 5/6] io_uring/mock: support for async read/write Pavel Begunkov
2025-05-30  8:38 ` [PATCH v3 6/6] io_uring: add trivial poll handler Pavel Begunkov

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=9e60b9d1-4f95-4c37-975c-102d2b5ad4a2@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    /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).