public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Yizhuo Zhai <yzhai003@ucr.edu>
Cc: mingo@kernel.org, keescook@chromium.org,
	akpm@linux-foundation.org, paulmck@linux.vnet.ibm.com,
	linux-kernel@vger.kernel.org, Chengyu Song <csong@cs.ucr.edu>,
	Zhiyun Qian <zhiyunq@cs.ucr.edu>
Subject: Re: [PATCH] kernel/exit.c: pointer sighand could be uninitialized
Date: Thu, 3 May 2018 06:06:50 +0100	[thread overview]
Message-ID: <20180503050650.GX30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CABvMjLTfuDqNEt4+1E6R47UFQOj7N1SAhb3KCwxjHsxm7itaog@mail.gmail.com>

On Wed, May 02, 2018 at 06:48:57PM -0700, Yizhuo Zhai wrote:
> Variable 'sighand' could be uninitialized if probe_kernel_address fails
> (-EFAULT). The later use in the if statement may lead to undefined behavior.

Excuse me, but that's nonsense.  The value *copied* into it (in case
probe_kernel_address() has not failed) may be just as uninitialized.
If mere "compare uninitialized pointer value to NULL" can cause nasal demons to fly,
	* we are screwed anyway
	* the piece of crap compiler should be printed on sandpaper and used to
polish its authors.

Read the comments in there, please.  Especially the one regarding the second case.

  parent reply	other threads:[~2018-05-03  5:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABvMjLTfuDqNEt4+1E6R47UFQOj7N1SAhb3KCwxjHsxm7itaog@mail.gmail.com>
2018-05-03  4:50 ` [PATCH] kernel/exit.c: pointer sighand could be uninitialized Kees Cook
2018-05-03  5:06 ` Al Viro [this message]
2018-05-03  6:44   ` Chengyu Song

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=20180503050650.GX30522@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=csong@cs.ucr.edu \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=yzhai003@ucr.edu \
    --cc=zhiyunq@cs.ucr.edu \
    /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