lkml.org 
[lkml]   [2022]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] fs: remove duplicate permission checks in do_sendfile()
From
ping.

Thanks.

On 11/30/21 4:02 PM, Tianjia Zhang wrote:
> The permission check for out.file is mainly performed in the function
> rw_verify_area(), and this check is called twice in the function
> do_splice_direct() and before calling do_splice_direct(). This is a
> redundant check and it is necessary to remove.
>
> Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
> ---
> fs/read_write.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/fs/read_write.c b/fs/read_write.c
> index 0074afa7ecb3..bc7c3fcc3400 100644
> --- a/fs/read_write.c
> +++ b/fs/read_write.c
> @@ -1238,9 +1238,6 @@ static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos,
> #endif
> opipe = get_pipe_info(out.file, true);
> if (!opipe) {
> - retval = rw_verify_area(WRITE, out.file, &out_pos, count);
> - if (retval < 0)
> - goto fput_out;
> file_start_write(out.file);
> retval = do_splice_direct(in.file, &pos, out.file, &out_pos,
> count, fl);

\
 
 \ /
  Last update: 2022-01-28 09:48    [W:0.039 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site