summaryrefslogtreecommitdiff
path: root/packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2005-06-30 08:19:37 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-06-30 08:19:37 +0000
commitc8e5702127e507e82e6f68a4b8c546803accea9d (patch)
tree00583491f40ecc640f2b28452af995e3a63a09d7 /packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch
parent87ec8ca4d2e2eb4d1c1e1e1a6b46a395d56805b9 (diff)
import clean BK tree at cset 1.3670
Diffstat (limited to 'packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch')
-rw-r--r--packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch140
1 files changed, 140 insertions, 0 deletions
diff --git a/packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch b/packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch
index e69de29bb2..fea565a04a 100644
--- a/packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch
+++ b/packages/linux/openzaurus-pxa27x-2.4.20-rmk2-embedix20050228/P08-rtc-mremap-mremap2nd-fix_041213.patch
@@ -0,0 +1,140 @@
+diff -Nur c3000_pre/linux/arch/cris/drivers/ds1302.c c3000_test/linux/arch/cris/drivers/ds1302.c
+--- c3000_pre/linux/arch/cris/drivers/ds1302.c 2004-08-21 09:48:08.000000000 +0900
++++ c3000_test/linux/arch/cris/drivers/ds1302.c 2004-12-13 23:30:00.000000000 +0900
+@@ -315,6 +315,7 @@
+ {
+ struct rtc_time rtc_tm;
+
++ memset(&rtc_tm, 0, sizeof (struct rtc_time));
+ get_rtc_time(&rtc_tm);
+ if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
+ return -EFAULT;
+diff -Nur c3000_pre/linux/arch/m68k/bvme6000/rtc.c c3000_test/linux/arch/m68k/bvme6000/rtc.c
+--- c3000_pre/linux/arch/m68k/bvme6000/rtc.c 2004-08-21 09:48:10.000000000 +0900
++++ c3000_test/linux/arch/m68k/bvme6000/rtc.c 2004-12-13 23:30:00.000000000 +0900
+@@ -54,6 +54,7 @@
+ /* Ensure clock and real-time-mode-register are accessible */
+ msr = rtc->msr & 0xc0;
+ rtc->msr = 0x40;
++ memset(&wtime, 0, sizeof(struct rtc_time));
+ do {
+ wtime.tm_sec = BCD2BIN(rtc->bcd_sec);
+ wtime.tm_min = BCD2BIN(rtc->bcd_min);
+diff -Nur c3000_pre/linux/arch/m68k/mvme16x/rtc.c c3000_test/linux/arch/m68k/mvme16x/rtc.c
+--- c3000_pre/linux/arch/m68k/mvme16x/rtc.c 2004-08-21 09:48:11.000000000 +0900
++++ c3000_test/linux/arch/m68k/mvme16x/rtc.c 2004-12-13 23:30:00.000000000 +0900
+@@ -52,6 +52,7 @@
+ cli();
+ /* Ensure clock and real-time-mode-register are accessible */
+ rtc->ctrl = RTC_READ;
++ memset(&wtime, 0, sizeof(struct rtc_time));
+ wtime.tm_sec = BCD2BIN(rtc->bcd_sec);
+ wtime.tm_min = BCD2BIN(rtc->bcd_min);
+ wtime.tm_hour = BCD2BIN(rtc->bcd_hr);
+diff -Nur c3000_pre/linux/drivers/char/efirtc.c c3000_test/linux/drivers/char/efirtc.c
+--- c3000_pre/linux/drivers/char/efirtc.c 2004-08-21 09:48:25.000000000 +0900
++++ c3000_test/linux/drivers/char/efirtc.c 2004-12-13 23:30:00.000000000 +0900
+@@ -118,6 +118,7 @@
+ static void
+ convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
+ {
++ memset(wtime, 0, sizeof(struct rtc_time));
+ wtime->tm_sec = eft->second;
+ wtime->tm_min = eft->minute;
+ wtime->tm_hour = eft->hour;
+diff -Nur c3000_pre/linux/drivers/char/rtc.c c3000_test/linux/drivers/char/rtc.c
+--- c3000_pre/linux/drivers/char/rtc.c 2004-08-21 09:48:25.000000000 +0900
++++ c3000_test/linux/drivers/char/rtc.c 2004-12-13 23:30:00.000000000 +0900
+@@ -375,7 +375,7 @@
+ * means "don't care" or "match all". Only the tm_hour,
+ * tm_min, and tm_sec values are filled in.
+ */
+-
++ memset(&wtime, 0, sizeof(struct rtc_time));
+ get_rtc_alm_time(&wtime);
+ break;
+ }
+@@ -423,6 +423,7 @@
+ }
+ case RTC_RD_TIME: /* Read the time/date from RTC */
+ {
++ memset(&wtime, 0, sizeof(struct rtc_time));
+ get_rtc_time(&wtime);
+ break;
+ }
+diff -Nur c3000_pre/linux/drivers/macintosh/rtc.c c3000_test/linux/drivers/macintosh/rtc.c
+--- c3000_pre/linux/drivers/macintosh/rtc.c 2004-08-21 09:48:35.000000000 +0900
++++ c3000_test/linux/drivers/macintosh/rtc.c 2004-12-13 23:30:00.000000000 +0900
+@@ -64,6 +64,7 @@
+ case RTC_RD_TIME:
+ if (ppc_md.get_rtc_time)
+ {
++ memset(&rtc_tm, 0, sizeof(struct rtc_time));
+ get_rtc_time(&rtc_tm);
+
+ if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
+diff -Nur c3000_pre/linux/drivers/sbus/char/rtc.c c3000_test/linux/drivers/sbus/char/rtc.c
+--- c3000_pre/linux/drivers/sbus/char/rtc.c 2004-08-21 09:48:39.000000000 +0900
++++ c3000_test/linux/drivers/sbus/char/rtc.c 2004-12-13 23:30:00.000000000 +0900
+@@ -89,6 +89,7 @@
+ switch (cmd)
+ {
+ case RTCGET:
++ memset(&rtc_tm, 0, sizeof(struct rtc_time));
+ get_rtc_time(&rtc_tm);
+
+ if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))
+diff -Nur c3000_pre/linux/mm/mmap.c c3000_test/linux/mm/mmap.c
+--- c3000_pre/linux/mm/mmap.c 2004-08-21 09:49:15.000000000 +0900
++++ c3000_test/linux/mm/mmap.c 2004-12-13 23:27:31.000000000 +0900
+@@ -1045,6 +1045,9 @@
+ if (!len)
+ return addr;
+
++ if ((addr + len) > TASK_SIZE || (addr + len) < addr)
++ return -EINVAL;
++
+ /*
+ * mlock MCL_FUTURE?
+ */
+diff -Nur c3000_pre/linux/mm/mremap.c c3000_test/linux/mm/mremap.c
+--- c3000_pre/linux/mm/mremap.c 2004-08-21 09:49:15.000000000 +0900
++++ c3000_test/linux/mm/mremap.c 2004-12-13 23:30:18.000000000 +0900
+@@ -242,6 +242,13 @@
+
+ if (new_len > TASK_SIZE || new_addr > TASK_SIZE - new_len)
+ goto out;
++ /*
++ * Allow new_len == 0 only if new_addr == addr
++ * to preserve truncation in place (that was working
++ * safe and some app may depend on it).
++ */
++ if (unlikely(!new_len && new_addr != addr))
++ goto out;
+
+ /* Check if the location we're moving into overlaps the
+ * old location at all, and fail if it does.
+@@ -252,16 +259,20 @@
+ if ((addr <= new_addr) && (addr+old_len) > new_addr)
+ goto out;
+
+- do_munmap(current->mm, new_addr, new_len);
++ ret = do_munmap(current->mm, new_addr, new_len);
++ if (ret && new_len)
++ goto out;
+ }
+
+ /*
+ * Always allow a shrinking remap: that just unmaps
+ * the unnecessary pages..
+ */
+- ret = addr;
+ if (old_len >= new_len) {
+- do_munmap(current->mm, addr+new_len, old_len - new_len);
++ ret = do_munmap(current->mm, addr+new_len, old_len - new_len);
++ if (ret && old_len != new_len)
++ goto out;
++ ret = addr;
+ if (!(flags & MREMAP_FIXED) || (new_addr == addr))
+ goto out;
+ }