linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] remove ksys_mount() and ksys_dup()
@ 2019-12-12 18:14 Dominik Brodowski
  2019-12-12 18:14 ` [PATCH 1/5] devtmpfs: use do_mount() instead of ksys_mount() Dominik Brodowski
                   ` (7 more replies)
  0 siblings, 8 replies; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-12 18:14 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, Andrew Morton,
	Ingo Molnar, linux-kernel

The following changes since commit ae4b064e2a616b545acf02b8f50cc513b32c7522:

  Merge tag 'afs-fixes-20191211' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs (2019-12-11 18:10:40 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git remove-ksys-mount-dup

for you to fetch changes up to 8243186f0cc7c57cf9d6a110cd7315c44e3e0be8:

  fs: remove ksys_dup() (2019-12-12 19:00:36 +0100)

This small series replaces all in-kernel calls to the
userspace-focused ksys_mount() and ksys_dup() with calls
to kernel-centric functions:

For each replacement of ksys_mount() with do_mount(),
one needs to verify that the first and third parameter
(char *dev_name, char *type) are strings allocated in
kernelspace and that the fifth parameter (void *data)
is either NULL or refers to a full page (only occurence
in init/do_mounts.c::do_mount_root()). The second and
fourth parameters (char *dir_name, unsigned long flags)
are passed by ksys_mount() to do_mount() unchanged, and
therefore do not require particular care.

Moreover, instead of pretending to be userspace, the opening
of /dev/console as stdin/stdout/stderr can be implemented
using in-kernel functions as well. Thereby, ksys_dup() can
be removed for good.

---

Changes since the split-series patches[1,2]:
- merge both series (on suggestion by Linus)
- remove pointless cast (on suggestion by Linus)

[1] https://lore.kernel.org/lkml/20191212135724.331342-1-linux@dominikbrodowski.net/
[2] https://lore.kernel.org/lkml/20191212140752.347520-1-linux@dominikbrodowski.net/


Thanks,
	Dominik


----------------------------------------------------------------
Dominik Brodowski (5):
      devtmpfs: use do_mount() instead of ksys_mount()
      initrd: use do_mount() instead of ksys_mount()
      init: use do_mount() instead of ksys_mount()
      init: unify opening /dev/console as stdin/stdout/stderr
      fs: remove ksys_dup()

 drivers/base/devtmpfs.c  |  6 +++---
 fs/file.c                |  7 +------
 fs/namespace.c           | 10 ++--------
 include/linux/device.h   |  4 ++--
 include/linux/initrd.h   |  2 ++
 include/linux/syscalls.h |  3 ---
 init/do_mounts.c         | 30 +++++++++++++++++++++++-------
 init/do_mounts_initrd.c  | 11 ++++-------
 init/main.c              | 31 ++++++++++++++++++++++++++-----
 9 files changed, 63 insertions(+), 41 deletions(-)

-- 
2.24.1

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 1/5] devtmpfs: use do_mount() instead of ksys_mount()
  2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
@ 2019-12-12 18:14 ` Dominik Brodowski
  2019-12-12 18:14 ` [PATCH 2/5] initrd: " Dominik Brodowski
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-12 18:14 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, Andrew Morton,
	Ingo Molnar, linux-kernel

In devtmpfs, do_mount() can be called directly instead of complex wrapping
by ksys_mount():
- the first and third arguments are const strings in the kernel,
  and do not need to be copied over from userspace;
- the fifth argument is NULL, and therefore no page needs to be
  copied over from userspace;
- the second and fourth argument are passed through anyway.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 drivers/base/devtmpfs.c | 6 +++---
 include/linux/device.h  | 4 ++--
 init/do_mounts.c        | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 30d0523014e0..6cdbf1531238 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -359,7 +359,7 @@ static int handle_remove(const char *nodename, struct device *dev)
  * If configured, or requested by the commandline, devtmpfs will be
  * auto-mounted after the kernel mounted the root filesystem.
  */
-int devtmpfs_mount(const char *mntdir)
+int devtmpfs_mount(void)
 {
 	int err;
 
@@ -369,7 +369,7 @@ int devtmpfs_mount(const char *mntdir)
 	if (!thread)
 		return 0;
 
-	err = ksys_mount("devtmpfs", mntdir, "devtmpfs", MS_SILENT, NULL);
+	err = do_mount("devtmpfs", "dev", "devtmpfs", MS_SILENT, NULL);
 	if (err)
 		printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
 	else
@@ -394,7 +394,7 @@ static int devtmpfsd(void *p)
 	*err = ksys_unshare(CLONE_NEWNS);
 	if (*err)
 		goto out;
-	*err = ksys_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, NULL);
+	*err = do_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, NULL);
 	if (*err)
 		goto out;
 	ksys_chdir("/.."); /* will traverse into overmounted root */
diff --git a/include/linux/device.h b/include/linux/device.h
index e226030c1df3..96ff76731e93 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1666,11 +1666,11 @@ extern bool kill_device(struct device *dev);
 #ifdef CONFIG_DEVTMPFS
 extern int devtmpfs_create_node(struct device *dev);
 extern int devtmpfs_delete_node(struct device *dev);
-extern int devtmpfs_mount(const char *mntdir);
+extern int devtmpfs_mount(void);
 #else
 static inline int devtmpfs_create_node(struct device *dev) { return 0; }
 static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
-static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
+static inline int devtmpfs_mount(void) { return 0; }
 #endif
 
 /* drivers/base/power/shutdown.c */
diff --git a/init/do_mounts.c b/init/do_mounts.c
index af9cda887a23..43f6d098c880 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -670,7 +670,7 @@ void __init prepare_namespace(void)
 
 	mount_root();
 out:
-	devtmpfs_mount("dev");
+	devtmpfs_mount();
 	ksys_mount(".", "/", NULL, MS_MOVE, NULL);
 	ksys_chroot(".");
 }
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 2/5] initrd: use do_mount() instead of ksys_mount()
  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 ` Dominik Brodowski
  2019-12-12 18:14 ` [PATCH 3/5] init: " Dominik Brodowski
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-12 18:14 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, Andrew Morton,
	Ingo Molnar, linux-kernel

All three calls to ksys_mount() in initrd-related kernel code can
be switched over to do_mount():
- the first and third arguments are const strings in the kernel,
  and do not need to be copied over from userspace;
- the fifth argument is NULL, and therefore no page needs to be,
  copied over from userspace;
- the second and fourth argument are passed through anyway.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 init/do_mounts_initrd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index a9c6cc56f505..3bf7b74153ab 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -54,7 +54,7 @@ static int init_linuxrc(struct subprocess_info *info, struct cred *new)
 	ksys_dup(0);
 	/* move initrd over / and chdir/chroot in initrd root */
 	ksys_chdir("/root");
-	ksys_mount(".", "/", NULL, MS_MOVE, NULL);
+	do_mount(".", "/", NULL, MS_MOVE, NULL);
 	ksys_chroot(".");
 	ksys_setsid();
 	return 0;
@@ -89,7 +89,7 @@ static void __init handle_initrd(void)
 	current->flags &= ~PF_FREEZER_SKIP;
 
 	/* move initrd to rootfs' /old */
-	ksys_mount("..", ".", NULL, MS_MOVE, NULL);
+	do_mount("..", ".", NULL, MS_MOVE, NULL);
 	/* switch root and cwd back to / of rootfs */
 	ksys_chroot("..");
 
@@ -103,7 +103,7 @@ static void __init handle_initrd(void)
 	mount_root();
 
 	printk(KERN_NOTICE "Trying to move old root to /initrd ... ");
-	error = ksys_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL);
+	error = do_mount("/old", "/root/initrd", NULL, MS_MOVE, NULL);
 	if (!error)
 		printk("okay\n");
 	else {
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 3/5] init: use do_mount() instead of ksys_mount()
  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 ` Dominik Brodowski
  2019-12-16  9:45   ` Borislav Petkov
  2019-12-12 18:14 ` [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr Dominik Brodowski
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-12 18:14 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, Andrew Morton,
	Ingo Molnar, linux-kernel

In prepare_namespace(), do_mount() can be used instead of ksys_mount()
as the first and third argument are const strings in the kernel, the
second and fourth argument are passed through anyway, and the fifth
argument is NULL.

In do_mount_root(), ksys_mount() is called with the first and third
argument being already kernelspace strings, which do not need to be
copied over from userspace to kernelspace (again). The second and
fourth arguments are passed through to do_mount() anyway. The fifth
argument, while already residing in kernelspace, needs to be put into
a page of its own. Then, do_mount() can be used instead of
ksys_mount().

Once this is done, there are no in-kernel users to ksys_mount() left,
which can therefore be removed.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 fs/namespace.c           | 10 ++--------
 include/linux/syscalls.h |  2 --
 init/do_mounts.c         | 28 ++++++++++++++++++++++------
 3 files changed, 24 insertions(+), 16 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 2fd0c8bcb8c1..be601d3a8008 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3325,8 +3325,8 @@ struct dentry *mount_subtree(struct vfsmount *m, const char *name)
 }
 EXPORT_SYMBOL(mount_subtree);
 
-int ksys_mount(const char __user *dev_name, const char __user *dir_name,
-	       const char __user *type, unsigned long flags, void __user *data)
+SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
+		char __user *, type, unsigned long, flags, void __user *, data)
 {
 	int ret;
 	char *kernel_type;
@@ -3359,12 +3359,6 @@ int ksys_mount(const char __user *dev_name, const char __user *dir_name,
 	return ret;
 }
 
-SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
-		char __user *, type, unsigned long, flags, void __user *, data)
-{
-	return ksys_mount(dev_name, dir_name, type, flags, data);
-}
-
 /*
  * Create a kernel mount representation for a new, prepared superblock
  * (specified by fs_fd) and attach to an open_tree-like file descriptor.
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index d0391cc2dae9..5262b7a76d39 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -1231,8 +1231,6 @@ asmlinkage long sys_ni_syscall(void);
  * the ksys_xyzyyz() functions prototyped below.
  */
 
-int ksys_mount(const char __user *dev_name, const char __user *dir_name,
-	       const char __user *type, unsigned long flags, void __user *data);
 int ksys_umount(char __user *name, int flags);
 int ksys_dup(unsigned int fildes);
 int ksys_chroot(const char __user *filename);
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);
+	strncpy(data_page, data, PAGE_SIZE - 1);
+
+	ret = do_mount(name, "/root", fs, flags, data_page);
+	if (ret)
+		goto out;
 
 	ksys_chdir("/root");
 	s = current->fs->pwd.dentry->d_sb;
@@ -402,7 +415,10 @@ static int __init do_mount_root(char *name, char *fs, int flags, void *data)
 	       s->s_type->name,
 	       sb_rdonly(s) ? " readonly" : "",
 	       MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
-	return 0;
+
+out:
+	put_page(p);
+	return ret;
 }
 
 void __init mount_block_root(char *name, int flags)
@@ -671,7 +687,7 @@ void __init prepare_namespace(void)
 	mount_root();
 out:
 	devtmpfs_mount();
-	ksys_mount(".", "/", NULL, MS_MOVE, NULL);
+	do_mount(".", "/", NULL, MS_MOVE, NULL);
 	ksys_chroot(".");
 }
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
                   ` (2 preceding siblings ...)
  2019-12-12 18:14 ` [PATCH 3/5] init: " Dominik Brodowski
@ 2019-12-12 18:14 ` Dominik Brodowski
  2019-12-12 18:14 ` [PATCH 5/5] fs: remove ksys_dup() Dominik Brodowski
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-12 18:14 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, Andrew Morton,
	Ingo Molnar, linux-kernel

Merge the two instances where /dev/console is opened as
stdin/stdout/stderr.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 include/linux/initrd.h  |  2 ++
 init/do_mounts_initrd.c |  5 +----
 init/main.c             | 17 ++++++++++++-----
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/include/linux/initrd.h b/include/linux/initrd.h
index d77fe34fb00a..aa5914355728 100644
--- a/include/linux/initrd.h
+++ b/include/linux/initrd.h
@@ -28,3 +28,5 @@ extern unsigned int real_root_dev;
 
 extern char __initramfs_start[];
 extern unsigned long __initramfs_size;
+
+void console_on_rootfs(void);
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c
index 3bf7b74153ab..dab8b1151b56 100644
--- a/init/do_mounts_initrd.c
+++ b/init/do_mounts_initrd.c
@@ -48,10 +48,7 @@ early_param("initrd", early_initrd);
 static int init_linuxrc(struct subprocess_info *info, struct cred *new)
 {
 	ksys_unshare(CLONE_FS | CLONE_FILES);
-	/* stdin/stdout/stderr for /linuxrc */
-	ksys_open("/dev/console", O_RDWR, 0);
-	ksys_dup(0);
-	ksys_dup(0);
+	console_on_rootfs();
 	/* move initrd over / and chdir/chroot in initrd root */
 	ksys_chdir("/root");
 	do_mount(".", "/", NULL, MS_MOVE, NULL);
diff --git a/init/main.c b/init/main.c
index 91f6ebb30ef0..2cd736059416 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1155,6 +1155,17 @@ static int __ref kernel_init(void *unused)
 	      "See Linux Documentation/admin-guide/init.rst for guidance.");
 }
 
+void console_on_rootfs(void)
+{
+	/* Open the /dev/console as stdin, this should never fail */
+	if (ksys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
+		pr_err("Warning: unable to open an initial console.\n");
+
+	/* create stdout/stderr */
+	(void) ksys_dup(0);
+	(void) ksys_dup(0);
+}
+
 static noinline void __init kernel_init_freeable(void)
 {
 	/*
@@ -1190,12 +1201,8 @@ static noinline void __init kernel_init_freeable(void)
 
 	do_basic_setup();
 
-	/* Open the /dev/console on the rootfs, this should never fail */
-	if (ksys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
-		pr_err("Warning: unable to open an initial console.\n");
+	console_on_rootfs();
 
-	(void) ksys_dup(0);
-	(void) ksys_dup(0);
 	/*
 	 * check if there is an early userspace init.  If yes, let it do all
 	 * the work
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 5/5] fs: remove ksys_dup()
  2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
                   ` (3 preceding siblings ...)
  2019-12-12 18:14 ` [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr Dominik Brodowski
@ 2019-12-12 18:14 ` Dominik Brodowski
  2019-12-15 19:50 ` [GIT PULL] remove ksys_mount() and ksys_dup() Linus Torvalds
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-12 18:14 UTC (permalink / raw)
  To: Alexander Viro, Linus Torvalds
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, Andrew Morton,
	Ingo Molnar, linux-kernel

ksys_dup() is used only at one place in the kernel, namely to duplicate
fd 0 of /dev/console to stdout and stderr. The same functionality can be
achieved by using functions already available within the kernel namespace.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 fs/file.c                |  7 +------
 include/linux/syscalls.h |  1 -
 init/main.c              | 26 ++++++++++++++++++++------
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/fs/file.c b/fs/file.c
index 3da91a112bab..2f4fcf985079 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -960,7 +960,7 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
 	return ksys_dup3(oldfd, newfd, 0);
 }
 
-int ksys_dup(unsigned int fildes)
+SYSCALL_DEFINE1(dup, unsigned int, fildes)
 {
 	int ret = -EBADF;
 	struct file *file = fget_raw(fildes);
@@ -975,11 +975,6 @@ int ksys_dup(unsigned int fildes)
 	return ret;
 }
 
-SYSCALL_DEFINE1(dup, unsigned int, fildes)
-{
-	return ksys_dup(fildes);
-}
-
 int f_dupfd(unsigned int from, struct file *file, unsigned flags)
 {
 	int err;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 5262b7a76d39..2960dedcfde8 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -1232,7 +1232,6 @@ asmlinkage long sys_ni_syscall(void);
  */
 
 int ksys_umount(char __user *name, int flags);
-int ksys_dup(unsigned int fildes);
 int ksys_chroot(const char __user *filename);
 ssize_t ksys_write(unsigned int fd, const char __user *buf, size_t count);
 int ksys_chdir(const char __user *filename);
diff --git a/init/main.c b/init/main.c
index 2cd736059416..ec3a1463ac69 100644
--- a/init/main.c
+++ b/init/main.c
@@ -93,6 +93,7 @@
 #include <linux/rodata_test.h>
 #include <linux/jump_label.h>
 #include <linux/mem_encrypt.h>
+#include <linux/file.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -1157,13 +1158,26 @@ static int __ref kernel_init(void *unused)
 
 void console_on_rootfs(void)
 {
-	/* Open the /dev/console as stdin, this should never fail */
-	if (ksys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
-		pr_err("Warning: unable to open an initial console.\n");
+	struct file *file;
+	unsigned int i;
+
+	/* Open /dev/console in kernelspace, this should never fail */
+	file = filp_open("/dev/console", O_RDWR, 0);
+	if (!file)
+		goto err_out;
+
+	/* create stdin/stdout/stderr, this should never fail */
+	for (i = 0; i < 3; i++) {
+		if (f_dupfd(i, file, 0) != i)
+			goto err_out;
+	}
+
+	return;
 
-	/* create stdout/stderr */
-	(void) ksys_dup(0);
-	(void) ksys_dup(0);
+err_out:
+	/* no panic -- this might not be fatal */
+	pr_err("Warning: unable to open an initial console.\n");
+	return;
 }
 
 static noinline void __init kernel_init_freeable(void)
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
                   ` (4 preceding siblings ...)
  2019-12-12 18:14 ` [PATCH 5/5] fs: remove ksys_dup() Dominik Brodowski
@ 2019-12-15 19:50 ` Linus Torvalds
  2019-12-15 20:50 ` pr-tracker-bot
  2019-12-17  5:17 ` [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr youling257
  7 siblings, 0 replies; 28+ messages in thread
From: Linus Torvalds @ 2019-12-15 19:50 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Alexander Viro, Greg Kroah-Hartman, Rafael J . Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

On Thu, Dec 12, 2019 at 10:14 AM Dominik Brodowski
<linux@dominikbrodowski.net> wrote:
>
>       the fifth parameter (void *data)
> is either NULL or refers to a full page (only occurence
> in init/do_mounts.c::do_mount_root()).

We probably should aim for the fifth parameter being a "buf, len" pair
at some point.

Then the system call interface still needs to copy the whole page and
pass in PAGE_SIZE as the length, but it would be a better model than
the magical fixed "it's always one page". And the kernel init sequence
wouldn't need that silly temporary page any more.

                 Linus

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
                   ` (5 preceding siblings ...)
  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  5:17 ` [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr youling257
  7 siblings, 1 reply; 28+ messages in thread
From: pr-tracker-bot @ 2019-12-15 20:50 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Alexander Viro, Linus Torvalds, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar, linux-kernel

The pull request you sent on Thu, 12 Dec 2019 19:14:17 +0100:

> git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux.git remove-ksys-mount-dup

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/2e6d304515ba9936d85265ad93dddc4c13c17d06

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/5] init: use do_mount() instead of ksys_mount()
  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
  0 siblings, 1 reply; 28+ messages in thread
From: Borislav Petkov @ 2019-12-16  9:45 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Alexander Viro, Linus Torvalds, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar, linux-kernel

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.

Reverting the patch fixes the boot.

Thx.

[    3.575074] BUG: kernel NULL pointer dereference, address: 0000000000000000
[    3.576858] #PF: supervisor read access in kernel mode
[    3.578274] #PF: error_code(0x0000) - not-present page
[    3.579003] PGD 0 P4D 0 
[    3.579003] Oops: 0000 [#1] PREEMPT SMP
[    3.579003] CPU: 8 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc1+ #17
[    3.579003] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-1 04/01/2014
[    3.579003] RIP: 0010:strncpy+0xf/0x30
[    3.579003] Code: 0f b6 0c 16 88 0c 10 48 ff c2 84 c9 75 f2 f3 c3 66 66 2e 0f 1f 84 00 00 00 00 00 48 85 d2 48 89 f8 74 1b 4c 8d 04 17 48 89 fa <0f> b6 0e 80 f9 01 88 0a 48 83 de ff 48 ff c2 4c 39 c2 75 ec f3 c3
[    3.579003] RSP: 0018:ffffc90000013eb8 EFLAGS: 00010206
[    3.579003] RAX: ffff88807b780000 RBX: 0000000000008001 RCX: 0000000000000000
[    3.579003] RDX: ffff88807b780000 RSI: 0000000000000000 RDI: ffff88807b780000
[    3.579003] RBP: ffff88807b781000 R08: ffff88807b780fff R09: 00000000000770f4
[    3.579003] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88807b781000
[    3.579003] R13: 0000000000000000 R14: 0000000000000000 R15: ffffea0001ede000
[    3.579003] FS:  0000000000000000(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000
[    3.579003] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.579003] CR2: 0000000000000000 CR3: 0000000002009000 CR4: 00000000003406e0
[    3.579003] Call Trace:
[    3.579003]  mount_block_root+0x14f/0x312
[    3.579003]  prepare_namespace+0x136/0x165
[    3.579003]  ? rest_init+0xb9/0xb9
[    3.579003]  kernel_init+0xa/0xf7
[    3.579003]  ret_from_fork+0x22/0x40
[    3.579003] Modules linked in:
[    3.579003] CR2: 0000000000000000
[    3.579003] ---[ end trace 2884b7e501f1daa6 ]---
[    3.579003] RIP: 0010:strncpy+0xf/0x30
[    3.579003] Code: 0f b6 0c 16 88 0c 10 48 ff c2 84 c9 75 f2 f3 c3 66 66 2e 0f 1f 84 00 00 00 00 00 48 85 d2 48 89 f8 74 1b 4c 8d 04 17 48 89 fa <0f> b6 0e 80 f9 01 88 0a 48 83 de ff 48 ff c2 4c 39 c2 75 ec f3 c3
[    3.579003] RSP: 0018:ffffc90000013eb8 EFLAGS: 00010206
[    3.579003] RAX: ffff88807b780000 RBX: 0000000000008001 RCX: 0000000000000000
[    3.579003] RDX: ffff88807b780000 RSI: 0000000000000000 RDI: ffff88807b780000
[    3.579003] RBP: ffff88807b781000 R08: ffff88807b780fff R09: 00000000000770f4
[    3.579003] R10: 0000000000000000 R11: 0000000000000000 R12: ffff88807b781000
[    3.579003] R13: 0000000000000000 R14: 0000000000000000 R15: ffffea0001ede000
[    3.579003] FS:  0000000000000000(0000) GS:ffff88807dc00000(0000) knlGS:0000000000000000
[    3.579003] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    3.579003] CR2: 0000000000000000 CR3: 0000000002009000 CR4: 00000000003406e0
[    3.611795] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
[    3.612923] Kernel Offset: disabled
[    3.613505] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009 ]---

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/5] init: use do_mount() instead of ksys_mount()
  2019-12-16  9:45   ` Borislav Petkov
@ 2019-12-16  9:51     ` Dominik Brodowski
  2019-12-16 10:19       ` Borislav Petkov
  0 siblings, 1 reply; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-16  9:51 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Alexander Viro, Linus Torvalds, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar, linux-kernel

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 3/5] init: use do_mount() instead of ksys_mount()
  2019-12-16  9:51     ` Dominik Brodowski
@ 2019-12-16 10:19       ` Borislav Petkov
  0 siblings, 0 replies; 28+ messages in thread
From: Borislav Petkov @ 2019-12-16 10:19 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Alexander Viro, Linus Torvalds, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar, linux-kernel

On Mon, Dec 16, 2019 at 10:51:37AM +0100, Dominik Brodowski wrote:
> Does
> 
> https://lore.kernel.org/lkml/CAHk-=wh8VLe3AEKhz=1bzSO=1fv4EM71EhufxuC=Gp=+bLhXoA@mail.gmail.com/
> 
> solve the issue?

Yap, it does.

Reported-by: Borislav Petkov <bp@suse.de>
Tested-by: Borislav Petkov <bp@suse.de>

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-12 18:14 [GIT PULL] remove ksys_mount() and ksys_dup() Dominik Brodowski
                   ` (6 preceding siblings ...)
  2019-12-15 20:50 ` pr-tracker-bot
@ 2019-12-17  5:17 ` youling257
  2019-12-17  6:42   ` Dominik Brodowski
  7 siblings, 1 reply; 28+ messages in thread
From: youling257 @ 2019-12-17  5:17 UTC (permalink / raw)
  To: linux
  Cc: viro, torvalds, gregkh, rafael, akpm, mingo, linux-kernel, youling257

it caused Androidx86 /system/bin/sh: No controlling tty: open /dev/tty: No such device or address
/system/bin/sh: warning: won't have full job control

Androidx86 alt+f1 root on tmpfs, alt+f2/f3 root on rootfs.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  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
  0 siblings, 1 reply; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-17  6:42 UTC (permalink / raw)
  To: youling257; +Cc: viro, torvalds, gregkh, rafael, akpm, mingo, linux-kernel

On Tue, Dec 17, 2019 at 01:17:51PM +0800, youling257 wrote:
> it caused Androidx86 /system/bin/sh: No controlling tty: open /dev/tty: No such device or address
> /system/bin/sh: warning: won't have full job control
> 
> Androidx86 alt+f1 root on tmpfs, alt+f2/f3 root on rootfs.

Are you sure it is caused by the patch you reference? It's really only
moving code around, and does not depend on tmpfs/rootfs. The exact same
three calls are made before and after the change, see
	https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b49a733d684e0096340b93e9dfd471f0e3ddc06d

The preceding patch (3/5) needs a bugfix which already is upstream, though.
	https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7de7de7ca0ae0fc70515ee3154af33af75edae2c

Thanks,
	Dominik

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-17  6:42   ` Dominik Brodowski
@ 2019-12-17  9:33     ` youling 257
  2019-12-17 21:14       ` Linus Torvalds
  0 siblings, 1 reply; 28+ messages in thread
From: youling 257 @ 2019-12-17  9:33 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: viro, torvalds, gregkh, rafael, akpm, mingo, linux-kernel

I had been Revert "fs: remove ksys_dup()" Revert "init: unify opening
/dev/console as stdin/stdout/stderr", test boot, n the system/bin/sh
warning.

2019-12-17 14:42 GMT+08:00, Dominik Brodowski <linux@dominikbrodowski.net>:
> On Tue, Dec 17, 2019 at 01:17:51PM +0800, youling257 wrote:
>> it caused Androidx86 /system/bin/sh: No controlling tty: open /dev/tty: No
>> such device or address
>> /system/bin/sh: warning: won't have full job control
>>
>> Androidx86 alt+f1 root on tmpfs, alt+f2/f3 root on rootfs.
>
> Are you sure it is caused by the patch you reference? It's really only
> moving code around, and does not depend on tmpfs/rootfs. The exact same
> three calls are made before and after the change, see
> 	https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b49a733d684e0096340b93e9dfd471f0e3ddc06d
>
> The preceding patch (3/5) needs a bugfix which already is upstream, though.
> 	https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7de7de7ca0ae0fc70515ee3154af33af75edae2c
>
> Thanks,
> 	Dominik
>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
       [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
  1 sibling, 1 reply; 28+ messages in thread
From: Greg Kroah-Hartman @ 2019-12-17 19:37 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: pr-tracker-bot, Dominik Brodowski, Alexander Viro,
	Linus Torvalds, Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	linux-kernel

On Tue, Dec 17, 2019 at 11:33:38AM -0800, Jesse Barnes wrote:
> Still debugging, but this causes a panic in console_on_rootfs() when we try
> to dup the fds for stderr and stdout.  Probably because in my config I have
> VT and framebuffer console disabled?
> Reverting 8243186f0cc7c57cf9d6a110cd7315c44e3e0be8
> and b49a733d684e0096340b93e9dfd471f0e3ddc06d worked around it for now...

Should already be fixed in Linus's tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  2019-12-17 19:37     ` Greg Kroah-Hartman
@ 2019-12-17 20:05       ` Jesse Barnes
  0 siblings, 0 replies; 28+ messages in thread
From: Jesse Barnes @ 2019-12-17 20:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: pr-tracker-bot, Dominik Brodowski, Alexander Viro,
	Linus Torvalds, Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	linux-kernel

On Tue, Dec 17, 2019 at 11:38 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Dec 17, 2019 at 11:33:38AM -0800, Jesse Barnes wrote:
> > Still debugging, but this causes a panic in console_on_rootfs() when we try
> > to dup the fds for stderr and stdout.  Probably because in my config I have
> > VT and framebuffer console disabled?
> > Reverting 8243186f0cc7c57cf9d6a110cd7315c44e3e0be8
> > and b49a733d684e0096340b93e9dfd471f0e3ddc06d worked around it for now...
>
> Should already be fixed in Linus's tree.

Arg sorry for the html mail.  I see the reverts now.

Thanks,
Jesse

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
       [not found]   ` <CAJmaN=ksaH5AgRUdVPGWKZzjEinU+goaCqedH1PW6OmKYc_TuA@mail.gmail.com>
  2019-12-17 19:37     ` Greg Kroah-Hartman
@ 2019-12-17 20:40     ` Linus Torvalds
  2019-12-17 22:21       ` Jesse Barnes
  1 sibling, 1 reply; 28+ messages in thread
From: Linus Torvalds @ 2019-12-17 20:40 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Dominik Brodowski, Alexander Viro, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	Linux Kernel Mailing List

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-17  9:33     ` youling 257
@ 2019-12-17 21:14       ` Linus Torvalds
  2019-12-18  4:10         ` youling 257
  2019-12-18 21:50         ` youling 257
  0 siblings, 2 replies; 28+ messages in thread
From: Linus Torvalds @ 2019-12-17 21:14 UTC (permalink / raw)
  To: youling 257
  Cc: Dominik Brodowski, Al Viro, Greg Kroah-Hartman, Rafael Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

This should be fixed by 2d3145f8d280 ("early init: fix error handling
when opening /dev/console")

I'm not sure what you did to trigger that bug, but it was a bug.

              Linus


On Tue, Dec 17, 2019 at 1:34 AM youling 257 <youling257@gmail.com> wrote:
>
> I had been Revert "fs: remove ksys_dup()" Revert "init: unify opening
> /dev/console as stdin/stdout/stderr", test boot, n the system/bin/sh
> warning.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  2019-12-17 20:40     ` Linus Torvalds
@ 2019-12-17 22:21       ` Jesse Barnes
  2019-12-17 22:57         ` Al Viro
  0 siblings, 1 reply; 28+ messages in thread
From: Jesse Barnes @ 2019-12-17 22:21 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Dominik Brodowski, Alexander Viro, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	Linux Kernel Mailing List

On Tue, Dec 17, 2019 at 12:40 PM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> 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.

Oh I should have caught that too, I was looking right at it...

But anyway it looks like a nice cleanup with a few more fixes.
Hopefully we can get there soon...

Thanks,
Jesse

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  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
  0 siblings, 2 replies; 28+ messages in thread
From: Al Viro @ 2019-12-17 22:57 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Linus Torvalds, Dominik Brodowski, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	Linux Kernel Mailing List

On Tue, Dec 17, 2019 at 02:21:03PM -0800, Jesse Barnes wrote:
> > 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.
> 
> Oh I should have caught that too, I was looking right at it...
> 
> But anyway it looks like a nice cleanup with a few more fixes.
> Hopefully we can get there soon...

FWIW, this is precisely what I'd been talking about[*] - instead of
a plain "we are reusing the damn syscall, with fixed interface and
debugged by userland all the time" we'd got an open-coded analogue
that will be a headache (and a source of bitrot) for years.

It's not a normal part of the kernel, and I bloody well remember
what kind of headache it had been before it got massaged to use
of plain syscalls.  Constant need to remember that a change in
VFS guts might break something in the code that is hell to
debug - getting test coverage for it is not fun at all.  As we
are seeing right now...

Seriously, these parts of init/* ought to be treated as userland code
that runs in kernel mode mostly because it's too much PITA to arrange
building a static ELF binary and linking it into the image.


[*] "IMO it's not a good idea.  Exposing the guts of fs/namespace.c to
what's essentially a userland code that happens to run in kernel thread
is asking for trouble - we'd been there and it had been hell to untangle."

My fault, I guess - should've been more specific than that ;-/

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  2019-12-17 22:57         ` Al Viro
@ 2019-12-17 23:23           ` Al Viro
  2019-12-18  7:51           ` Dominik Brodowski
  1 sibling, 0 replies; 28+ messages in thread
From: Al Viro @ 2019-12-17 23:23 UTC (permalink / raw)
  To: Jesse Barnes
  Cc: Linus Torvalds, Dominik Brodowski, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	Linux Kernel Mailing List

On Tue, Dec 17, 2019 at 10:57:43PM +0000, Al Viro wrote:
> On Tue, Dec 17, 2019 at 02:21:03PM -0800, Jesse Barnes wrote:
> > > 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.
> > 
> > Oh I should have caught that too, I was looking right at it...
> > 
> > But anyway it looks like a nice cleanup with a few more fixes.
> > Hopefully we can get there soon...
> 
> FWIW, this is precisely what I'd been talking about[*] - instead of
> a plain "we are reusing the damn syscall, with fixed interface and
> debugged by userland all the time" we'd got an open-coded analogue
> that will be a headache (and a source of bitrot) for years.
> 
> It's not a normal part of the kernel, and I bloody well remember
> what kind of headache it had been before it got massaged to use
> of plain syscalls.  Constant need to remember that a change in
> VFS guts might break something in the code that is hell to
> debug - getting test coverage for it is not fun at all.  As we
> are seeing right now...
> 
> Seriously, these parts of init/* ought to be treated as userland code
> that runs in kernel mode mostly because it's too much PITA to arrange
> building a static ELF binary and linking it into the image.
> 
> 
> [*] "IMO it's not a good idea.  Exposing the guts of fs/namespace.c to
> what's essentially a userland code that happens to run in kernel thread
> is asking for trouble - we'd been there and it had been hell to untangle."
> 
> My fault, I guess - should've been more specific than that ;-/

PS: please, don't take that kind of stuff any further; right now all that
thing does is marshalling the arguments.  At that level it's just going
to be a headache while debugging that code.  Take it further (e.g.
play with calling do_move_mount() et.al. instead of using MS_MOVE) and
the headache will be ongoing, not just one-time.  "Just use ksys_...()
in init/*.c" prevented that kind of stuff; now that this policy no
longer holds, we'd better watch out for trouble in that area.

To quote the original patchset, "instead of pretending to be userspace,
... can be implemented using using in-kernel functions" and exact same
rationale would lead to a lot of trouble.  That's what I'm really
worried about; let's not go there.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  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
  1 sibling, 1 reply; 28+ messages in thread
From: youling 257 @ 2019-12-18  4:10 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Dominik Brodowski, Al Viro, Greg Kroah-Hartman, Rafael Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

only Revert "fs: remove ksys_dup()", not see the warning
"/system/bin/sh: No controlling tty: open /dev/tty: No such device or
address."

yes, "fs: remove ksys_dup()" caused my system/bin/sh problem.

but test "early init: fix error handling when opening /dev/console",
still can see "/system/bin/sh: No controlling tty" warning, it not
solve my problem.


2019-12-18 5:14 GMT+08:00, Linus Torvalds <torvalds@linux-foundation.org>:
> This should be fixed by 2d3145f8d280 ("early init: fix error handling
> when opening /dev/console")
>
> I'm not sure what you did to trigger that bug, but it was a bug.
>
>               Linus
>
>
> On Tue, Dec 17, 2019 at 1:34 AM youling 257 <youling257@gmail.com> wrote:
>>
>> I had been Revert "fs: remove ksys_dup()" Revert "init: unify opening
>> /dev/console as stdin/stdout/stderr", test boot, n the system/bin/sh
>> warning.
>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  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
  1 sibling, 1 reply; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-18  7:51 UTC (permalink / raw)
  To: Al Viro
  Cc: Jesse Barnes, Linus Torvalds, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	Linux Kernel Mailing List

On Tue, Dec 17, 2019 at 10:57:43PM +0000, Al Viro wrote:
> Seriously, these parts of init/* ought to be treated as userland code
> that runs in kernel mode mostly because it's too much PITA to arrange
> building a static ELF binary and linking it into the image.

Well, we have had the infrastructure for fork_usermode_blob() in the kernel
since May 2018, though it is not really used so far (the bpfilter blob is
just reporting its existence, and not doing anything substantial). Probably,
significant parts of init/* could be migrated to such a blob. Would that be
an alternative generally preferred, or is its dependence on CC_CAN_LINK a
showstopper?

FWIW, non-initramfs boot code is considered to be "legacy" since 2.6.16, see
filesystems/ramfs-rootfs-initramfs.txt:

| Today (2.6.16), initramfs is always compiled in, but not always used.  The
| kernel falls back to legacy boot code that is reached only if initramfs does
| not contain an /init program.  The fallback is legacy code, there to ensure a
| smooth transition and allowing early boot functionality to gradually move to
| "early userspace" (I.E. initramfs).
|
| ...
|
| This kind of complexity (which inevitably includes policy) is rightly handled
| in userspace.  Both klibc and busybox/uClibc are working on simple initramfs
| packages to drop into a kernel build.
|
| The klibc package has now been accepted into Andrew Morton's 2.6.17-mm tree.
| The kernel's current early boot code (partition detection, etc) will probably
| be migrated into a default initramfs, automatically created and used by the
| kernel build.

That plan seems to have been obsoleted long ago, right?

Thanks,
	Dominik

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-18  4:10         ` youling 257
@ 2019-12-18  8:03           ` Dominik Brodowski
  0 siblings, 0 replies; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-18  8:03 UTC (permalink / raw)
  To: youling 257
  Cc: Linus Torvalds, Al Viro, Greg Kroah-Hartman, Rafael Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

On Wed, Dec 18, 2019 at 12:10:08PM +0800, youling 257 wrote:
> only Revert "fs: remove ksys_dup()", not see the warning
> "/system/bin/sh: No controlling tty: open /dev/tty: No such device or
> address."
> 
> yes, "fs: remove ksys_dup()" caused my system/bin/sh problem.
> 
> but test "early init: fix error handling when opening /dev/console",
> still can see "/system/bin/sh: No controlling tty" warning, it not
> solve my problem.

FWIW, I see a similar (seemingly harmless) warning both _before_ and
after my patches, so I am not sure that this is a real regression.

Thanks,
	Dominik

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [GIT PULL] remove ksys_mount() and ksys_dup()
  2019-12-18  7:51           ` Dominik Brodowski
@ 2019-12-18 13:37             ` Al Viro
  0 siblings, 0 replies; 28+ messages in thread
From: Al Viro @ 2019-12-18 13:37 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Jesse Barnes, Linus Torvalds, Greg Kroah-Hartman,
	Rafael J . Wysocki, Andrew Morton, Ingo Molnar,
	Linux Kernel Mailing List

On Wed, Dec 18, 2019 at 08:51:19AM +0100, Dominik Brodowski wrote:
> On Tue, Dec 17, 2019 at 10:57:43PM +0000, Al Viro wrote:
> > Seriously, these parts of init/* ought to be treated as userland code
> > that runs in kernel mode mostly because it's too much PITA to arrange
> > building a static ELF binary and linking it into the image.
> 
> Well, we have had the infrastructure for fork_usermode_blob() in the kernel
> since May 2018, though it is not really used so far (the bpfilter blob is
> just reporting its existence, and not doing anything substantial). Probably,
> significant parts of init/* could be migrated to such a blob. Would that be
> an alternative generally preferred, or is its dependence on CC_CAN_LINK a
> showstopper?

Well...  everything from default_rootfs/populate_rootfs call (incidentally,
stuff starting to leak into rootfs_initcall level shouldn't be mixed
with those two, but that's a separate story) and on to the end of
kernel_init_freeable() could be forked; the other bit (actual execve
attempts in the end of kernel_init()) must be in PID 1.

The problem is not just CC_CAN_LINK, it's the damn size of binaries...

> FWIW, non-initramfs boot code is considered to be "legacy" since 2.6.16, see
> filesystems/ramfs-rootfs-initramfs.txt:
> 
> | Today (2.6.16), initramfs is always compiled in, but not always used.  The
> | kernel falls back to legacy boot code that is reached only if initramfs does
> | not contain an /init program.  The fallback is legacy code, there to ensure a
> | smooth transition and allowing early boot functionality to gradually move to
> | "early userspace" (I.E. initramfs).
> |
> | ...
> |
> | This kind of complexity (which inevitably includes policy) is rightly handled
> | in userspace.  Both klibc and busybox/uClibc are working on simple initramfs
> | packages to drop into a kernel build.
> |
> | The klibc package has now been accepted into Andrew Morton's 2.6.17-mm tree.
> | The kernel's current early boot code (partition detection, etc) will probably
> | be migrated into a default initramfs, automatically created and used by the
> | kernel build.
> 
> That plan seems to have been obsoleted long ago, right?

klibc is not in mainline and I hadn't heard of attempts to get it into the
kernel git tree for quite a few years.  Whether this "just call sys_...()
instead of doing normal syscalls" is a stopgap measure until that happens
or something more permanent, the effect is the same - not poking in the
kernel internals from code with lousy test coverage...

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-17 21:14       ` Linus Torvalds
  2019-12-18  4:10         ` youling 257
@ 2019-12-18 21:50         ` youling 257
  2019-12-19  7:08           ` Dominik Brodowski
  1 sibling, 1 reply; 28+ messages in thread
From: youling 257 @ 2019-12-18 21:50 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Dominik Brodowski, Al Viro, Greg Kroah-Hartman, Rafael Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

2019-12-18 5:14 GMT+08:00, Linus Torvalds <torvalds@linux-foundation.org>:
> This should be fixed by 2d3145f8d280 ("early init: fix error handling
> when opening /dev/console")

this fix no help for me.

> I'm not sure what you did to trigger that bug, but it was a bug.

alt+f1, type bash command,
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-18 21:50         ` youling 257
@ 2019-12-19  7:08           ` Dominik Brodowski
  2019-12-19  9:34             ` youling 257
  0 siblings, 1 reply; 28+ messages in thread
From: Dominik Brodowski @ 2019-12-19  7:08 UTC (permalink / raw)
  To: youling 257
  Cc: Linus Torvalds, Al Viro, Greg Kroah-Hartman, Rafael Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

On Thu, Dec 19, 2019 at 05:50:19AM +0800, youling 257 wrote:
> 2019-12-18 5:14 GMT+08:00, Linus Torvalds <torvalds@linux-foundation.org>:
> > This should be fixed by 2d3145f8d280 ("early init: fix error handling
> > when opening /dev/console")
> 
> this fix no help for me.
> 
> > I'm not sure what you did to trigger that bug, but it was a bug.
> 
> alt+f1, type bash command,
> bash: cannot set terminal process group (-1): Inappropriate ioctl for device
> bash: no job control in this shell

Could you test this patch, please? And if it does not work: What is the
content of /proc/1/fd/ and /proc/1/fdinfo/* for the working and non-working
case? That are the only changes visible to userspace...

Thanks,
	Dominik

diff --git a/init/main.c b/init/main.c
index 1ecfd43ed464..8886530e9dec 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1162,7 +1162,7 @@ void console_on_rootfs(void)
 	unsigned int i;
 
 	/* Open /dev/console in kernelspace, this should never fail */
-	file = filp_open("/dev/console", O_RDWR, 0);
+	file = filp_open("/dev/console", force_o_largefile() ? O_LARGEFILE | O_RDWR : O_RDWR, 0);
 	if (IS_ERR(file))
 		goto err_out;
 

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH 4/5] init: unify opening /dev/console as stdin/stdout/stderr
  2019-12-19  7:08           ` Dominik Brodowski
@ 2019-12-19  9:34             ` youling 257
  0 siblings, 0 replies; 28+ messages in thread
From: youling 257 @ 2019-12-19  9:34 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: Linus Torvalds, Al Viro, Greg Kroah-Hartman, Rafael Wysocki,
	Andrew Morton, Ingo Molnar, Linux Kernel Mailing List

Test this patch not work, still has system/bin/sh warning.
ls -al /proc/1/fd
total 0
dr-x------ 2 root root  0 2019-12-19 17:19  [1;34m. [0m
dr-xr-xr-x 9 root root  0 2019-12-19 17:19  [1;34m.. [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m0 [0m ->
 [1;31m/android/sys/fs/selinux/null [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m1 [0m ->
 [1;31m/android/sys/fs/selinux/null [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m10 [0m ->
 [1;31msocket:[12337] [0m
l-wx------ 1 root root 64 2019-12-19 17:19  [1;36m11 [0m ->
 [1;31m/android/dev/pmsg0 [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m2 [0m ->
 [1;31m/android/sys/fs/selinux/null [0m
l-wx------ 1 root root 64 2019-12-19 17:19  [1;36m3 [0m ->
 [1;31m/android/dev/__kmsg__ (deleted) [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m4 [0m ->
 [1;31manon_inode:[eventpoll] [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m5 [0m ->
 [1;31msocket:[857] [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m6 [0m ->
 [1;31msocket:[858] [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m7 [0m ->
 [1;31msocket:[859] [0m
lrwx------ 1 root root 64 2019-12-19 17:19  [1;36m9 [0m ->
 [1;31msocket:[10698] [0m

Revert "fs: remove ksys_dup()", no the system/bin/sh warning.
ls -al /proc/1/fd
total 0
dr-x------ 2 root root  0 2019-12-19 17:28  [1;34m. [0m
dr-xr-xr-x 9 root root  0 2019-12-19 17:28  [1;34m.. [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m0 [0m ->
 [1;31m/android/sys/fs/selinux/null [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m1 [0m ->
 [1;31m/android/sys/fs/selinux/null [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m10 [0m ->
 [1;31msocket:[12506] [0m
l-wx------ 1 root root 64 2019-12-19 17:28  [1;36m11 [0m ->
 [1;31m/android/dev/pmsg0 [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m2 [0m ->
 [1;31m/android/sys/fs/selinux/null [0m
l-wx------ 1 root root 64 2019-12-19 17:28  [1;36m3 [0m ->
 [1;31m/android/dev/__kmsg__ (deleted) [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m4 [0m ->
 [1;31manon_inode:[eventpoll] [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m5 [0m ->
 [1;31msocket:[1957] [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m6 [0m ->
 [1;31msocket:[1958] [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m7 [0m ->
 [1;31msocket:[1959] [0m
lrwx------ 1 root root 64 2019-12-19 17:28  [1;36m9 [0m ->
 [1;31msocket:[2040] [0m

2019-12-19 15:08 GMT+08:00, Dominik Brodowski <linux@dominikbrodowski.net>:
> On Thu, Dec 19, 2019 at 05:50:19AM +0800, youling 257 wrote:
>> 2019-12-18 5:14 GMT+08:00, Linus Torvalds
>> <torvalds@linux-foundation.org>:
>> > This should be fixed by 2d3145f8d280 ("early init: fix error handling
>> > when opening /dev/console")
>>
>> this fix no help for me.
>>
>> > I'm not sure what you did to trigger that bug, but it was a bug.
>>
>> alt+f1, type bash command,
>> bash: cannot set terminal process group (-1): Inappropriate ioctl for
>> device
>> bash: no job control in this shell
>
> Could you test this patch, please? And if it does not work: What is the
> content of /proc/1/fd/ and /proc/1/fdinfo/* for the working and non-working
> case? That are the only changes visible to userspace...
>
> Thanks,
> 	Dominik
>
> diff --git a/init/main.c b/init/main.c
> index 1ecfd43ed464..8886530e9dec 100644
> --- a/init/main.c
> +++ b/init/main.c
> @@ -1162,7 +1162,7 @@ void console_on_rootfs(void)
>  	unsigned int i;
>
>  	/* Open /dev/console in kernelspace, this should never fail */
> -	file = filp_open("/dev/console", O_RDWR, 0);
> +	file = filp_open("/dev/console", force_o_largefile() ? O_LARGEFILE |
> O_RDWR : O_RDWR, 0);
>  	if (IS_ERR(file))
>  		goto err_out;
>
>

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2019-12-19  9:34 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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