From: Frederic Weisbecker <frederic@kernel.org>
To: WenTao Liang <vulab@iscas.ac.cn>
Cc: anna-maria@linutronix.de, tglx@kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] posix-cpu-timers: Fix pid refcount leak in do_cpu_nanosleep() error path
Date: Fri, 12 Jun 2026 23:42:58 +0200 [thread overview]
Message-ID: <aix9YrXp8K0-fpEB@pavilion.home> (raw)
In-Reply-To: <20260611161738.97043-1-vulab@iscas.ac.cn>
Le Fri, Jun 12, 2026 at 12:17:38AM +0800, WenTao Liang a écrit :
> In do_cpu_nanosleep(), posix_cpu_timer_create() takes a pid reference
> via get_pid() and stores it in timer.it.cpu.pid. If the subsequent
> posix_cpu_timer_set() call fails, the function returns immediately
> without calling posix_cpu_timer_del() to release the pid reference,
> causing a leak.
>
> Fix it by calling posix_cpu_timer_del() before the unlock-and-return
> on the error path, consistent with the other exit paths in the same
> function.
>
> Cc: stable@vger.kernel.org
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Thanks!
--
Frederic Weisbecker
SUSE Labs
next prev parent reply other threads:[~2026-06-12 21:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 16:17 WenTao Liang
2026-06-12 21:42 ` Frederic Weisbecker [this message]
2026-06-13 14:22 ` [tip: timers/core] " tip-bot2 for WenTao Liang
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=aix9YrXp8K0-fpEB@pavilion.home \
--to=frederic@kernel.org \
--cc=anna-maria@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=vulab@iscas.ac.cn \
/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
all inboxes | Powered by JetHome®