archive mirror
 help / color / mirror / Atom feed
From: Andrei Vagin <>
To: David Howells <>
Cc: Andrei Vagin <>,, Andrei Vagin <>
Subject: Re: [PATCH dhowells/mount-api] fs: fix checking an error code of security_fs_context_parse_param
Date: Thu, 6 Sep 2018 16:08:23 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Thu, Sep 06, 2018 at 11:16:24AM +0100, David Howells wrote:
> Andrei Vagin <> wrote:
> > security_fs_context_parse_param() returns 0 if everything is okay.
> Not quite.  It returns 0 to indicate that it processed the argument and that
> the argument doesn't belong to the filesystem.  It returns -ENOPARAM to
> indicate that the argument should be passed along to the filesystem.  Any
> other error is an actual error.
> >  	ret = security_fs_context_parse_param(fc, param);
> > -	if (ret != -ENOPARAM)
> > +	if (ret)
> So this change is wrong.

It depends from what point to see on it. Without this patch, the
linux-next kernel doesn't boot:

VFS: Cannot open root device "vda2" or unknown-block(253,2): error -2
Please append a correct "root=" boot option; here are the available partitions:
fd00        25165824 vda 
 driver: virtio_blk
  fd01          512000 vda1 5065bd2c-01

  fd02        23601152 vda2 5065bd2c-02

  fd03         1044480 vda3 5065bd2c-03

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,2)
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc1-00106-g679a89690477 #38
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ? 04/01/2014
Call Trace:
 ? do_early_param+0x8e/0x8e
 ? rest_init+0xb9/0xb9
Kernel Offset: 0x10000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,2) ]---

I agree that I haven't understood the idea of this code. I found that
security_fs_context_parse_param returns 0 by default and decided that this
patch would fix the problem. I have sent an update version of the patch.

Pls, take a look at it. And we need to push this patch to linux-next. We can't
run CRIU tests for linux-next without it.


> The change that needs making is to the documentation - in particular
> lsm_hooks.h.
> David

  parent reply	other threads:[~2018-09-07  3:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  0:10 Andrei Vagin
2018-09-06 10:16 ` David Howells
2018-09-06 18:44   ` [PATCH dhowells/mount-api] fs: return -ENOPARAM from security_fs_context_parse_param by default Andrei Vagin
2018-09-06 23:08   ` Andrei Vagin [this message]
2018-09-11 20:15   ` David Howells
2018-09-06 10:18 ` [PATCH dhowells/mount-api] fs: fix checking an error code of security_fs_context_parse_param David Howells
2018-09-11  5:12   ` Andrei Vagin
2018-09-11 20:13   ` David Howells

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \
    --subject='Re: [PATCH dhowells/mount-api] fs: fix checking an error code of security_fs_context_parse_param' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).