Re: [patch V2 1/8] signal: Prevent exec() race
From: Thomas Gleixner
Date: Wed Sep 09 2026 - 07:42:15 EST
On Wed, Sep 09 2026 at 11:55, Peter Zijlstra wrote:
> On Wed, Sep 09, 2026 at 11:08:31AM +0200, Thomas Gleixner wrote:
> Now, I have deleted and rewritten this tail end at least twice now. And
> I *think* I'm agreeing with you. Let me explain:
>
> It all hinges on D-E and H-I.
>
> D-E is a UNLOCK+LOCK hand-over, which is not quite the same as
> RELEASE+ACQUIRE. Specifically, we have:
>
> RELEASE+ACQUIRE: RCpc, only the CPUs involved agree on the ordering
> UNLOCK+LOCK: RCtso, the hand-over is store-ordering
Yes. I should have argued with UNLOCK+LOCK instead. My bad.
> So while earlier I was arguing with RCpc in mind, in which case D-E
> completely goes away and we can consider B-G' to be one big critical
> section from the PoV of a third CPU (our posix_timer_fn() one). In this
> case we can push A down and G up and have them cross.
Correct.
> *However*, since these are locks, we actually have D-E be UNLOCK+LOCK,
> which is RCtso and that *does* impose store order, so A stores must
> happen before G stores
Yes. That was my thinking, but I obviously expressed it incorrectly.
> Combine with H-I, which has a data dependency from the LOAD to the LOCK
> and thereby constraints later LOADs, those sigqueue loads that come
> after I must in fact observe the A stores.
Right. I guess it's worth to document that somewhere at least in the
change log of this patch.