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] [day] [month] [year] [list]
Message-ID: <34904908-cfcf-a7f7-0039-83c6d16c8d6b@gmail.com>
Date:   Wed, 20 Jan 2021 02:26:10 +0000
From:   Pavel Begunkov <asml.silence@...il.com>
To:     Yejune Deng <yejune.deng@...il.com>, viro@...iv.linux.org.uk,
        axboe@...nel.dk
Cc:     linux-fsdevel@...r.kernel.org, io-uring@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] io_uring: simplify io_remove_personalities()

On 02/01/2021 19:25, Pavel Begunkov wrote:
> On 24/12/2020 03:02, Yejune Deng wrote:
>> The function io_remove_personalities() is very similar to
>> io_unregister_personality(),so implement io_remove_personalities()
>> calling io_unregister_personality().
> 
> Please, don't forget to specify a version in the subject, e.g.
> [PATCH v2], add a changelog after "---" and add tags from previous
> threads if any.
> 
> Looks good
> Reviewed-by: Pavel Begunkov <asml.silence@...il.com>

up

> 
>>
>> Signed-off-by: Yejune Deng <yejune.deng@...il.com>
>> ---
>>  fs/io_uring.c | 28 +++++++++++-----------------
>>  1 file changed, 11 insertions(+), 17 deletions(-)
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index b749578..dc913fa 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -8608,9 +8608,8 @@ static int io_uring_fasync(int fd, struct file *file, int on)
>>  	return fasync_helper(fd, file, on, &ctx->cq_fasync);
>>  }
>>  
>> -static int io_remove_personalities(int id, void *p, void *data)
>> +static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id)
>>  {
>> -	struct io_ring_ctx *ctx = data;
>>  	struct io_identity *iod;
>>  
>>  	iod = idr_remove(&ctx->personality_idr, id);
>> @@ -8618,7 +8617,17 @@ static int io_remove_personalities(int id, void *p, void *data)
>>  		put_cred(iod->creds);
>>  		if (refcount_dec_and_test(&iod->count))
>>  			kfree(iod);
>> +		return 0;
>>  	}
>> +
>> +	return -EINVAL;
>> +}
>> +
>> +static int io_remove_personalities(int id, void *p, void *data)
>> +{
>> +	struct io_ring_ctx *ctx = data;
>> +
>> +	io_unregister_personality(ctx, id);
>>  	return 0;
>>  }
>>  
>> @@ -9679,21 +9688,6 @@ static int io_register_personality(struct io_ring_ctx *ctx)
>>  	return ret;
>>  }
>>  
>> -static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id)
>> -{
>> -	struct io_identity *iod;
>> -
>> -	iod = idr_remove(&ctx->personality_idr, id);
>> -	if (iod) {
>> -		put_cred(iod->creds);
>> -		if (refcount_dec_and_test(&iod->count))
>> -			kfree(iod);
>> -		return 0;
>> -	}
>> -
>> -	return -EINVAL;
>> -}
>> -
>>  static int io_register_restrictions(struct io_ring_ctx *ctx, void __user *arg,
>>  				    unsigned int nr_args)
>>  {
>>
> 

-- 
Pavel Begunkov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ