Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1695426
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] [v2] kasan: avoid -Wmaybe-uninitialized warning |
| Date | 2017-07-25 09:20 +0200 |
| Message-ID | <u72im-8fe-5@gated-at.bofh.it> (permalink) |
| References | <u5Nlo-1qy-15@gated-at.bofh.it> <u6JSq-4bx-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Jul 24, 2017 at 1:35 PM, Alexander Potapenko <glider@google.com> wrote:
> On Fri, Jul 21, 2017 at 11:02 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>> diff --git a/mm/kasan/report.c b/mm/kasan/report.c
>> index 04bb1d3eb9ec..28fb222ab149 100644
>> --- a/mm/kasan/report.c
>> +++ b/mm/kasan/report.c
>> @@ -111,6 +111,9 @@ static const char *get_wild_bug_type(struct kasan_access_info *info)
>> {
>> const char *bug_type = "unknown-crash";
>>
>> + /* shut up spurious -Wmaybe-uninitialized warning */
>> + info->first_bad_addr = (void *)(-1ul);
>> +
> Why don't we initialize info.first_bad_addr in kasan_report(), where
> info is allocated?
I'm just trying to shut up a particular warning here where gcc can't figure out
by itself that it is initialized. Setting an invalid address at
allocation time would
prevent gcc from warning even for any trivial bug where we use the incorrect
value in the normal code path, in case someone later wants to modify the
code further and makes a mistake.
Arnd
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] [v2] kasan: avoid -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2017-07-21 23:10 +0200
Re: [PATCH] [v2] kasan: avoid -Wmaybe-uninitialized warning Alexander Potapenko <glider@google.com> - 2017-07-24 13:40 +0200
Re: [PATCH] [v2] kasan: avoid -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2017-07-25 09:20 +0200
Re: [PATCH] [v2] kasan: avoid -Wmaybe-uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2017-07-25 17:00 +0200
csiph-web