From: Oleg Nesterov <oleg@redhat.com>
To: Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
Cc: davem@davemloft.net, Liam.Howlett@Oracle.com,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
akpm@linux-foundation.org, axboe@kernel.dk, brauner@kernel.org,
mhocko@suse.com, alexjlzheng@tencent.com, willy@infradead.org,
michael.christie@oracle.com, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, shuah@kernel.org,
linux-kselftest@vger.kernel.org, peili.io@oracle.com,
"Eric W. Biederman" <ebiederm@xmission.com>
Subject: Re: [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector
Date: Fri, 20 Sep 2024 13:00:23 +0200 [thread overview]
Message-ID: <20240920110022.GA15795@redhat.com> (raw)
In-Reply-To: <20240920000933.185090-2-anjali.k.kulkarni@oracle.com>
On 09/19, Anjali Kulkarni wrote:
>
> @@ -413,6 +416,10 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg,
> if (msg->len == sizeof(*pinput)) {
> pinput = (struct proc_input *)msg->data;
> mc_op = pinput->mcast_op;
> + if (mc_op == PROC_CN_MCAST_NOTIFY) {
> + current->exit_code = pinput->uexit_code;
> + return;
...
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -821,6 +821,7 @@ void __noreturn do_exit(long code)
> {
> struct task_struct *tsk = current;
> int group_dead;
> + __u32 uexit_code;
>
> WARN_ON(irqs_disabled());
>
> @@ -863,6 +864,8 @@ void __noreturn do_exit(long code)
> tty_audit_exit();
> audit_free(tsk);
>
> + uexit_code = tsk->exit_code;
I don't think you can use task_struct->exit_code. If this task is ptraced,
it can be changed/cleared in, say, ptrace_stop() after PROC_CN_MCAST_NOTIFY.
Oleg.
next prev parent reply other threads:[~2024-09-20 11:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 0:09 [PATCH net-next 0/2] Threads extension for process connector Anjali Kulkarni
2024-09-20 0:09 ` [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector Anjali Kulkarni
2024-09-20 11:00 ` Oleg Nesterov [this message]
2024-09-20 15:42 ` Anjali Kulkarni
2024-09-20 18:44 ` Oleg Nesterov
2024-09-20 19:39 ` Anjali Kulkarni
2024-09-20 0:09 ` [PATCH net-next 2/2] connector/cn_proc: Selftest for threads case Anjali Kulkarni
2024-09-22 1:23 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240920110022.GA15795@redhat.com \
--to=oleg@redhat.com \
--cc=Liam.Howlett@Oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alexjlzheng@tencent.com \
--cc=anjali.k.kulkarni@oracle.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=michael.christie@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peili.io@oracle.com \
--cc=shuah@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).