Skip to contentSkip to conversation

Fix security.h compilation with !CONFIG_SECURITY

PATCH In review Andi Kleen 3 participants 3 messages Aug 18, 2008 Security (LSM)

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 Fix security.h compilation with !CONFIG_SECURITY

From: Andi Kleen <[email protected]>

This recent patch

commit 5cd9c58fbe9ec92b45b27e131719af4f2bd9eb40

Author: David Howells <[email protected]>
Date:   Thu Aug 14 11:37:28 2008 +0100

security: Fix setting of PF_SUPERPRIV by __capable()

broke compilation with !CONFIG_SECURITY:

linux/include/linux/security.h: In function 'security_ptrace_traceme':
linux/include/linux/security.h:1760: error: 'parent' undeclared (first use in this function)

Add the obvious fix.

Cc David Howells <[email protected]>
---
 include/linux/security.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/security.h +1 -1
index 2ee5ecf..0cc23a1 100644
@@ -1757,7 +1757,7 @@ static inline int security_ptrace_may_access(struct task_struct *child,
 
 static inline int security_ptrace_traceme(struct task_struct *child)
 {
-	return cap_ptrace_traceme(parent);
+	return cap_ptrace_traceme(child);
 }
 
 static inline int security_capget(struct task_struct *target,
Signature · 1 line
1.5.6
#1 lore raw
Quoted 28 lines · Andi Kleen

From: Andi Kleen <[email protected]>

This recent patch

commit 5cd9c58fbe9ec92b45b27e131719af4f2bd9eb40

Author: David Howells <[email protected]>
Date:   Thu Aug 14 11:37:28 2008 +0100

security: Fix setting of PF_SUPERPRIV by __capable()

broke compilation with !CONFIG_SECURITY:

linux/include/linux/security.h: In function 'security_ptrace_traceme':
linux/include/linux/security.h:1760: error: 'parent' undeclared (first use in this function)

Add the obvious fix.

Cc David Howells <[email protected]>
---
 include/linux/security.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/security.h +0 -0
index 2ee5ecf..0cc23a1 100644

include/linux/security.h static inline int security_ptrace_may_access(struct task_struct *child,

Quoted 9 lines
include/linux/security.h +1 -2
@@ -1757,7 +1757,7 @@ static inline int security_ptrace_may_access(struct task_struct *child,
 
 static inline int security_ptrace_traceme(struct task_struct *child)
 {
-       return cap_ptrace_traceme(parent);
+       return cap_ptrace_traceme(child);
 }
 
 static inline int security_capget(struct task_struct *target,
--

Oops. I just submitted a similar patch. But I think yours is wrong.

The argument name should be "parent", as in the definition that is provided when CONFIG_SECURITY=y.

    int security_ptrace_traceme(struct task_struct *parent);

I'm sorry for the double submit.

Vegard

Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036