Re: [PATCH v11 10/12] ptrace,seccomp: Add PTRACE_SECCOMP support |
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH v11 10/12] ptrace,seccomp: Add PTRACE_SECCOMP support
- From: Will Drewry <wad@xxxxxxxxxxxx>
- Date: Mon, 27 Feb 2012 13:47:17 -0600
- Authentication-results: mr.google.com; spf=pass (google.com: domain of wad@xxxxxxxxxxxx designates 10.112.25.8 as permitted sender) smtp.mail=wad@xxxxxxxxxxxx; dkim=pass header.i=wad@xxxxxxxxxxxx
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx, kernel-hardening@xxxxxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, arnd@xxxxxxxx, davem@xxxxxxxxxxxxx, hpa@xxxxxxxxx, mingo@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, rdunlap@xxxxxxxxxxxx, mcgrathr@xxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, luto@xxxxxxx, eparis@xxxxxxxxxx, serge.hallyn@xxxxxxxxxxxxx, djm@xxxxxxxxxxx, scarybeasts@xxxxxxxxx, indan@xxxxxx, pmoore@xxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, corbet@xxxxxxx, eric.dumazet@xxxxxxxxx, markus@xxxxxxxxxxxx, coreyb@xxxxxxxxxxxxxxxxxx, keescook@xxxxxxxxxxxx, Denys Vlasenko <dvlasenk@xxxxxxxxxx>
- In-reply-to: <20120227175407.GD10608@redhat.com>
On Mon, Feb 27, 2012 at 11:54 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> On 02/24, Will Drewry wrote:
>>
>> arch/Kconfig | 1 +
>> include/linux/ptrace.h | 7 +++++--
>> include/linux/seccomp.h | 4 +++-
>> include/linux/tracehook.h | 6 ++++++
>> kernel/ptrace.c | 4 ++++
>> kernel/seccomp.c | 18 ++++++++++++++++++
>
> FYI, this conflicts with the changes -mm tree.
>
> The changes in ptrace.* confict with Denys's
> "ptrace: simplify PTRACE_foo constants and PTRACE_SETOPTIONS code"
>
> The change in tracehook.h conflicts with
> "ptrace: the killed tracee should not enter the syscall"
What's the best way to reconcile this in this day and age? I don't see
these in kernel-next yet and I can't tell if there is a public -mm
anywhere anymore. I can use the patches from the mailing list with
Denys's changes if that'd be good enough. His cleanup will make this
code even smaller!
>> --- a/kernel/seccomp.c
>> +++ b/kernel/seccomp.c
>> @@ -354,6 +354,24 @@ int __secure_computing_int(int this_syscall)
>> seccomp_send_sigsys(this_syscall, reason_code);
>> return -1;
>> }
>> + case SECCOMP_RET_TRACE: {
>> + int ret;
>> + struct pt_regs *regs = task_pt_regs(current);
>> + if (!(test_tsk_thread_flag(current, TIF_SYSCALL_TRACE)) ||
>> + !(current->ptrace & PT_TRACE_SECCOMP))
>> + return -1;
>> + /*
>> + * PT_TRACE_SECCOMP and seccomp.trace indicate whether
>> + * tracehook_report_syscall_entry needs to signal the
>> + * tracer. This avoids race conditions in hand off and
>> + * the requirement for TIF_SYSCALL_TRACE ensures that
>> + * we are in the syscall slow path.
>> + */
>> + current->seccomp.trace = 1;
>> + ret = tracehook_report_syscall_entry(regs);
>> + current->seccomp.trace = 0;
>> + return ret;
>
> To be honest, this interface looks a bit strange to me...
>
> Once again, sorry if this was already discussed. But perhaps it would
> be better to introduce PTRACE_EVENT_SECCOMP/PTRACE_O_SECCOMP instead?
>
> SECCOMP_RET_TRACE: could simply do ptrace_event(PTRACE_EVENT_SECCOMP)
> unconditionaly. The tracer can set the option and do PTRACE_CONT if it
> doesn't want the system call notifications.
Works for me - this also gets rid of the extra int for brief state
tracking. I'll switch over to that in the next rev. (More follow-ups
to your reviews incoming too :).
Thanks!
will
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Kernel Discussion]
[Ethernet Bridging]
[Linux Wireless Networking]
[Linux Bluetooth Networking]
[Linux Networking Users]
[VLAN]
[Git]
[IETF Annouce]
[Linux Assembly]
[Security]
[Bugtraq]
[Photo]
[Singles Social Networking]
[Yosemite Information]
[MIPS Linux]
[ARM Linux Kernel]
[ARM Linux]
[Linux Virtualization]
[Linux Security]
[Linux IDE]
[Linux RAID]
[Linux SCSI]
[Free Dating]