lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c013151-37de-1ef0-e989-9f871665d650@gmail.com>
Date:   Wed, 23 Dec 2020 12:41:39 +0000
From:   Pavel Begunkov <asml.silence@...il.com>
To:     Stefano Garzarella <sgarzare@...hat.com>,
        Yejune Deng <yejune.deng@...il.com>
Cc:     viro@...iv.linux.org.uk, axboe@...nel.dk,
        linux-fsdevel@...r.kernel.org, io-uring@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring: remove io_remove_personalities()

On 23/12/2020 10:36, Stefano Garzarella wrote:
> On Wed, Dec 23, 2020 at 11:27:05AM +0800, Yejune Deng wrote:
>> The function io_remove_personalities() is very similar to
>> io_unregister_personality(),but the latter has a more reasonable
>> return value.
>>
>> Signed-off-by: Yejune Deng <yejune.deng@...il.com>
>> ---
>> fs/io_uring.c | 25 ++++++-------------------
>> 1 file changed, 6 insertions(+), 19 deletions(-)
> 
> The patch LGTM, maybe as an alternative you can leave io_remove_personality() with the interface needed by idr_for_each() and implement io_unregister_personality() calling io_remove_personality() with the right parameters.

Right, don't replace sane types with void * just because.
Leave well-typed io_unregister_personality() and call it from
io_remove_personalities().


Also
 * idr_for_each() - Iterate through all stored pointers.
 ...
 * If @fn returns anything other than %0, the iteration stops and that
 * value is returned from this function.

For io_remove_personality() iod==NULL should not happen because
it's under for_each and synchronised, but leave the return value be 

io_remove_personality(void *, ...)
{
	struct io_ring_ctx *ctx = data;

	io_unregister_personality(ctx, id);
	return 0;
}

-- 
Pavel Begunkov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ