lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240920110022.GA15795@redhat.com>
Date: Fri, 20 Sep 2024 13:00:23 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
Cc: davem@...emloft.net, Liam.Howlett@...cle.com, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, akpm@...ux-foundation.org,
	axboe@...nel.dk, brauner@...nel.org, mhocko@...e.com,
	alexjlzheng@...cent.com, willy@...radead.org,
	michael.christie@...cle.com, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, shuah@...nel.org,
	linux-kselftest@...r.kernel.org, peili.io@...cle.com,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc
 connector

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.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ