浏览代码

sched, task_struct: stack_canary is not needed without CC_STACKPROTECTOR

The field stack_canary is only used with CC_STACKPROTECTOR.
This patch reduces task_struct size without CC_STACKPROTECTOR.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
LKML-Reference: <4A8A44CA.2020701@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Hiroshi Shimamoto 16 年之前
父节点
当前提交
1314562a9a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      include/linux/sched.h

+ 2 - 0
include/linux/sched.h

@@ -1237,8 +1237,10 @@ struct task_struct {
 	pid_t pid;
 	pid_t pid;
 	pid_t tgid;
 	pid_t tgid;
 
 
+#ifdef CONFIG_CC_STACKPROTECTOR
 	/* Canary value for the -fstack-protector gcc feature */
 	/* Canary value for the -fstack-protector gcc feature */
 	unsigned long stack_canary;
 	unsigned long stack_canary;
+#endif
 
 
 	/* 
 	/* 
 	 * pointers to (original) parent process, youngest child, younger sibling,
 	 * pointers to (original) parent process, youngest child, younger sibling,