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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161228215603.6600-1-david@sigma-star.at>
Date:   Wed, 28 Dec 2016 22:56:03 +0100
From:   David Gstir <david@...ma-star.at>
To:     linux-kernel@...r.kernel.org
Cc:     daniel.lezcano@...aro.org, tglx@...utronix.de, richard@....at,
        stable@...r.kernel.org, Andres Salomon <dilinger@...ued.net>,
        Viresh Kumar <viresh.kumar@...aro.org>
Subject: [PATCH] clockevents/drivers/cs5535: Un-break driver with 'set-state' interface

Since migrating to the 'set-state' interface the cs5535 driver causes a
crash after loading: Right after initialization, the IRQ handler
(mfgpt_tick) is triggered with clock event device in detached state. This
state not properly handled and causes a crash through NULL pointer
dereference upon calling the clockevent's event_handler.

This patch fixes this by handling the detached state the same way the
shutdown state is handled.

Fixes: 8f9327cbb6e8 ("clockevents/drivers/cs5535: Migrate to new 'set-state' interface")
Cc: stable@...r.kernel.org
Cc: Andres Salomon <dilinger@...ued.net>
Cc: Viresh Kumar <viresh.kumar@...aro.org>
Signed-off-by: David Gstir <david@...ma-star.at>
---
 drivers/clocksource/cs5535-clockevt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/cs5535-clockevt.c b/drivers/clocksource/cs5535-clockevt.c
index 9a7e37cf56b0..649e0cd90805 100644
--- a/drivers/clocksource/cs5535-clockevt.c
+++ b/drivers/clocksource/cs5535-clockevt.c
@@ -117,7 +117,8 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id)
 	/* Turn off the clock (and clear the event) */
 	disable_timer(cs5535_event_clock);
 
-	if (clockevent_state_shutdown(&cs5535_clockevent))
+	if (clockevent_state_shutdown(&cs5535_clockevent) ||
+			clockevent_state_detached(&cs5535_clockevent))
 		return IRQ_HANDLED;
 
 	/* Clear the counter */
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ