Re: [PATCH] tty/sysrq: Make local variable 'killer' in sysrq_handle_crash() global

From: Matthias Kaehlcke
Date: Tue Sep 18 2018 - 13:32:46 EST


On Tue, Sep 18, 2018 at 11:51:55AM +0200, Jiri Slaby wrote:
> On 09/18/2018, 11:17 AM, Greg Kroah-Hartman wrote:
> > My question is why we just don't call panic() here instead of trying to
> > duplicate the logic of that function here. Why is that happening?
>
> Historically (before d6580a9f1), we had crash_kexec called() from here.
> To be honest, I see no reason not to call panic() or crash_kexec() again
> if there is any issue with the former (I cannot foresee one).

It seems in the end we don't need to change anything for Clang. With
-fno-delete-null-pointer-checks the NULL pointer access is not
'optimized' away, support for this option landed recently in upstream
LLVM, and it is already set in the kernel.

Using panic() instead of roll-your-own-crash still seems a desirable
improvement though.