On Mon, Jan 27, 2020 at 09:48:58AM +0100, Helge Deller wrote: > On 25.01.20 11:25, Andy Shevchenko wrote: > > On Fri, Jan 24, 2020 at 09:59:48AM -0800, James Bottomley wrote: ... > > By the way, consider this code from register_console() > > > > for_each_console(bcon) > > if (bcon->flags & CON_BOOT) > > unregister_console(bcon); > > > > It works based on assumption that next pointer of the just unregistered console > > is not damaged. So, My initial patch will work in the same way. > > Yeah, but that's a typical use-after-free issue, which I wouldn't count on. I think here is misinterpretation, i.e. unregister != free. Entire console code is written in the assumption that console is not being freed when unregistered. +Cc: PRINTK people. > Isn't there a way to make both safe? -- With Best Regards, Andy Shevchenko