mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
gcc-plugins: Add structleak for more stack initialization
This plugin detects any structures that contain __user attributes and makes sure it is being fully initialized so that a specific class of information exposure is eliminated. (This plugin was originally designed to block the exposure of siginfo in CVE-2013-2141.) Ported from grsecurity/PaX. This version adds a verbose option to the plugin and the Kconfig. Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
8d4973a1c0
commit
c61f13eaa1
4 changed files with 277 additions and 1 deletions
|
@ -27,7 +27,11 @@ extern void __chk_user_ptr(const volatile void __user *);
|
|||
extern void __chk_io_ptr(const volatile void __iomem *);
|
||||
# define ACCESS_PRIVATE(p, member) (*((typeof((p)->member) __force *) &(p)->member))
|
||||
#else /* __CHECKER__ */
|
||||
# define __user
|
||||
# ifdef STRUCTLEAK_PLUGIN
|
||||
# define __user __attribute__((user))
|
||||
# else
|
||||
# define __user
|
||||
# endif
|
||||
# define __kernel
|
||||
# define __safe
|
||||
# define __force
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue