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

2018-10-25 Thread Enke Chen
Hi, Eric: Please see my replied inline. On 10/25/18 5:23 AM, Eric W. Biederman wrote: > Enke Chen writes: > >> Hi, Eric: >> >> Thanks for your comments. Please see my replies inline. >> >> On 10/24/18 6:29 AM, Eric W. Biederman wrote: >>> Enke Chen writes: >>> For simplicity and

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

2018-10-25 Thread Enke Chen
Hi, Eric: Please see my replied inline. On 10/25/18 5:23 AM, Eric W. Biederman wrote: > Enke Chen writes: > >> Hi, Eric: >> >> Thanks for your comments. Please see my replies inline. >> >> On 10/24/18 6:29 AM, Eric W. Biederman wrote: >>> Enke Chen writes: >>> For simplicity and

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

2018-10-25 Thread Enke Chen
Hi, Eric: I have a couple comments inlined. >> On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman >> wrote: >>> Enke Chen writes: For simplicity and consistency, this patch provides an implementation for signal-based fault notification prior to the coredump of a child process. A

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

2018-10-25 Thread Enke Chen
Hi, Eric: I have a couple comments inlined. >> On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman >> wrote: >>> Enke Chen writes: For simplicity and consistency, this patch provides an implementation for signal-based fault notification prior to the coredump of a child process. A

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

2018-10-25 Thread Enke Chen
Hi, Eric: It turns out that the definition of CLD_PREDUMP could well be considered as another instance of "over specification", and is completely unnecessary. When an application chooses a signal for pre-coredump notification, it is much simpler and robust for the signal to be dedicated for

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

2018-10-25 Thread Enke Chen
Hi, Eric: It turns out that the definition of CLD_PREDUMP could well be considered as another instance of "over specification", and is completely unnecessary. When an application chooses a signal for pre-coredump notification, it is much simpler and robust for the signal to be dedicated for

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

2018-10-25 Thread Eric W. Biederman
Jann Horn writes: > On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman > wrote: >> Enke Chen writes: >> > 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,

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

2018-10-25 Thread Eric W. Biederman
Jann Horn writes: > On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman > wrote: >> Enke Chen writes: >> > 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,

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

2018-10-25 Thread Jann Horn
On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman wrote: > Enke Chen writes: > > 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

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

2018-10-25 Thread Jann Horn
On Wed, Oct 24, 2018 at 3:30 PM Eric W. Biederman wrote: > Enke Chen writes: > > 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

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

2018-10-25 Thread Eric W. Biederman
Enke Chen writes: > Hi, Eric: > > Thanks for your comments. Please see my replies inline. > > On 10/24/18 6:29 AM, Eric W. Biederman wrote: >> Enke Chen writes: >> >>> For simplicity and consistency, this patch provides an implementation >>> for signal-based fault notification prior to the

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

2018-10-25 Thread Eric W. Biederman
Enke Chen writes: > Hi, Eric: > > Thanks for your comments. Please see my replies inline. > > On 10/24/18 6:29 AM, Eric W. Biederman wrote: >> Enke Chen writes: >> >>> For simplicity and consistency, this patch provides an implementation >>> for signal-based fault notification prior to the

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

2018-10-24 Thread Enke Chen
Hi, Eric: Thanks for your comments. Please see my replies inline. On 10/24/18 6:29 AM, Eric W. Biederman wrote: > Enke Chen writes: > >> For simplicity and consistency, this patch provides an implementation >> for signal-based fault notification prior to the coredump of a child >> process. A

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

2018-10-24 Thread Enke Chen
Hi, Eric: Thanks for your comments. Please see my replies inline. On 10/24/18 6:29 AM, Eric W. Biederman wrote: > Enke Chen writes: > >> For simplicity and consistency, this patch provides an implementation >> for signal-based fault notification prior to the coredump of a child >> process. A

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

2018-10-24 Thread Enke Chen
Hi, Olge: On 10/24/18 6:52 AM, Oleg Nesterov wrote: > On 10/23, Enke Chen wrote: >> + /* + * Send the pre-coredump signal to the parent if requested. + */ + read_lock(_lock); + notify = do_notify_parent_predump(current); + read_unlock(_lock); + if

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

2018-10-24 Thread Enke Chen
Hi, Olge: On 10/24/18 6:52 AM, Oleg Nesterov wrote: > On 10/23, Enke Chen wrote: >> + /* + * Send the pre-coredump signal to the parent if requested. + */ + read_lock(_lock); + notify = do_notify_parent_predump(current); + read_unlock(_lock); + if

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

2018-10-24 Thread Oleg Nesterov
On 10/23, Enke Chen wrote: > > >> + /* > >> + * Send the pre-coredump signal to the parent if requested. > >> + */ > >> + read_lock(_lock); > >> + notify = do_notify_parent_predump(current); > >> + read_unlock(_lock); > >> + if (notify) > >> + cond_resched(); > > > > Hmm. I do

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

2018-10-24 Thread Oleg Nesterov
On 10/23, Enke Chen wrote: > > >> + /* > >> + * Send the pre-coredump signal to the parent if requested. > >> + */ > >> + read_lock(_lock); > >> + notify = do_notify_parent_predump(current); > >> + read_unlock(_lock); > >> + if (notify) > >> + cond_resched(); > > > > Hmm. I do

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

2018-10-24 Thread Eric W. Biederman
Enke Chen writes: > 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

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

2018-10-24 Thread Eric W. Biederman
Enke Chen writes: > 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

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

2018-10-23 Thread Enke Chen
Hi, Oleg: On 10/23/18 12:43 PM, Enke Chen wrote: >> >>> --- a/fs/coredump.c >>> +++ b/fs/coredump.c >>> @@ -546,6 +546,7 @@ void do_coredump(const kernel_siginfo_t *siginfo) >>> struct cred *cred; >>> int retval = 0; >>> int ispipe; >>> + bool notify; >>> struct files_struct

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

2018-10-23 Thread Enke Chen
Hi, Oleg: On 10/23/18 12:43 PM, Enke Chen wrote: >> >>> --- a/fs/coredump.c >>> +++ b/fs/coredump.c >>> @@ -546,6 +546,7 @@ void do_coredump(const kernel_siginfo_t *siginfo) >>> struct cred *cred; >>> int retval = 0; >>> int ispipe; >>> + bool notify; >>> struct files_struct

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

2018-10-23 Thread Enke Chen
Hi, Oleg: Thanks for your review. Please see my replies inline. On 10/23/18 2:23 AM, Oleg Nesterov wrote: > On 10/22, Enke Chen wrote: >> >> As the coredump of a process may take time, in certain time-sensitive >> applications it is necessary for a parent process (e.g., a process >> manager) to

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

2018-10-23 Thread Enke Chen
Hi, Oleg: Thanks for your review. Please see my replies inline. On 10/23/18 2:23 AM, Oleg Nesterov wrote: > On 10/22, Enke Chen wrote: >> >> As the coredump of a process may take time, in certain time-sensitive >> applications it is necessary for a parent process (e.g., a process >> manager) to

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

2018-10-23 Thread Oleg Nesterov
On 10/22, Enke Chen wrote: > > As the coredump of a process may take time, in certain time-sensitive > applications it is necessary for a parent process (e.g., a process > manager) to be notified of a child's imminent death before the coredump > so that the parent process can act sooner, such as

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

2018-10-23 Thread Oleg Nesterov
On 10/22, Enke Chen wrote: > > As the coredump of a process may take time, in certain time-sensitive > applications it is necessary for a parent process (e.g., a process > manager) to be notified of a child's imminent death before the coredump > so that the parent process can act sooner, such as

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

2018-10-22 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 (SIGCHLD or

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

2018-10-22 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 (SIGCHLD or