Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1505104

Re: [PATCH v2] proc: fix NULL dereference when reading /proc/<pid>/auxv

From Oleg Nesterov <oleg@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2] proc: fix NULL dereference when reading /proc/<pid>/auxv
Date 2016-10-20 19:10 +0200
Message-ID <sup0R-21Y-15@gated-at.bofh.it> (permalink)
References <su02u-2rf-51@gated-at.bofh.it> <sukDV-7vO-73@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/20, Leon Yu wrote:
>
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -1014,6 +1014,9 @@ static ssize_t auxv_read(struct file *file, char __user *buf,
>  {
>  	struct mm_struct *mm = file->private_data;
>  	unsigned int nwords = 0;
> +
> +	if (!mm)
> +		return 0;
>  	do {
>  		nwords += 2;
>  	} while (mm->saved_auxv[nwords - 2] != 0); /* AT_NULL */

Michal disagrees and I won't argue with his patch which makes __mem_open()
fail if ->mm == NULL. Even if I don't really understand why should we change
the old behaviour, this _can_ break or at least confuse something/someone.

However, even if we do the change above, personally I do think we should
fix the trivial bug first, then surprise the user-space.

Acked-by: Oleg Nesterov <oleg@redhat.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] proc: fix NULL dereference when reading /proc/<pid>/auxv Leon Yu <chianglungyu@gmail.com> - 2016-10-19 18:30 +0200
  Re: [PATCH] proc: fix NULL dereference when reading /proc/<pid>/auxv Michal Hocko <mhocko@kernel.org> - 2016-10-19 19:20 +0200
    Re: [PATCH] proc: fix NULL dereference when reading /proc/<pid>/auxv Leon Yu <chianglungyu@gmail.com> - 2016-10-20 14:40 +0200
      Re: [PATCH] proc: fix NULL dereference when reading /proc/<pid>/auxv Michal Hocko <mhocko@kernel.org> - 2016-10-20 14:50 +0200
  [PATCH v2] proc: fix NULL dereference when reading /proc/<pid>/auxv Leon Yu <chianglungyu@gmail.com> - 2016-10-20 14:30 +0200
    Re: [PATCH v2] proc: fix NULL dereference when reading         /proc/<pid>/auxv Oleg Nesterov <oleg@redhat.com> - 2016-10-20 19:10 +0200
      Re: [PATCH v2] proc: fix NULL dereference when reading  /proc/<pid>/auxv Michal Hocko <mhocko@kernel.org> - 2016-10-20 21:30 +0200
        Re: [PATCH v2] proc: fix NULL dereference when reading /proc/<pid>/auxv Leon Yu <chianglungyu@gmail.com> - 2016-10-21 14:50 +0200

csiph-web