[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0d8470c7fdbe4429af82b830d39215f3@AcuMS.aculab.com>
Date: Tue, 18 Sep 2018 11:46:30 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Matthias Kaehlcke' <mka@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Evan Green <evgreen@...omium.org>,
Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>,
Douglas Anderson <dianders@...omium.org>,
Stephen Boyd <swboyd@...omium.org>,
Manoj Gupta <manojgupta@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: RE: [PATCH] tty/sysrq: Make local variable 'killer' in
sysrq_handle_crash() global
From: Matthias Kaehlcke
> Sent: 17 September 2018 22:33
>
> sysrq_handle_crash() dereferences a NULL pointer on purpose to force
> an exception, the local variable 'killer' is assigned to NULL and
> dereferenced later. Clang detects the NULL pointer dereference at compile
> time and emits a BRK instruction (on arm64) instead of the expected NULL
> pointer exception. Change 'killer' to a global variable (and rename it
> to 'sysrq_killer' to avoid possible clashes) to prevent Clang from
> detecting the condition. By default global variables are initialized
> with zero/NULL in C, therefore an explicit initialization is not needed.
You need an explicit initialiser in order to make it global data
rather than a common section.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists