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]
Date:	Mon, 16 May 2011 13:57:11 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Tejun Heo <tj@...nel.org>
Cc:	jan.kratochvil@...hat.com, vda.linux@...glemail.com,
	linux-kernel@...r.kernel.org, torvalds@...ux-foundation.org,
	akpm@...ux-foundation.org, indan@....nu, bdonlan@...il.com
Subject: Re: [PATCH 4/9] ptrace: relocate set_current_state(TASK_TRACED) in
	ptrace_stop()

On 05/13, Tejun Heo wrote:
>
> In ptrace_stop(), after arch hook is done, the task state and jobctl
> bits are updated while holding siglock.  The ordering requirement
> there is that TASK_TRACED is set before JOBCTL_TRAPPING is cleared to
> prevent ptracer waiting on TRAPPING doesn't end up waking up TRACED is
> actually set and sees TASK_RUNNING in wait(2).
>
> Move set_current_state(TASK_TRACED) to the top of the block and
> reorganize comments.  This makes the ordering more obvious
> (TASK_TRACED before other updates)

I am ab bit confused... please see below.

> and helps future updates to group
> stop participation.

OK, so I assume we need this change.

> This patch doesn't cause any functional change.

Agreed, so the patch looks fine.


But the comment looks a bit confusing to me. This is fine, I almost never
read them ;) Just I'd like to ensure I din't miss something.

> @@ -1733,6 +1733,18 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
>  	}
>
>  	/*
> +	 * We're committing to trapping.  TRACED should be visible before
> +	 * TRAPPING is cleared

This looks as if you explain the barrier in set_current_state(). And,
btw, why can't we use __set_current_state() here ?

And. not only TRACED, at least ->exit_code should be visible as well.

IOW. It is not that TRACED should be visible before jobctl &= ~JOBCTL_TRAPPING,
we should correctly update the tracee before __wake_up_sync_key(), and I assume
this is what the comment says.

Correct?

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ