Re: [PATCH 4.10 070/111] audit: fix auditd/kernel connection state tracking

2018-02-21 Thread Peter Zijlstra
On Wed, Feb 21, 2018 at 09:46:02AM +0100, Ingo Molnar wrote: > AFAICS the primary problem appears to be this code path: > > audit_receive() -> audit_receive_msg() -> AUDIT_TTY_SET -> > audit_log_common_recv_msg() -> audit_log_start() > > where we can arrive already holding the lock. > > I.e.

Re: [PATCH 4.10 070/111] audit: fix auditd/kernel connection state tracking

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 09:51:08AM -0500, Paul Moore wrote: > On Tue, Feb 20, 2018 at 9:06 AM, Peter Zijlstra <pet...@infradead.org> wrote: > > It's not at all clear to me what that code does, I just stumbled upon > > __mutex_owner() outside of the mutex code itself and

Re: [PATCH 4.10 070/111] audit: fix auditd/kernel connection state tracking

2018-02-20 Thread Peter Zijlstra
On Tue, Feb 20, 2018 at 08:25:21AM -0500, Paul Moore wrote: > On Tue, Feb 20, 2018 at 7:37 AM, Peter Zijlstra <pet...@infradead.org> wrote: > > On Tue, Mar 28, 2017 at 02:30:56PM +0200, Greg Kroah-Hartman wrote: > >> 4.10-stable review patch. If anyone has any objections,

Re: [PATCH 13/15] kernel: convert numa_group.refcount from atomic_t to refcount_t

2017-07-07 Thread Peter Zijlstra
On Fri, Jul 07, 2017 at 12:04:27PM +0300, Elena Reshetova wrote: > refcount_t type and corresponding API should be > used instead of atomic_t when the variable is used as > a reference counter. This allows to avoid accidental > refcounter overflows that might lead to use-after-free > situations. >

Re: [PATCH 14/15] kernel: convert futex_pi_state.refcount from atomic_t to refcount_t

2017-07-07 Thread Peter Zijlstra
On Fri, Jul 07, 2017 at 12:04:28PM +0300, Elena Reshetova wrote: > refcount_t type and corresponding API should be > used instead of atomic_t when the variable is used as > a reference counter. This allows to avoid accidental > refcounter overflows that might lead to use-after-free > situations. >

Re: [PATCH 06/15] kernel: convert perf_event_context.refcount from atomic_t to refcount_t

2017-07-07 Thread Peter Zijlstra
On Fri, Jul 07, 2017 at 12:04:20PM +0300, Elena Reshetova wrote: > refcount_t type and corresponding API should be > used instead of atomic_t when the variable is used as > a reference counter. This allows to avoid accidental > refcounter overflows that might lead to use-after-free > situations. >

Re: [PATCH 14/15] kernel: convert futex_pi_state.refcount from atomic_t to refcount_t

2017-07-07 Thread Peter Zijlstra
nix.de> M: Ingo Molnar <mi...@redhat.com> R: Peter Zijlstra <pet...@infradead.org> R: Darren Hart <dvh...@infradead.org> L: linux-ker...@vger.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core S: Maint

Re: [PATCH 06/19] kernel: convert perf_event_context.refcount from atomic_t to refcount_t

2017-02-20 Thread Peter Zijlstra
On Mon, Feb 20, 2017 at 12:18:55PM +0200, Elena Reshetova wrote: > +++ b/kernel/events/core.c > @@ -1108,7 +1108,7 @@ static void perf_event_ctx_deactivate(struct > perf_event_context *ctx) > > static void get_ctx(struct perf_event_context *ctx) > { > -

Re: [PATCH V6 07/10] sched: add a macro to ref all CLONE_NEW* flags

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 03:35:54AM -0400, Richard Guy Briggs wrote: Added the macro CLONE_NEW_MASK_ALL to refer to all CLONE_NEW* flags. A wee bit about why might be nice.. -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit

Re: [PATCH V6 07/10] sched: add a macro to ref all CLONE_NEW* flags

2015-04-17 Thread Peter Zijlstra
On Fri, Apr 17, 2015 at 11:42:50AM -0400, Richard Guy Briggs wrote: On 15/04/17, Peter Zijlstra wrote: On Fri, Apr 17, 2015 at 03:35:54AM -0400, Richard Guy Briggs wrote: Added the macro CLONE_NEW_MASK_ALL to refer to all CLONE_NEW* flags. A wee bit about why might be nice.. It makes

Re: [PATCH 0/7][RFC] pid: changes to support audit

2014-01-24 Thread Peter Zijlstra
On Fri, Jan 24, 2014 at 01:14:47AM -0500, Richard Guy Briggs wrote: On 14/01/23, Peter Zijlstra wrote: On Thu, Jan 23, 2014 at 02:32:33PM -0500, Richard Guy Briggs wrote: These are a number of patches inspired by ebiederman's container work that were included by me 2013-08-20

Re: [PATCH 0/7][RFC] pid: changes to support audit

2014-01-23 Thread Peter Zijlstra
/lkml/2013/12/16/552 I would have ordered them slightly different, but: Acked-by: Peter Zijlstra pet...@infradead.org -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-23 Thread Peter Zijlstra
On Fri, Dec 20, 2013 at 08:01:57PM +0100, Oleg Nesterov wrote: The only problem is that #define ASSIGN_CONST(l, r) (*(typeof(r) *)(l) = (r)) obviously can't work in this case ;) We need something more clever. Hmm indeed, C++ has both the const_cast() thingy and the template

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task-pid and task-tgid

2013-12-17 Thread Peter Zijlstra
On Mon, Dec 16, 2013 at 05:20:51PM -0500, Richard Guy Briggs wrote: static inline bool is_idle_task(const struct task_struct *p) { -return p-pid == 0; +return task_pid(p) == init_struct_pid; } I'll stick with task_pid_nr(p) == 0. We're going to probably switch to:

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task-pid and task-tgid

2013-12-17 Thread Peter Zijlstra
On Tue, Dec 17, 2013 at 10:34:42AM +0100, Peter Zijlstra wrote: On Mon, Dec 16, 2013 at 05:20:51PM -0500, Richard Guy Briggs wrote: static inline bool is_idle_task(const struct task_struct *p) { - return p-pid == 0; + return task_pid(p) == init_struct_pid; } I'll stick

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-17 Thread Peter Zijlstra
On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: Cc: linux-audit@redhat.com, linux-ker...@vger.kernel.org Could you not cross-post to a moderated list please? I keep getting endless bounces. -- Linux-audit mailing list Linux-audit@redhat.com

Re: [PATCH] pid: change task_struct::pid to read-only

2013-12-17 Thread Peter Zijlstra
On Mon, Dec 16, 2013 at 04:03:38PM -0500, Richard Guy Briggs wrote: task-pid is only ever assigned once (well ok, twice). For system health and secure logging confidence, make it const to make it much more intentional when it is being changed. --- Peter, as you had suggested, does this

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task-pid and task-tgid

2013-08-27 Thread Peter Zijlstra
On Mon, Aug 26, 2013 at 10:37:22PM -0400, Richard Guy Briggs wrote: On Fri, Aug 23, 2013 at 08:36:21AM +0200, Peter Zijlstra wrote: Except that's not the case, with namespaces there's a clear hierarchy and the task_struct::pid is the one true value aka. root namespace. Peter, I agonized

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task-pid and task-tgid

2013-08-23 Thread Peter Zijlstra
On Thu, Aug 22, 2013 at 05:43:47PM -0400, Richard Guy Briggs wrote: On Thu, Aug 22, 2013 at 10:05:55PM +0200, Peter Zijlstra wrote: On Tue, Aug 20, 2013 at 05:32:03PM -0400, Richard Guy Briggs wrote: This stops these four task helper functions from using the deprecated and error-prone

Re: [PATCH 11/12] pid: rewrite task helper functions avoiding task-pid and task-tgid

2013-08-22 Thread Peter Zijlstra
On Tue, Aug 20, 2013 at 05:32:03PM -0400, Richard Guy Briggs wrote: This stops these four task helper functions from using the deprecated and error-prone task-pid and task-tgid. (informed by ebiederman's ea5a4d01) Cc: Eric W. Biederman ebied...@xmission.com Signed-off-by: Richard Guy Briggs

Re: [PATCH 2/2] Audit: remove the limit on execve arguments when audit is running

2007-10-03 Thread Peter Zijlstra
a requirement. Signed-off-by: Eric Paris [EMAIL PROTECTED] Acked-by: Peter Zijlstra [EMAIL PROTECTED] --- kernel/auditsc.c | 10 -- kernel/sysctl.c | 11 --- 2 files changed, 0 insertions(+), 21 deletions(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index f9f61db

Re: [patch 058/209] audit: rework execve audit

2007-07-27 Thread Peter Zijlstra
] syscall_trace_leave+0x2c/0x87 [8100beb1] int_very_careful+0x3a/0x43 From: Peter Zijlstra [EMAIL PROTECTED] diff -puN kernel/auditsc.c~audit-rework-execve-audit kernel/auditsc.c --- a/kernel/auditsc.c~audit-rework-execve-audit +++ a/kernel/auditsc.c @@ -831,6 +831,55 @@ static

Re: [patch 058/209] audit: rework execve audit

2007-07-27 Thread Peter Zijlstra
On Fri, 2007-07-27 at 16:57 -0400, Steve Grubb wrote: I don't know of anything special its a fully updated rawhide machine. I am not running any tests, this is at the prompt in runlevel 3. I have audit=1 as a boot parameter in grub.conf and very simple audit rules for that machine: -D

Re: [patch 058/209] audit: rework execve audit

2007-07-27 Thread Peter Zijlstra
On Fri, 2007-07-27 at 23:55 +0200, Peter Zijlstra wrote: On Fri, 2007-07-27 at 16:57 -0400, Steve Grubb wrote: I don't know of anything special its a fully updated rawhide machine. I am not running any tests, this is at the prompt in runlevel 3. I have audit=1 as a boot parameter

Re: [patch 058/209] audit: rework execve audit

2007-07-27 Thread Peter Zijlstra
On Sat, 2007-07-28 at 00:06 +0200, Peter Zijlstra wrote: On Fri, 2007-07-27 at 23:55 +0200, Peter Zijlstra wrote: On Fri, 2007-07-27 at 16:57 -0400, Steve Grubb wrote: I don't know of anything special its a fully updated rawhide machine. I am not running any tests

Re: [patch 2/3] audit: rework execve audit

2007-07-03 Thread Peter Zijlstra
On Tue, 2007-06-26 at 15:55 -0700, Andrew Morton wrote: On Wed, 13 Jun 2007 12:03:36 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: +#ifdef CONFIG_AUDITSYSCALL + { + .ctl_name = CTL_UNNUMBERED, + .procname = audit_argv_kb, + .data

[PATCH 2/4] audit: rework execve audit

2007-06-06 Thread Peter Zijlstra
extended to allow for multiple packets this check can be removed. Signed-off-by: Peter Zijlstra [EMAIL PROTECTED] Signed-off-by: Ollie Wild [EMAIL PROTECTED] Cc: linux-audit@redhat.com --- fs/exec.c |3 + include/linux/binfmts.h |1 include/linux/sysctl.h |1 kernel

Re: [PATCH 2/4] audit: rework execve audit

2007-06-06 Thread Peter Zijlstra
On Tue, 2007-06-05 at 16:39 -0700, Andrew Morton wrote: On Tue, 05 Jun 2007 17:05:25 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: The purpose of audit_bprm() is to log the argv array to a userspace daemon at the end of the execve system call. Since user-space hasn't had time to run