Skip to content

Commit ee00560

Browse files
Denys Vlasenkotorvalds
authored andcommitted
ptrace: remove PTRACE_SEIZE_DEVEL bit
PTRACE_SEIZE code is tested and ready for production use, remove the code which requires special bit in data argument to make PTRACE_SEIZE work. Strace team prepares for a new release of strace, and we would like to ship the code which uses PTRACE_SEIZE, preferably after this change goes into released kernel. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Pedro Alves <palves@redhat.com> Cc: Jan Kratochvil <jan.kratochvil@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5cdf389 commit ee00560

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed

include/linux/ptrace.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
#define PTRACE_INTERRUPT 0x4207
5252
#define PTRACE_LISTEN 0x4208
5353

54-
/* flags in @data for PTRACE_SEIZE */
55-
#define PTRACE_SEIZE_DEVEL 0x80000000 /* temp flag for development */
56-
5754
/* Wait extended result codes for the above trace options. */
5855
#define PTRACE_EVENT_FORK 1
5956
#define PTRACE_EVENT_VFORK 2
@@ -64,7 +61,7 @@
6461
/* Extended result codes which enabled by means other than options. */
6562
#define PTRACE_EVENT_STOP 128
6663

67-
/* options set using PTRACE_SETOPTIONS */
64+
/* Options set using PTRACE_SETOPTIONS or using PTRACE_SEIZE @data param */
6865
#define PTRACE_O_TRACESYSGOOD 1
6966
#define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK)
7067
#define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK)

kernel/ptrace.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -237,25 +237,10 @@ static int ptrace_attach(struct task_struct *task, long request,
237237
bool seize = (request == PTRACE_SEIZE);
238238
int retval;
239239

240-
/*
241-
* SEIZE will enable new ptrace behaviors which will be implemented
242-
* gradually. SEIZE_DEVEL bit is used to prevent applications
243-
* expecting full SEIZE behaviors trapping on kernel commits which
244-
* are still in the process of implementing them.
245-
*
246-
* Only test programs for new ptrace behaviors being implemented
247-
* should set SEIZE_DEVEL. If unset, SEIZE will fail with -EIO.
248-
*
249-
* Once SEIZE behaviors are completely implemented, this flag
250-
* will be removed.
251-
*/
252240
retval = -EIO;
253241
if (seize) {
254242
if (addr != 0)
255243
goto out;
256-
if (!(flags & PTRACE_SEIZE_DEVEL))
257-
goto out;
258-
flags &= ~(unsigned long)PTRACE_SEIZE_DEVEL;
259244
if (flags & ~(unsigned long)PTRACE_O_MASK)
260245
goto out;
261246
flags = PT_PTRACED | PT_SEIZED | (flags << PT_OPT_FLAG_SHIFT);

0 commit comments

Comments
 (0)