linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Borislav Petkov <bp@alien8.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] init: use do_mount() instead of ksys_mount()
Date: Mon, 16 Dec 2019 10:51:37 +0100	[thread overview]
Message-ID: <20191216095137.omiovbgt5bwjahku@isilmar-4.linta.de> (raw)
In-Reply-To: <20191216094556.GA32241@zn.tnic>

On Mon, Dec 16, 2019 at 10:45:56AM +0100, Borislav Petkov wrote:
> On Thu, Dec 12, 2019 at 07:14:20PM +0100, Dominik Brodowski wrote:
> > diff --git a/init/do_mounts.c b/init/do_mounts.c
> > index 43f6d098c880..f55cbd9cb818 100644
> > --- a/init/do_mounts.c
> > +++ b/init/do_mounts.c
> > @@ -387,12 +387,25 @@ static void __init get_fs_names(char *page)
> >  	*s = '\0';
> >  }
> >  
> > -static int __init do_mount_root(char *name, char *fs, int flags, void *data)
> > +static int __init do_mount_root(const char *name, const char *fs,
> > +				 const int flags, const void *data)
> >  {
> >  	struct super_block *s;
> > -	int err = ksys_mount(name, "/root", fs, flags, data);
> > -	if (err)
> > -		return err;
> > +	char *data_page;
> > +	struct page *p;
> > +	int ret;
> > +
> > +	/* do_mount() requires a full page as fifth argument */
> > +	p = alloc_page(GFP_KERNEL);
> > +	if (!p)
> > +		return -ENOMEM;
> > +
> > +	data_page = page_address(p);
> 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> That doesn't work in my guest as it gives a funny address:
> 
> [    3.155314] mount_block_root: entry
> [    3.155868] mount_block_root: fs_name: [ext3]
> [    3.156512] do_mount_root: will copy data page: 0x00000000adf0ddb8
> 
> leading to the splat below.

Does

https://lore.kernel.org/lkml/CAHk-=wh8VLe3AEKhz=1bzSO=1fv4EM71EhufxuC=Gp=+bLhXoA@mail.gmail.com/

solve the issue?

Thanks,
	Dominik

  reply	other threads:[~2019-12-16  9:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
2019-12-12 18:14 ` [PATCH 1/5] devtmpfs: use do_mount() instead of ksys_mount() Dominik Brodowski
2019-12-12 18:14 ` [PATCH 2/5] initrd: " Dominik Brodowski
2019-12-12 18:14 ` [PATCH 3/5] init: " Dominik Brodowski
2019-12-16  9:45   ` Borislav Petkov
2019-12-16  9:51     ` Dominik Brodowski [this message]
2019-12-16 10:19       ` Borislav Petkov
2019-12-12 18:14 ` [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr Dominik Brodowski
2019-12-12 18:14 ` [PATCH 5/5] fs: remove ksys_dup() Dominik Brodowski
2019-12-15 19:50 ` [GIT PULL] remove ksys_mount() and ksys_dup() Linus Torvalds
2019-12-15 20:50 ` pr-tracker-bot
     [not found]   ` <CAJmaN=ksaH5AgRUdVPGWKZzjEinU+goaCqedH1PW6OmKYc_TuA@mail.gmail.com>
2019-12-17 19:37     ` Greg Kroah-Hartman
2019-12-17 20:05       ` Jesse Barnes
2019-12-17 20:40     ` Linus Torvalds
2019-12-17 22:21       ` Jesse Barnes
2019-12-17 22:57         ` Al Viro
2019-12-17 23:23           ` Al Viro
2019-12-18  7:51           ` Dominik Brodowski
2019-12-18 13:37             ` Al Viro
2019-12-17  5:17 ` [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr youling257
2019-12-17  6:42   ` Dominik Brodowski
2019-12-17  9:33     ` youling 257
2019-12-17 21:14       ` Linus Torvalds
2019-12-18  4:10         ` youling 257
2019-12-18  8:03           ` Dominik Brodowski
2019-12-18 21:50         ` youling 257
2019-12-19  7:08           ` Dominik Brodowski
2019-12-19  9:34             ` youling 257

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=20191216095137.omiovbgt5bwjahku@isilmar-4.linta.de \
    --to=linux@dominikbrodowski.net \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rafael@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).