Skip to contentSkip to conversation

kcmp.2: note about SECURITY_YAMA

PATCH In review Shawn Landden 2 participants 10 messages Dec 21, 2013 – Jun 9, 2016 5 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 kcmp.2: note about SECURITY_YAMA

---
 man2/kcmp.2 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
man2/kcmp.2 +6 -1
index 59dd4d1..c910ac2 100644
@@ -187,7 +187,12 @@ is invalid.
 Insufficient permission to inspect process resources.
 The
 .B CAP_SYS_PTRACE
-capability is required to inspect processes that you do not own.
+capability is required to inspect processes that you do not own. Other
+limitations on ptrace apply, such as
+.BR CONFIG_SECURITY_YAMA ,
+which when /proc/sys/kernel/yama/ptrace_scope is 2 (the default) limits
+.BR kcmp()
+to child processes.
 .TP
 .B ESRCH
 Process
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1387586263-9002-1-git-send-email-shawn-01I/[email protected]

#2 lore raw

PATCH 2/5 cmsg: be not --> not be

---
 man3/cmsg.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man3/cmsg.3 +2 -2
index 22057c0..9677233 100644
@@ -147,7 +147,7 @@ is a Linux extension.
 For portability, ancillary data should be accessed using only the macros
 described here.
 .BR CMSG_ALIGN ()
-is a Linux extension and should be not used in portable programs.
+is a Linux extension and should not be used in portable programs.
 .PP
 In Linux,
 .BR CMSG_LEN (),
@@ -157,7 +157,7 @@ and
 are constant expressions (assuming their argument is constant);
 this could be used to declare the size of global
 variables.
-This may be not portable, however.
+This may not be portable, however.
 .SH EXAMPLE
 This code looks for the
 .B IP_TTL
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1387586263-9002-2-git-send-email-shawn-01I/[email protected]

#4 lore raw

Re: [PATCH 2/5] cmsg: be not --> not be

Thanks, Shawn. Applied.

Cheers,

Michael

Quoted 28 lines · Shawn Landden
---
 man3/cmsg.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man3/cmsg.3 +2 -2
index 22057c0..9677233 100644
@@ -147,7 +147,7 @@ is a Linux extension.
 For portability, ancillary data should be accessed using only the macros
 described here.
 .BR CMSG_ALIGN ()
-is a Linux extension and should be not used in portable programs.
+is a Linux extension and should not be used in portable programs.
 .PP
 In Linux,
 .BR CMSG_LEN (),
@@ -157,7 +157,7 @@ and
 are constant expressions (assuming their argument is constant);
 this could be used to declare the size of global
 variables.
-This may be not portable, however.
+This may not be portable, however.
 .SH EXAMPLE
 This code looks for the
 .B IP_TTL
Signature · 6 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH 3/5 timerfd_create: add timerfd(2) alias

In reply to a message not in the archive
---
 man2/timerfd.2 | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 man2/timerfd.2
man2/timerfd.2 new file +2 -0
new file mode 100644
index 0000000..de0bf03
@@ -0,0 +1,2 @@
+.so man2/timerfd_create.2
+
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1387586263-9002-3-git-send-email-shawn-01I/[email protected]

#7 lore raw

Re: [PATCH 3/5] timerfd_create: add timerfd(2) alias

Shawn,

What is the rationale for this patch?

Cheers,

Michael

Quoted 15 lines · Shawn Landden
---
 man2/timerfd.2 | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 man2/timerfd.2
man2/timerfd.2 new file +2 -0
new file mode 100644
index 0000000..de0bf03
@@ -0,0 +1,2 @@
+.so man2/timerfd_create.2
+
Signature · 6 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

PATCH 4/5 printf: %m is supported by uclibc and musl, no %n in bionic

In reply to a message not in the archive
---
 man3/printf.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man3/printf.3 +2 -2
index 20a3b5d..a861126 100644
@@ -791,10 +791,10 @@ The number of characters written so far is stored into the integer
 indicated by the
 .I "int\ *"
 (or variant) pointer argument.
-No argument is converted.
+No argument is converted. (absent in bionic)
 .TP
 .B m
-(Glibc extension.)
+(Glibc extension. Supported by uClibc and musl)
 Print output of
 .IR strerror(errno) .
 No argument is required.
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1387586263-9002-4-git-send-email-shawn-01I/[email protected]

#10 lore raw

Re: [PATCH 4/5] printf: %m is supported by uclibc and musl, no %n in bionic

Quoted 12 lines · Shawn Landden
---
 man3/printf.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man3/printf.3 +0 -0
index 20a3b5d..a861126 100644
@@ -791,10 +791,10 @@ The number of characters written so far is stored into the integer
 indicated by the
 .I "int\ *"

man3/printf.3 The number of characters written so far is stored into the integer · line 800

Quoted 10 lines
man3/printf.3 +2 -2
 (or variant) pointer argument.
-No argument is converted.
+No argument is converted. (absent in bionic)
 .TP
 .B m
-(Glibc extension.)
+(Glibc extension. Supported by uClibc and musl)
 Print output of
 .IR strerror(errno) .
 No argument is required.

Hi Shawn,

I applied a slightly different patch.

Cheers,

Michael

man3/printf.3 +2 -1
@@ -817,11 +817,12 @@ That argument shall be an
 or variant whose size matches the (optionally)
 supplied integer length modifier.
 No argument is converted.
+(This specifier is not supported by the bionic C library.)
 The behavior is undefined if the conversion specification includes
 any flags, a field width, or a precision.
 .TP
 .B m
-(Glibc extension.)
+(Glibc extension; supported by uClibc and musl.)
 Print output of
 .IR strerror(errno) .
 No argument is required.
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

PATCH 5/5 FreeBSD and bionic have memmem

In reply to a message not in the archive
---
 man3/memmem.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/memmem.3 +1 -1
index 7b97d2d..667ff62 100644
@@ -57,7 +57,7 @@ The
 function returns a pointer to the beginning of the
 substring, or NULL if the substring is not found.
 .SH CONFORMING TO
-This function is a GNU extension.
+This function is a GNU extension. Present in FreeBSD 6.0 and bionic.
 .SH BUGS
 This function was broken in Linux libraries up to and including libc 5.0.9;
 there the
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1387586263-9002-5-git-send-email-shawn-01I/[email protected]

#13 lore raw

Re: [PATCH 5/5] FreeBSD and bionic have memmem

Hi Shawn,

Quoted 10 lines · Shawn Landden
---
 man3/memmem.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/memmem.3 +0 -0
index 7b97d2d..667ff62 100644

man3/memmem.3 The · line 60

Quoted 5 lines
man3/memmem.3 +1 -1
@@ -57,7 +57,7 @@ The
 function returns a pointer to the beginning of the
 substring, or NULL if the substring is not found.
 .SH CONFORMING TO
-This function is a GNU extension.
+This function is a GNU extension. Present in FreeBSD 6.0 and bionic.

It seems to pbe present on some other systems as well, so I reworded as:

This function is not specified in POSIX.1, but is present on a number of other systems.

Thanks for the report.

Cheers,

Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#14 lore raw
In reply to a message not in the archive

Shawn,

Can you supply more background on this patch.

Looking at security/yama/yama_lsm.c:

[[

#define YAMA_SCOPE_DISABLED     0
#define YAMA_SCOPE_RELATIONAL   1
#define YAMA_SCOPE_CAPABILITY   2
#define YAMA_SCOPE_NO_ATTACH    3

static int ptrace_scope = YAMA_SCOPE_RELATIONAL;
]]

This suggests that your statement that the default value is 2 is incorrect, but I may be missing something.

Cheers,

Michael

Quoted 24 lines · Shawn Landden
---
 man2/kcmp.2 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
man2/kcmp.2 +6 -1
index 59dd4d1..c910ac2 100644
@@ -187,7 +187,12 @@ is invalid.
 Insufficient permission to inspect process resources.
 The
 .B CAP_SYS_PTRACE
-capability is required to inspect processes that you do not own.
+capability is required to inspect processes that you do not own. Other
+limitations on ptrace apply, such as
+.BR CONFIG_SECURITY_YAMA ,
+which when /proc/sys/kernel/yama/ptrace_scope is 2 (the default) limits
+.BR kcmp()
+to child processes.
 .TP
 .B ESRCH
 Process
Signature · 6 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html