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>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0904151142420.31828@gandalf.stny.rr.com>
Date:	Wed, 15 Apr 2009 11:44:08 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	LKML <linux-kernel@...r.kernel.org>,
	linux-rt-users <linux-rt-users@...r.kernel.org>
cc:	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Clark Williams <clark.williams@...il.com>,
	"Luis Claudio R. Goncalves" <lclaudio@...g.org>
Subject: [PATCH RT] preempt-rt: implement rt_downgrade_write


From: Steven Rostedt <srostedt@...hat.com>
Subject: preempt-rt: implement rt_downgrade_write

The current code of rt_downgrade_write simply does a BUG(). There
are places in the kernel that uses this code, and will crash a runnning
preempt-rt kernel.

The rt_downgrade_write converts a rwsem held for write into a rwsem
held for read without ever releasing the semaphore. In -rt, the rwsems
are simply a mutex. There is nothing different between a rwsem held
for write, and one held for read. The difference is that one held for
read can nest.

This patch changes the BUG_ON() to simply BUG if the caller is not
the owner of the semaphore.

This patch comes from my rt-git repo, and has been tested there.

Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
---
 kernel/rt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-rt/kernel/rt.c
===================================================================
--- linux-2.6-rt.orig/kernel/rt.c	2009-04-15 10:02:37.000000000 -0400
+++ linux-2.6-rt/kernel/rt.c	2009-04-15 11:28:13.000000000 -0400
@@ -316,7 +316,7 @@ EXPORT_SYMBOL(rt_up_read);
  */
 void  rt_downgrade_write(struct rw_semaphore *rwsem)
 {
-	BUG();
+	BUG_ON(rt_mutex_real_owner(&rwsem->lock) != current);
 }
 EXPORT_SYMBOL(rt_downgrade_write);
 

--
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