lkml.org 
[lkml]   [2019]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [GIT PULL] remove ksys_mount() and ksys_dup()
On Tue, Dec 17, 2019 at 11:33 AM Jesse Barnes <jsbarnes@google.com> wrote:
>
> Still debugging, but this causes a panic in console_on_rootfs() when we try to dup the fds for stderr and stdout.

Duh.

That series was incredibly buggy, and there's another bug in there.

I think this should fix it:

diff --git a/init/main.c b/init/main.c
index ec3a1463ac69..1ecfd43ed464 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1163,7 +1163,7 @@ void console_on_rootfs(void)

/* Open /dev/console in kernelspace, this should never fail */
file = filp_open("/dev/console", O_RDWR, 0);
- if (!file)
+ if (IS_ERR(file))
goto err_out;

/* create stdin/stdout/stderr, this should never fail */

and yes,that particular problem only triggers when you have some odd
root filesystem without a /dev/console. Or a kernel config that
doesn't have those devices enabled at all.

I delayed pulling it for a couple of days, but the branch was not in
linux-next, so my delay didn't make any difference, and all these
things only became obvious after I pulled. And while it was all
horribly buggy, it was only buggy for the "these cases don't happen in
a normal distro" case, so the regular use didn't show them.

My bad. I shouldn't have pulled this, but it all looked very obvious
and trivial.

Linus

\
 
 \ /
  Last update: 2019-12-17 21:40    [W:0.116 / U:2.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site