Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-29 Thread Enke Chen
Hi, Oleg: Yes, it should be the "real_parent" that is more interested in the notification. Will revert back. +static void do_notify_parent_predump(void) +{ + struct task_struct *parent; + int sig; + + rcu_read_lock(); + parent = rcu_dereference(current->real_parent); +

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-29 Thread Enke Chen
Hi, Oleg: Yes, it should be the "real_parent" that is more interested in the notification. Will revert back. +static void do_notify_parent_predump(void) +{ + struct task_struct *parent; + int sig; + + rcu_read_lock(); + parent = rcu_dereference(current->real_parent); +

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-29 Thread Oleg Nesterov
Hi, On 10/26, Enke Chen wrote: > > This is really a good idea given that "parent" is declared as RCU-protected. > Just a bit odd, though, that the "parent" has not been accessed this way in > the code base. It is acccessed when possible, > So just to confirm: the revised code would look like

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-29 Thread Oleg Nesterov
Hi, On 10/26, Enke Chen wrote: > > This is really a good idea given that "parent" is declared as RCU-protected. > Just a bit odd, though, that the "parent" has not been accessed this way in > the code base. It is acccessed when possible, > So just to confirm: the revised code would look like

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-26 Thread Enke Chen
Hi, Olge: This is really a good idea given that "parent" is declared as RCU-protected. Just a bit odd, though, that the "parent" has not been accessed this way in the code base. So just to confirm: the revised code would look like the following: static void do_notify_parent_predump(void) {

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-26 Thread Enke Chen
Hi, Olge: This is really a good idea given that "parent" is declared as RCU-protected. Just a bit odd, though, that the "parent" has not been accessed this way in the code base. So just to confirm: the revised code would look like the following: static void do_notify_parent_predump(void) {

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-26 Thread Oleg Nesterov
On 10/25, Enke Chen wrote: > > +static void do_notify_parent_predump(void) > +{ > + struct task_struct *parent; > + int sig; > + > + read_lock(_lock); > + parent = current->parent; > + sig = parent->signal->predump_signal; > + if (sig != 0) > +

Re: [PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-26 Thread Oleg Nesterov
On 10/25, Enke Chen wrote: > > +static void do_notify_parent_predump(void) > +{ > + struct task_struct *parent; > + int sig; > + > + read_lock(_lock); > + parent = current->parent; > + sig = parent->signal->predump_signal; > + if (sig != 0) > +

[PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-25 Thread Enke Chen
For simplicity and consistency, this patch provides an implementation for signal-based fault notification prior to the coredump of a child process. A new prctl command, PR_SET_PREDUMP_SIG, is defined that can be used by an application to express its interest and to specify the signal for such a

[PATCH v4] kernel/signal: Signal-based pre-coredump notification

2018-10-25 Thread Enke Chen
For simplicity and consistency, this patch provides an implementation for signal-based fault notification prior to the coredump of a child process. A new prctl command, PR_SET_PREDUMP_SIG, is defined that can be used by an application to express its interest and to specify the signal for such a