linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: NeilBrown <neilb@suse.com>
Cc: Ian Kent <raven@themaw.net>, LKML <linux-kernel@vger.kernel.org>,
	autofs mailing list <autofs@vger.kernel.org>
Subject: Re: [PATCH] autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL
Date: Thu, 15 Jun 2017 16:34:00 -0700	[thread overview]
Message-ID: <20170615163400.e2f024125581f452d48f1aca@linux-foundation.org> (raw)
In-Reply-To: <871sqwczx5.fsf@notabene.neil.brown.name>

On Wed, 07 Jun 2017 12:08:38 +1000 NeilBrown <neilb@suse.com> wrote:

> 
> If a positive status is passed with the AUTOFS_DEV_IOCTL_FAIL
> ioctl, autofs4_d_automount() will return
>    ERR_PTR(status)
> with that status to follow_automount(), which will then
> dereference an invalid pointer.
> 
> So treat a positive status the same as zero, and map
> to ENOENT.
> 
> See comment in systemd src/core/automount.c::automount_send_ready().
> 
> ...
>
> --- a/fs/autofs4/dev-ioctl.c
> +++ b/fs/autofs4/dev-ioctl.c
> @@ -344,7 +344,7 @@ static int autofs_dev_ioctl_fail(struct file *fp,
>  	int status;
>  
>  	token = (autofs_wqt_t) param->fail.token;
> -	status = param->fail.status ? param->fail.status : -ENOENT;
> +	status = param->fail.status < 0 ? param->fail.status : -ENOENT;
>  	return autofs4_wait_release(sbi, token, status);
>  }

Sounds serious.  Was the absence of a cc:stable deliberate?

  reply	other threads:[~2017-06-15 23:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  2:08 [PATCH] autofs: sanity check status reported with AUTOFS_DEV_IOCTL_FAIL NeilBrown
2017-06-15 23:34 ` Andrew Morton [this message]
2017-06-16  2:13   ` NeilBrown
2017-06-16  3:20     ` Ian Kent
2017-06-16 10:33     ` Michael Ellerman

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=20170615163400.e2f024125581f452d48f1aca@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=autofs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=raven@themaw.net \
    /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;
as well as URLs for NNTP newsgroup(s).