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


Groups > linux.kernel > #1464232

Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption
Date 2016-08-17 01:20 +0200
Message-ID <s6VOh-161-5@gated-at.bofh.it> (permalink)
References (1 earlier) <s6TW9-8jL-9@gated-at.bofh.it> <s6U5Q-8nJ-19@gated-at.bofh.it> <s6Upb-8vn-1@gated-at.bofh.it> <s6UyR-8k-5@gated-at.bofh.it> <s6UyR-8k-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 16, 2016 at 2:57 PM, Steven Rostedt <rostedt@goodmis.org> wrote:
> On Tue, 16 Aug 2016 17:53:54 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
>
>>              WARN(1, "list_del corruption. next->prev should be %p, but was %p\n",
>>                      entry, next->prev);
>>              BUG_ON(CORRUPTED_DATA_STRUCTURE);
>>
>> Will always warn (as stated by "1") and and the BUG_ON() will bug if
>> CORRUPTED_DATA_STRUCTURE is set. Although, I don't like that name. Can
>> we have a:
>>
>>  BUG_ON(BUG_ON_CORRUPTED_DATA_STRUCTURES);
>>
>> Or maybe have that as a macro:
>>
>> #ifdef CONFIG_BUG_ON_CORRUPTION
>> # define BUG_ON_CORRUPTED_DATA_STRUCTURE() BUG_ON(1)
>> #else
>> # define BUG_ON_CORRUPTED_DATA_STRUCTURE() do {} while (0)
>> #endif
>>
>> Then we can have:
>>
>>              WARN(1, "list_del corruption. next->prev should be %p, but was %p\n",
>>                      entry, next->prev);
>>              BUG_ON_CORRUPTED_DATA_STRUCTURE();
>>
>> ??
>>
>
> Hmm, maybe better yet, just have it called "CORRUPTED_DATA_STRUCTURE()"
> because it wont bug if the config is not set, and having "BUG_ON" in
> the name, it might be somewhat confusing.

Yeah, I'm trying to redesign this now, since one thing I think is
important to build into the new macro is the concept of _stopping_
execution. i.e. even if you don't want to BUG, you really don't want
to operate on the busted data structure. This protection was precisely
what went missing with commit 924d9addb9b1.

-Kees

-- 
Kees Cook
Nexus Security

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


Thread

[PATCH 4/5] bug: Provide toggle for BUG on data corruption Kees Cook <keescook@chromium.org> - 2016-08-16 23:20 +0200
  Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-16 23:30 +0200
    Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Kees Cook <keescook@chromium.org> - 2016-08-16 23:50 +0200
      Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Steven Rostedt <rostedt@goodmis.org> - 2016-08-17 00:00 +0200
        Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Kees Cook <keescook@chromium.org> - 2016-08-17 01:20 +0200
      Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Steven Rostedt <rostedt@goodmis.org> - 2016-08-17 00:00 +0200
      Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-17 02:10 +0200
        Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Kees Cook <keescook@chromium.org> - 2016-08-17 02:20 +0200
          Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-17 18:20 +0200
            Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Kees Cook <keescook@chromium.org> - 2016-08-17 18:20 +0200
              Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-17 18:40 +0200
  Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Laura Abbott <labbott@redhat.com> - 2016-08-17 00:00 +0200
    Re: [PATCH 4/5] bug: Provide toggle for BUG on data corruption Kees Cook <keescook@chromium.org> - 2016-08-17 01:20 +0200

csiph-web