Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org, jwlee2217@gmail.com, oleg@redhat.com,
	qw3rtyp0@gmail.com
Cc: Sasha Levin <sashal@kernel.org>,
	stable@vger.kernel.org, Thomas Gleixner <tglx@kernel.org>
Subject: Re: [PATCH 5.15.y, 6.1.y, 6.6.y] posix-cpu-timers: Prevent UAF caused by non-leader exec()
Date: Sun, 26 Jul 2026 17:24:49 -0400	[thread overview]
Message-ID: <20260726195203.stable-0004@kernel.org> (raw)
In-Reply-To: <87ecgqkf54.ffs@fw13>

Thanks for doing these.  I have queued the 6.12 one, but I would like to
ask for a v2 of this one before taking 6.6, 6.1 and 5.15.

> @@ -714,7 +781,7 @@ static int posix_cpu_timer_set(struct k_
>  		 * it as an overrun (thanks to bump_cpu_timer above).
>  		 */
>  		unlock_task_sighand(p, &flags);
> -		goto out;
> +		return ret;
>  	}

[...]

> +	if (old)
> +		old->it_interval = ns_to_timespec64(old_incr);
> +
[...]
> - out:
> -	rcu_read_unlock();
> -	if (old)
> -		old->it_interval = ns_to_timespec64(old_incr);

On these trees that changes user-visible behaviour on the TIMER_RETRY
path.  Before the patch the "goto out" fell through the shared out:
label, which filled in old->it_interval; afterwards the early return
skips it and the assignment only runs on the success path.

Upstream that is harmless because bfa408f03fc7 ("posix-timers: Retrieve
interval in common timer_settime() code") moved the interval retrieval
into the common code, but that landed in v6.12 and 6.6, 6.1 and 5.15 do
not have it.  Their do_timer_settime() sets old_spec64 = NULL before it
goes back around the retry loop, so a timer_settime() that races timer
expiry now reports old_value.it_interval == {0,0} instead of the
previous interval.

Does it make sense?

-- 
Thanks,
Sasha

  reply	other threads:[~2026-07-26 21:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21  9:16 FAILED: patch "[PATCH] posix-cpu-timers: Prevent UAF caused by non-leader exec()" failed to apply to 5.15-stable tree gregkh
2026-07-25 20:06 ` [PATCH 5.15.y, 6.1.y, 6.6.y] posix-cpu-timers: Prevent UAF caused by non-leader exec() Thomas Gleixner
2026-07-26 21:24   ` Sasha Levin [this message]
2026-07-26 22:21     ` Thomas Gleixner
2026-07-27  9:10       ` [PATCH V2 " Thomas Gleixner
2026-07-27 22:19         ` Sasha Levin

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=20260726195203.stable-0004@kernel.org \
    --to=sashal@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jwlee2217@gmail.com \
    --cc=oleg@redhat.com \
    --cc=qw3rtyp0@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.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