Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296403

Re: [PATCH] mm, oom: initiallize all new zap_details fields before use

From Sasha Levin <sasha.levin@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm, oom: initiallize all new zap_details fields before use
Date 2015-12-22 02:00 +0100
Message-ID <qIjt0-5iB-13@gated-at.bofh.it> (permalink)
References <qHec1-4Q0-1@gated-at.bofh.it> <qHvPz-7sY-11@gated-at.bofh.it> <qHxRn-ux-1@gated-at.bofh.it> <qIh7P-3UO-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/21/2015 05:24 PM, Andrew Morton wrote:
>>> Should we use c99 initializer instead to make it future-proof?
>> > 
>> > I didn't do that to make these sort of failures obvious. In this case, if we would have
>> > used an initializer and it would default to the "wrong" values it would be much harder
>> > to find this bug.
>> > 
> If we're to make that approach useful and debuggable we should poison
> the structure at the outset with some well-known and crazy pattern.  Or
> use kasan.

We sort of do. Consider stack garbage as "poison"...

This bug was found using UBSan which complained that a bool suddenly had the
value of '64'.

If we go back to the scenario I've described, and the struct would have been
initialized on declaration, you'd have a much harder time finding it rather
than letting our existing and future tools find it.


Thanks,
Sasha
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm, oom: initiallize all new zap_details fields before use Sasha Levin <sasha.levin@oracle.com> - 2015-12-19 02:10 +0100
  Re: [PATCH] mm, oom: initiallize all new zap_details fields before  use "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-12-19 21:00 +0100
    Re: [PATCH] mm, oom: initiallize all new zap_details fields before  use Sasha Levin <sasha.levin@oracle.com> - 2015-12-19 23:10 +0100
      Re: [PATCH] mm, oom: initiallize all new zap_details fields before  use Andrew Morton <akpm@linux-foundation.org> - 2015-12-21 23:30 +0100
        Re: [PATCH] mm, oom: initiallize all new zap_details fields before  use Sasha Levin <sasha.levin@oracle.com> - 2015-12-22 02:00 +0100
  Re: [PATCH] mm, oom: initiallize all new zap_details fields before  use Michal Hocko <mhocko@kernel.org> - 2015-12-21 09:40 +0100

csiph-web