Re: [PATCH 18/23] init: open code setting up stdin/stdout/stderr

From
hpa@zytor.com
Date
2020-07-27 06:21:01
Also in
linux-fsdevel, lkml
Reply to
Al Viro, 2020-07-27
On July 26, 2020 8:05:34 PM PDT, Al Viro [off-list ref] wrote:
On Tue, Jul 14, 2020 at 09:04:22PM +0200, Christoph Hellwig wrote:
quoted
Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work,
but
quoted
instead open a struct file for /dev/console and then install it as FD
0/1/2 manually.
I really hate that one.  Every time we exposed the internal details to
the fucking early init code, we paid for that afterwards.  And this
goes over the top wrt the level of details being exposed.

_IF_ you want to keep that thing, move it to fs/file.c, with dire
comment
re that being very special shite for init and likely cause of
subsequent
trouble whenever anything gets changed, a gnat farts somewhere, etc.

Do not leave that kind of crap sitting around init/*.c; KERNEL_DS
may be a source of occasional PITA, but here you are trading it for a
lot
worse one in the future.
Okay... here is a perhaps idiotic idea... even if we don't want to run stuff in actual user space, could we map initramfs into user space memory before running init (execing init will tear down those mappings anyway) so that we don't need KERNEL_DS at least?
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Thread (52 messages) 52 messages, 8 authors, last reply 2024-09-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help