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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200701052055.06264.david-b@pacbell.net>
Date:	Fri, 5 Jan 2007 20:55:05 -0800
From:	David Brownell <david-b@...bell.net>
To:	Alessandro Zummo <alessandro.zummo@...ertech.it>,
	Paul Mundt <lethal@...ux-sh.org>, lenehan@...bble.org
Cc:	Linux Kernel list <linux-kernel@...r.kernel.org>,
	rtc-linux@...glegroups.com
Subject: [patch 2.6.20-rc3] rtc-sh correctly reports rtc_wkalrm.enabled

This fixes the SH rtc driver to
  (a) correctly report 'enabled' status with other alarm status;
  (b) not duplicate that status in its procfs dump

Signed-off-by: David Brownell <dbrownell@...rs.sourceforge.net>

---
An audit of the RTC driver treatment of the "enabled" flag turned
up a handful of clear bugs; most drivers handle it the same now
(assuming they support alarms).

This driver has another issue:  sh_rtc_set_alarm() ignores the
"enabled" flag, rather than using it to tell whether the alarm
should be enabled on exit from that routine.  One at a time.  :)

Index: at91/drivers/rtc/rtc-sh.c
===================================================================
--- at91.orig/drivers/rtc/rtc-sh.c	2006-12-18 23:32:22.000000000 -0800
+++ at91/drivers/rtc/rtc-sh.c	2006-12-18 23:34:37.000000000 -0800
@@ -264,8 +264,6 @@ static int sh_rtc_proc(struct device *de
 	unsigned int tmp;
 
 	tmp = readb(rtc->regbase + RCR1);
-	seq_printf(seq, "alarm_IRQ\t: %s\n",
-		   (tmp & RCR1_AIE) ? "yes" : "no");
 	seq_printf(seq, "carry_IRQ\t: %s\n",
 		   (tmp & RCR1_CIE) ? "yes" : "no");
 
@@ -428,6 +426,8 @@ static int sh_rtc_read_alarm(struct devi
 		tm->tm_mon -= 1; /* RTC is 1-12, tm_mon is 0-11 */
 	tm->tm_year     = 0xffff;
 
+	wkalrm->enabled = (readb(rtc->regbase + RCR1) & RCR1_AIE) ? 1 : 0;
+
 	spin_unlock_irq(&rtc->lock);
 
 	return 0;
-
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