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


Groups > linux.kernel > #1652019

Re: [kernel-hardening] Re: [PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads cast

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [kernel-hardening] Re: [PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads cast
Date 2017-05-28 02:50 +0200
Message-ID <tLUz7-2X7-5@gated-at.bofh.it> (permalink)
References <tLyyB-4R7-3@gated-at.bofh.it> <tLyyC-4R7-29@gated-at.bofh.it> <tLFA6-QN-27@gated-at.bofh.it> <tLQlP-lh-5@gated-at.bofh.it> <tLS4i-1vx-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, May 27, 2017 at 3:04 PM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> Kees Cook wrote:
>> On Sat, May 27, 2017 at 1:41 AM, Christoph Hellwig <hch@infradead.org> wrote:
>> > On Fri, May 26, 2017 at 01:17:09PM -0700, Kees Cook wrote:
>> >> The LSM initialization routines walk security_hook_heads as an array
>> >> of struct list_head instead of via names to avoid a ton of needless
>> >> source. Whitelist this to avoid the false positive warning from the
>> >> plugin:
>> >
>> > I think this crap just needs to be fixed properly.  If not it almost
>> > defeats the protections as the "security" ops are just about everywhere.
>>
>> There's nothing unsafe about 3dfc9b02864b19f4dab376f14479ee4ad1de6c9e,
>> it just avoids tons of needless code. Tetsuo has some other ideas for
>> cleaning it up further, but I don't like it because it removes
>> compile-time verification of function types.
>
> Excuse me, but why you think that compile-time verification of function
> types is removed?
>
> -       { .head = &security_hook_heads.HEAD, .hook = { .HEAD = HOOK } }
> +       { .idx = LSM_##HEAD, .hook = { .HEAD = HOOK } }
>
> This change removes dependency on absolute address of security_hook_heads
> being known at compile-time. If function types of .hook.HEAD and HOOK
> mismatches, the compiler can still warn it.

Sorry, misremembered, that was the other patch. I'll go review this
current one...

-Kees

-- 
Kees Cook
Pixel Security

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


Thread

[PATCH v2 00/20] Introduce struct layout randomization plugin Kees Cook <keescook@chromium.org> - 2017-05-27 03:20 +0200
  [PATCH v2 06/20] randstruct: Whitelist UNIXCB cast Kees Cook <keescook@chromium.org> - 2017-05-27 03:20 +0200
    Re: [PATCH v2 06/20] randstruct: Whitelist UNIXCB cast Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
    Re: [PATCH v2 06/20] randstruct: Whitelist UNIXCB cast Christoph Hellwig <hch@infradead.org> - 2017-05-28 10:00 +0200
  [PATCH v2 13/20] drm/amdgpu: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-05-27 03:20 +0200
  [PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads cast Kees Cook <keescook@chromium.org> - 2017-05-27 03:20 +0200
    Re: [PATCH v2 05/20] randstruct: Whitelist struct  security_hook_heads cast Christoph Hellwig <hch@infradead.org> - 2017-05-27 10:50 +0200
      Re: [PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads cast Kees Cook <keescook@chromium.org> - 2017-05-27 22:20 +0200
        Re: [PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads cast Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-05-28 00:10 +0200
          Re: [kernel-hardening] Re: [PATCH v2 05/20] randstruct: Whitelist  struct security_hook_heads cast Kees Cook <keescook@chromium.org> - 2017-05-28 02:50 +0200
        Re: [PATCH v2 05/20] randstruct: Whitelist struct security_hook_heads  cast James Morris <jmorris@namei.org> - 2017-05-30 12:40 +0200
  [PATCH v2 02/20] gcc-plugins: Detail c-common.h location for GCC 4.6 Kees Cook <keescook@chromium.org> - 2017-05-27 03:20 +0200
  [PATCH v2 11/20] randstruct: Disable randomization of ACPICA structs Kees Cook <keescook@chromium.org> - 2017-05-27 03:20 +0200
    Re: [PATCH v2 11/20] randstruct: Disable randomization of ACPICA  structs Christoph Hellwig <hch@infradead.org> - 2017-05-27 10:50 +0200
      Re: [PATCH v2 11/20] randstruct: Disable randomization of ACPICA structs Kees Cook <keescook@chromium.org> - 2017-05-27 22:10 +0200
        Re: [PATCH v2 11/20] randstruct: Disable randomization of ACPICA  structs Christoph Hellwig <hch@infradead.org> - 2017-05-28 07:00 +0200
  Re: [PATCH v2 19/20] [RFC] task_struct: Allow randomized layout Kees Cook <keescook@chromium.org> - 2017-05-27 03:30 +0200
  Re: [PATCH v2 19/20] [RFC] task_struct: Allow randomized layout Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-27 03:30 +0200
  [PATCH v2 15/20] mtk-vcodec: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
  [PATCH v2 14/20] drm/amd/powerplay: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
    Re: [PATCH v2 14/20] drm/amd/powerplay: Use designated initializers Christoph Hellwig <hch@infradead.org> - 2017-05-27 10:50 +0200
      Re: [PATCH v2 14/20] drm/amd/powerplay: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-05-27 22:20 +0200
  [PATCH v2 20/20] ACPICA: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
    Re: [PATCH v2 20/20] ACPICA: Use designated initializers Christoph Hellwig <hch@infradead.org> - 2017-05-28 09:50 +0200
  [PATCH v2 18/20] randstruct: Enable function pointer struct detection Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
  [PATCH v2 16/20] ntfs: Use ERR_CAST() to avoid cross-structure cast Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
  [PATCH v2 17/20] ocfs2: Use ERR_CAST() to avoid cross-structure cast Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
  [PATCH v2 19/20] [RFC] task_struct: Allow randomized layout Kees Cook <keescook@chromium.org> - 2017-05-27 03:50 +0200
  [PATCH v2 10/20] randstruct: opt-out externally exposed function pointer structs Kees Cook <keescook@chromium.org> - 2017-05-27 04:00 +0200
  [PATCH v2 12/20] sgi-xp: Use designated initializers Kees Cook <keescook@chromium.org> - 2017-05-27 04:00 +0200
    Re: [PATCH v2 12/20] sgi-xp: Use designated initializers Christoph Hellwig <hch@infradead.org> - 2017-05-27 10:50 +0200
  [PATCH v2 01/20] NFS: Avoid cross-structure casting Kees Cook <keescook@chromium.org> - 2017-05-27 04:00 +0200
    Re: [PATCH v2 01/20] NFS: Avoid cross-structure casting Christoph Hellwig <hch@infradead.org> - 2017-05-28 10:00 +0200
      Re: [PATCH v2 01/20] NFS: Avoid cross-structure casting Kees Cook <keescook@chromium.org> - 2017-05-28 19:00 +0200
  [PATCH v2 03/20] compiler: Add __designated_init annotation Kees Cook <keescook@chromium.org> - 2017-05-27 04:00 +0200
  [PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading Kees Cook <keescook@chromium.org> - 2017-05-27 04:00 +0200
    Re: [PATCH v2 08/20] randstruct: Whitelist NIU struct page  overloading Christoph Hellwig <hch@infradead.org> - 2017-05-28 10:20 +0200
      Re: [PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading Kees Cook <keescook@chromium.org> - 2017-05-28 19:40 +0200
      Re: [PATCH v2 08/20] randstruct: Whitelist NIU struct page overloading Kees Cook <keescook@chromium.org> - 2017-05-28 19:40 +0200

csiph-web