unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h
@ 2018-04-23 15:56 Joseph Myers
  2018-04-23 16:22 ` Dmitry V. Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph Myers @ 2018-04-23 15:56 UTC (permalink / raw
  To: libc-alpha

This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
4.16 to all relevant sys/ptrace.h files.

Tested for x86_64, and with build-many-glibcs.py.

2018-04-23  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): New enum value and macro.
	* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/arm/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/s390/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/tile/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/x86/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.

diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
index 444edbb..93e373c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
@@ -132,8 +132,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
index fbcb938..bc54a1e 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
@@ -192,8 +192,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
index 1c73b9d..e00b121 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
@@ -145,8 +145,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index 8317821..9fde99c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -49,6 +49,7 @@ __BEGIN_DECLS
 # undef PTRACE_POKEDATA
 # undef PTRACE_POKETEXT
 # undef PTRACE_SECCOMP_GET_FILTER
+# undef PTRACE_SECCOMP_GET_METADATA
 # undef PTRACE_SEIZE
 # undef PTRACE_SET_DEBUGREG
 # undef PTRACE_SETEVRREGS
@@ -236,8 +237,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
index cca0248..d60a034 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
@@ -52,6 +52,7 @@ __BEGIN_DECLS
 # undef PTRACE_GETSIGMASK
 # undef PTRACE_SETSIGMASK
 # undef PTRACE_SECCOMP_GET_FILTER
+# undef PTRACE_SECCOMP_GET_METADATA
 # undef PTRACE_PEEKUSR_AREA
 # undef PTRACE_POKEUSR_AREA
 # undef PTRACE_GET_LAST_BREAK
@@ -193,6 +194,10 @@ enum __ptrace_request
   PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
 
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d,
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
+
   PTRACE_PEEKUSR_AREA = 0x5000,
 #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA
 
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
index 9193275..c037734 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
@@ -213,8 +213,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h
index 85772f3..3c71a0e 100644
--- a/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -162,8 +162,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
index a1db185..d391037 100644
--- a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
@@ -136,8 +136,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
index 6000342..6d4605b 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
@@ -182,8 +182,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h
  2018-04-23 15:56 Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h Joseph Myers
@ 2018-04-23 16:22 ` Dmitry V. Levin
  2018-04-23 17:07   ` Joseph Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry V. Levin @ 2018-04-23 16:22 UTC (permalink / raw
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

On Mon, Apr 23, 2018 at 03:56:48PM +0000, Joseph Myers wrote:
> This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
> 4.16 to all relevant sys/ptrace.h files.

Thanks, I haven't managed to submit this update myself.

This has to be committed along with the following two changes:
- adding #undef PTRACE_SECCOMP_GET_METADATA to all files that already
  undefine PTRACE_SECCOMP_GET_FILTER, for exactly the same reason;
- adding to bits/ptrace-shared.h a definition equivalent
  to struct seccomp_metadata.


-- 
ldv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h
  2018-04-23 16:22 ` Dmitry V. Levin
@ 2018-04-23 17:07   ` Joseph Myers
  2018-04-23 17:23     ` Dmitry V. Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph Myers @ 2018-04-23 17:07 UTC (permalink / raw
  To: Dmitry V. Levin; +Cc: libc-alpha

On Mon, 23 Apr 2018, Dmitry V. Levin wrote:

> On Mon, Apr 23, 2018 at 03:56:48PM +0000, Joseph Myers wrote:
> > This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
> > 4.16 to all relevant sys/ptrace.h files.
> 
> Thanks, I haven't managed to submit this update myself.
> 
> This has to be committed along with the following two changes:
> - adding #undef PTRACE_SECCOMP_GET_METADATA to all files that already
>   undefine PTRACE_SECCOMP_GET_FILTER, for exactly the same reason;

I believe this patch does that.

> - adding to bits/ptrace-shared.h a definition equivalent
>   to struct seccomp_metadata.

This may be useful, but I don't see it as necessary to add the constant.

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h
  2018-04-23 17:07   ` Joseph Myers
@ 2018-04-23 17:23     ` Dmitry V. Levin
  2018-04-23 23:23       ` Joseph Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry V. Levin @ 2018-04-23 17:23 UTC (permalink / raw
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 982 bytes --]

On Mon, Apr 23, 2018 at 05:07:25PM +0000, Joseph Myers wrote:
> On Mon, 23 Apr 2018, Dmitry V. Levin wrote:
> 
> > On Mon, Apr 23, 2018 at 03:56:48PM +0000, Joseph Myers wrote:
> > > This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
> > > 4.16 to all relevant sys/ptrace.h files.
> > 
> > Thanks, I haven't managed to submit this update myself.
> > 
> > This has to be committed along with the following two changes:
> > - adding #undef PTRACE_SECCOMP_GET_METADATA to all files that already
> >   undefine PTRACE_SECCOMP_GET_FILTER, for exactly the same reason;
> 
> I believe this patch does that.

It is not mentioned in the ChangeLog entry, so I must have missed it
in the patch itself.

> > - adding to bits/ptrace-shared.h a definition equivalent
> >   to struct seccomp_metadata.
> 
> This may be useful, but I don't see it as necessary to add the constant.

The constant is useless without the corresponding structure.


-- 
ldv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h
  2018-04-23 17:23     ` Dmitry V. Levin
@ 2018-04-23 23:23       ` Joseph Myers
  2018-04-23 23:55         ` Dmitry V. Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Joseph Myers @ 2018-04-23 23:23 UTC (permalink / raw
  To: Dmitry V. Levin; +Cc: libc-alpha

On Mon, 23 Apr 2018, Dmitry V. Levin wrote:

> On Mon, Apr 23, 2018 at 05:07:25PM +0000, Joseph Myers wrote:
> > On Mon, 23 Apr 2018, Dmitry V. Levin wrote:
> > 
> > > On Mon, Apr 23, 2018 at 03:56:48PM +0000, Joseph Myers wrote:
> > > > This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
> > > > 4.16 to all relevant sys/ptrace.h files.
> > > 
> > > Thanks, I haven't managed to submit this update myself.
> > > 
> > > This has to be committed along with the following two changes:
> > > - adding #undef PTRACE_SECCOMP_GET_METADATA to all files that already
> > >   undefine PTRACE_SECCOMP_GET_FILTER, for exactly the same reason;
> > 
> > I believe this patch does that.
> 
> It is not mentioned in the ChangeLog entry, so I must have missed it
> in the patch itself.

I think mentioning the name as a new macro and enum value is sufficient 
without going into the details of how in certain headers a new macro also 
involves a #undef.

> > > - adding to bits/ptrace-shared.h a definition equivalent
> > >   to struct seccomp_metadata.
> > 
> > This may be useful, but I don't see it as necessary to add the constant.
> 
> The constant is useless without the corresponding structure.

Which a user could provide themselves if they wish.  Anyway, this patch 
version adds such a structure, named struct __ptrace_seccomp_metadata by 
analogy to other such structures there.


Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h.

This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
4.16 to all relevant sys/ptrace.h files.  A type struct
__ptrace_seccomp_metadata, analogous to other such types, is also
added.

Tested for x86_64, and with build-many-glibcs.py.

2018-04-23  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/unix/sysv/linux/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): New enum value and macro.
	* sysdeps/unix/sysv/linux/bits/ptrace-shared.h
	(struct __ptrace_seccomp_metadata): New type.
	* sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/arm/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/s390/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/tile/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.
	* sysdeps/unix/sysv/linux/x86/sys/ptrace.h
	(PTRACE_SECCOMP_GET_METADATA): Likewise.

diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
index 444edbb..93e373c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h
@@ -132,8 +132,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
index fbcb938..bc54a1e 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/ptrace.h
@@ -192,8 +192,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h
index 960b101..03a7791 100644
--- a/sysdeps/unix/sysv/linux/bits/ptrace-shared.h
+++ b/sysdeps/unix/sysv/linux/bits/ptrace-shared.h
@@ -66,6 +66,13 @@ enum __ptrace_peeksiginfo_flags
   PTRACE_PEEKSIGINFO_SHARED = (1 << 0)
 };
 
+/* Argument and results of PTRACE_SECCOMP_GET_METADATA.  */
+struct __ptrace_seccomp_metadata
+{
+  __uint64_t filter_off;	/* Input: which filter.  */
+  __uint64_t flags;		/* Output: filter's flags.  */
+};
+
 /* Perform process tracing functions.  REQUEST is one of the values
    above, and determines the action to be taken.
    For all requests except PTRACE_TRACEME, PID specifies the process to be
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
index 1c73b9d..e00b121 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
@@ -145,8 +145,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
index 8317821..9fde99c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
@@ -49,6 +49,7 @@ __BEGIN_DECLS
 # undef PTRACE_POKEDATA
 # undef PTRACE_POKETEXT
 # undef PTRACE_SECCOMP_GET_FILTER
+# undef PTRACE_SECCOMP_GET_METADATA
 # undef PTRACE_SEIZE
 # undef PTRACE_SET_DEBUGREG
 # undef PTRACE_SETEVRREGS
@@ -236,8 +237,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
index cca0248..d60a034 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ptrace.h
@@ -52,6 +52,7 @@ __BEGIN_DECLS
 # undef PTRACE_GETSIGMASK
 # undef PTRACE_SETSIGMASK
 # undef PTRACE_SECCOMP_GET_FILTER
+# undef PTRACE_SECCOMP_GET_METADATA
 # undef PTRACE_PEEKUSR_AREA
 # undef PTRACE_POKEUSR_AREA
 # undef PTRACE_GET_LAST_BREAK
@@ -193,6 +194,10 @@ enum __ptrace_request
   PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
 
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d,
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
+
   PTRACE_PEEKUSR_AREA = 0x5000,
 #define PTRACE_PEEKUSR_AREA PTRACE_PEEKUSR_AREA
 
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
index 9193275..c037734 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ptrace.h
@@ -213,8 +213,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h
index 85772f3..3c71a0e 100644
--- a/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -162,8 +162,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
index a1db185..d391037 100644
--- a/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/tile/sys/ptrace.h
@@ -136,8 +136,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
index 6000342..6d4605b 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/ptrace.h
@@ -182,8 +182,12 @@ enum __ptrace_request
 #define PTRACE_SETSIGMASK PTRACE_SETSIGMASK
 
   /* Get seccomp BPF filters.  */
-  PTRACE_SECCOMP_GET_FILTER = 0x420c
+  PTRACE_SECCOMP_GET_FILTER = 0x420c,
 #define PTRACE_SECCOMP_GET_FILTER PTRACE_SECCOMP_GET_FILTER
+
+  /* Get seccomp BPF filter metadata.  */
+  PTRACE_SECCOMP_GET_METADATA = 0x420d
+#define PTRACE_SECCOMP_GET_METADATA PTRACE_SECCOMP_GET_METADATA
 };
 
 

-- 
Joseph S. Myers
joseph@codesourcery.com


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h
  2018-04-23 23:23       ` Joseph Myers
@ 2018-04-23 23:55         ` Dmitry V. Levin
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry V. Levin @ 2018-04-23 23:55 UTC (permalink / raw
  To: Joseph Myers; +Cc: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 2017 bytes --]

On Mon, Apr 23, 2018 at 11:23:05PM +0000, Joseph Myers wrote:
> On Mon, 23 Apr 2018, Dmitry V. Levin wrote:
> > On Mon, Apr 23, 2018 at 05:07:25PM +0000, Joseph Myers wrote:
> > > On Mon, 23 Apr 2018, Dmitry V. Levin wrote:
> > > > On Mon, Apr 23, 2018 at 03:56:48PM +0000, Joseph Myers wrote:
> > > > > This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
> > > > > 4.16 to all relevant sys/ptrace.h files.
> > > > 
> > > > Thanks, I haven't managed to submit this update myself.
> > > > 
> > > > This has to be committed along with the following two changes:
> > > > - adding #undef PTRACE_SECCOMP_GET_METADATA to all files that already
> > > >   undefine PTRACE_SECCOMP_GET_FILTER, for exactly the same reason;
> > > 
> > > I believe this patch does that.
> > 
> > It is not mentioned in the ChangeLog entry, so I must have missed it
> > in the patch itself.
> 
> I think mentioning the name as a new macro and enum value is sufficient 
> without going into the details of how in certain headers a new macro also 
> involves a #undef.
> 
> > > > - adding to bits/ptrace-shared.h a definition equivalent
> > > >   to struct seccomp_metadata.
> > > 
> > > This may be useful, but I don't see it as necessary to add the constant.
> > 
> > The constant is useless without the corresponding structure.
> 
> Which a user could provide themselves if they wish.

Given the problematic definition of the structure before the linux commit
v4.16-rc3~9^2~2^2~2, it's better to provide a proper definition.

> Anyway, this patch 
> version adds such a structure, named struct __ptrace_seccomp_metadata by 
> analogy to other such structures there.
> 
> 
> Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h.
> 
> This patch adds the PTRACE_SECCOMP_GET_METADATA constant from Linux
> 4.16 to all relevant sys/ptrace.h files.  A type struct
> __ptrace_seccomp_metadata, analogous to other such types, is also
> added.

Looks good, thanks.


-- 
ldv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-23 23:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 15:56 Add PTRACE_SECCOMP_GET_METADATA from Linux 4.16 to sys/ptrace.h Joseph Myers
2018-04-23 16:22 ` Dmitry V. Levin
2018-04-23 17:07   ` Joseph Myers
2018-04-23 17:23     ` Dmitry V. Levin
2018-04-23 23:23       ` Joseph Myers
2018-04-23 23:55         ` Dmitry V. Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).