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: <Pine.LNX.4.64.0908312111400.17886@ask.diku.dk>
Date:	Mon, 31 Aug 2009 21:12:07 +0200 (CEST)
From:	Julia Lawall <julia@...u.dk>
To:	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [PATCH] drivers/char/amiserial.c: Add local_irq_restore in error
 handling code

From: Julia Lawall <julia@...u.dk>

The gotos to the labels fail_free_irq and fail_unregister only occur
between local_irq_save and local_irq_restore, so it would seem that this
code should also call local_irq_restore.

The semantic match that detects this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@rl@
expression l;
position p;
expression E,E1,E2;
@@

local_irq_save(l);
<... when != local_irq_restore(l)
     when != spin_unlock_irqrestore(E,l)
if (...) { ... when != local_irq_restore(l)
               when != spin_unlock_irqrestore(E1,l)
*    return@p ...;
}
...>
(
spin_unlock_irqrestore(E2,l);
|
local_irq_restore(l);
)
</smpl>

Signed-off-by: Julia Lawall <julia@...u.dk>

---
 drivers/char/amiserial.c            |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c
index 6c32fbf..2131ecb 100644
--- a/drivers/char/amiserial.c
+++ b/drivers/char/amiserial.c
@@ -2056,6 +2056,7 @@ fail_free_irq:
 	free_irq(IRQ_AMIGA_TBE, state);
 fail_unregister:
 	tty_unregister_driver(serial_driver);
+	local_irq_restore(flags);
 fail_release_mem_region:
 	release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
 fail_put_tty_driver:
--
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