From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Fix uninitialized data in EFI RTC /proc interface
Date: Thu, 25 Mar 2004 16:15:53 +0000 [thread overview]
Message-ID: <200403250915.53296.bjorn.helgaas@hp.com> (raw)
In-Reply-To: <200403250908.25718.bjorn.helgaas@hp.com>
(Sorry about the malformed patch -- I screwed it up while adding
the text at the top. Here's a corrected one.)
Please apply the following patch (based on 2.6.5-rc2).
The problem is that we don't clear out the efi_time_t buffer
before asking EFI to fill it in. EFI doesn't always write the
entire buffer (in particular, the alarm time only supports one
second resolution, so the nanosecond field is often untouched).
The effect is that 'cat /proc/driver/efirtc' shows garbage in
the nanoseconds part of the alarm time, and sometimes artifacts
like bogus alarm date and junk after the actual end of the text.
=== drivers/char/efirtc.c 1.8 vs edited ==--- 1.8/drivers/char/efirtc.c Mon Jan 19 16:38:04 2004
+++ edited/drivers/char/efirtc.c Thu Mar 25 08:48:45 2004
@@ -6,13 +6,13 @@
*
* Based on skeleton from the drivers/char/rtc.c driver by P. Gortmaker
*
- * This code provides a architected & portable interface to the real time
+ * This code provides an architected & portable interface to the real time
* clock by using EFI instead of direct bit fiddling. The functionalities are
* quite different from the rtc.c driver. The only way to talk to the device
* is by using ioctl(). There is a /proc interface which provides the raw
* information.
*
- * Please note that we have kept the API as close as possible from the
+ * Please note that we have kept the API as close as possible to the
* legacy RTC. The standard /sbin/hwclock program should work normally
* when used to get/set the time.
*
@@ -297,7 +297,7 @@
};
/*
- * We export RAW EFI information to /proc/efirtc
+ * We export RAW EFI information to /proc/driver/efirtc
*/
static int
efi_rtc_get_status(char *buf)
@@ -307,6 +307,10 @@
char *p = buf;
efi_bool_t enabled, pending;
unsigned long flags;
+
+ memset(&eft, 0, sizeof(eft));
+ memset(&alm, 0, sizeof(alm));
+ memset(&cap, 0, sizeof(cap));
spin_lock_irqsave(&efi_rtc_lock, flags);
prev parent reply other threads:[~2004-03-25 16:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-25 16:08 [PATCH] Fix uninitialized data in EFI RTC /proc interface Bjorn Helgaas
2004-03-25 16:15 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200403250915.53296.bjorn.helgaas@hp.com \
--to=bjorn.helgaas@hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox