linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Wang Yufen <wangyufen@huawei.com>
Cc: viro@zeniv.linux.org.uk, ebiederm@xmission.com,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] binfmt: Fix error return code in load_elf_fdpic_binary()
Date: Thu, 1 Dec 2022 19:14:59 -0800	[thread overview]
Message-ID: <202212011914.792F2FE@keescook> (raw)
In-Reply-To: <1669945261-30271-1-git-send-email-wangyufen@huawei.com>

On Fri, Dec 02, 2022 at 09:41:01AM +0800, Wang Yufen wrote:
> Fix to return a negative error code from create_elf_fdpic_tables()
> instead of 0.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Wang Yufen <wangyufen@huawei.com>

Thanks for the catch! Yeah, it looks like this has been wrong for a long
time. :)

-Kees

> ---
>  fs/binfmt_elf_fdpic.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
> index 08d0c87..9ce5e1f 100644
> --- a/fs/binfmt_elf_fdpic.c
> +++ b/fs/binfmt_elf_fdpic.c
> @@ -434,8 +434,9 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
>  	current->mm->start_stack = current->mm->start_brk + stack_size;
>  #endif
>  
> -	if (create_elf_fdpic_tables(bprm, current->mm,
> -				    &exec_params, &interp_params) < 0)
> +	retval = create_elf_fdpic_tables(bprm, current->mm, &exec_params,
> +					 &interp_params);
> +	if (retval < 0)
>  		goto error;
>  
>  	kdebug("- start_code  %lx", current->mm->start_code);
> -- 
> 1.8.3.1
> 

-- 
Kees Cook


  reply	other threads:[~2022-12-02  3:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  1:41 Wang Yufen
2022-12-02  3:14 ` Kees Cook [this message]
2022-12-02  3:19 ` Kees Cook

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=202212011914.792F2FE@keescook \
    --to=keescook@chromium.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wangyufen@huawei.com \
    /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