Linux-rt-users archive on lore.kernel.org
 help / color / Atom feed
* [PATCH RT] posix-timers: Unlock expiry lock in the early return
@ 2019-09-23 16:01 Sebastian Andrzej Siewior
  2019-09-23 18:36 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-09-23 16:01 UTC (permalink / raw)
  To: LKML; +Cc: linux-rt-users, Steven Rostedt, Thomas Gleixner

Patch ("posix-timers: Add expiry lock") acquired a lock in
run_posix_cpu_timers() but didn't drop the lock in the early return.

Unlock the lock in the early return path.

Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/time/posix-cpu-timers.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/time/posix-cpu-timers.c b/kernel/time/posix-cpu-timers.c
index 20cd92a8b9785..a045813c37021 100644
--- a/kernel/time/posix-cpu-timers.c
+++ b/kernel/time/posix-cpu-timers.c
@@ -1167,8 +1167,10 @@ static void __run_posix_cpu_timers(struct task_struct *tsk)
 	expiry_lock = this_cpu_ptr(&cpu_timer_expiry_lock);
 	spin_lock(expiry_lock);
 
-	if (!lock_task_sighand(tsk, &flags))
+	if (!lock_task_sighand(tsk, &flags)) {
+		spin_unlock(expiry_lock);
 		return;
+	}
 	/*
 	 * Here we take off tsk->signal->cpu_timers[N] and
 	 * tsk->cpu_timers[N] all the timers that are firing, and
-- 
2.23.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH RT] posix-timers: Unlock expiry lock in the early return
  2019-09-23 16:01 [PATCH RT] posix-timers: Unlock expiry lock in the early return Sebastian Andrzej Siewior
@ 2019-09-23 18:36 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2019-09-23 18:36 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: LKML, linux-rt-users, Steven Rostedt

On Mon, 23 Sep 2019, Sebastian Andrzej Siewior wrote:

> Patch ("posix-timers: Add expiry lock") acquired a lock in
> run_posix_cpu_timers() but didn't drop the lock in the early return.
> 
> Unlock the lock in the early return path.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-23 16:01 [PATCH RT] posix-timers: Unlock expiry lock in the early return Sebastian Andrzej Siewior
2019-09-23 18:36 ` Thomas Gleixner

Linux-rt-users archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org linux-rt-users@archiver.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/ public-inbox