Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • scripts
  • gcc-plugins
  • randomize_layout_plugin.c
Find file BlameHistoryPermalink
  • Kees Cook's avatar
    af_unix: Silence randstruct GCC plugin warning · b146cbf2
    Kees Cook authored May 10, 2022
    
    
    While preparing for Clang randstruct support (which duplicated many of
    the warnings the randstruct GCC plugin warned about), one strange one
    remained only for the randstruct GCC plugin. Eliminating this rids
    the plugin of the last exception.
    
    It seems the plugin is happy to dereference individual members of
    a cross-struct cast, but it is upset about casting to a whole object
    pointer. This only manifests in one place in the kernel, so just replace
    the variable with individual member accesses. There is no change in
    executable instruction output.
    
    Drop the last exception from the randstruct GCC plugin.
    
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Paolo Abeni <pabeni@redhat.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Cong Wang <cong.wang@bytedance.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: netdev@vger.kernel.org
    Cc: linux-hardening@vger.kernel.org
    Acked-by: default avatarKuniyuki Iwashima <kuniyu@amazon.co.jp>
    Link: https://lore.kernel.org/lkml/20220511022217.58586-1-kuniyu@amazon.co.jp
    
    
    Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
    Link: https://lore.kernel.org/lkml/20220511151542.4cb3ff17@kernel.org
    
    
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    b146cbf2
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7