All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harshal Chavan <harshal24.chavan@gmail.com>
To: krisman@suse.de
Cc: axboe@kernel.dk, gregkh@linuxfoundation.org,
	gustavoars@kernel.org, harshal24.chavan@gmail.com,
	io-uring@vger.kernel.org, kees@kernel.org,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] io_uring/register: add IORING_REGISTER_CLONE_FILES opcode
Date: Tue, 23 Jun 2026 22:18:01 +0530	[thread overview]
Message-ID: <20260623164801.5680-1-harshal24.chavan@gmail.com> (raw)
In-Reply-To: <871pdyxrxw.fsf@mailhost.krisman.be>

Gabriel Krisman Bertazi @ 2026-06-22 20:04 UTC writes:

>Hello,
>
>Do you have the liburing side and test cases?
>
>A few comments inline.

Hello, 
Yes I will update the liburing side with helper function 
and add appropriate test cases.

>> +	/* clone file descriptors from another ring*/
>                                                ^ spacing

Fixed in v5

>> +	if (ctx->user != src_ctx->user || ctx->mm_account != src_ctx->mm_account)
>> +		return -EINVAL;
>
>I don't think it makes sense to check ->user here.  But is mm_account
>necessary either?  How could you get the src_ctx from another process?

Yes, Keeping this check would unnecessarily break valid use case like
Root user passing FDs to guest user

Removed it completely in v5, thanks for catching this!.


>> +	registered_src = (clone_arg.flags & IORING_REGISTER_SRC_REGISTERED) != 0;
>
>This is better written as
>
>registered_src = !!(clone_arg.flags & IORING_REGISTER_SRC_REGISTERED);

Understood, updated this in v5

>> +out:
>> +	if (src_ctx != ctx)
>> +		mutex_unlock(&src_ctx->uring_lock);
>
>Make the mutex_unlock unconditionally above the out label.  It is never
>locked in the error context.

Yes, moved the unlock statement before out without any conditions.

Thank you for the review.

Regards,
Harshal Chavan


      reply	other threads:[~2026-06-23 16:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19  9:36 [PATCH v4] io_uring/register: add IORING_REGISTER_CLONE_FILES opcode Harshal Chavan
2026-06-22 20:04 ` Gabriel Krisman Bertazi
2026-06-23 16:48   ` Harshal Chavan [this message]

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=20260623164801.5680-1-harshal24.chavan@gmail.com \
    --to=harshal24.chavan@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavoars@kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=kees@kernel.org \
    --cc=krisman@suse.de \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@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 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.