Subject: kern/24227: RTC buffer over flow
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <kiyohara@kk.iij4u.or.jp>
List: netbsd-bugs
Date: 01/25/2004 06:21:09
>Number:         24227
>Category:       kern
>Synopsis:       RTC buffer over flow
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 25 06:22:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     KIYOHARA Takashi
>Release:        NetBSD 1.6ZG
>Organization:
>Environment:
NetBSD evbppc.fool 1.6ZG NetBSD 1.6ZG (OPENBLOCKS266) #0: Sun Dec 21 12:58:20 JST 2003  lance@evbppc.fool:/sys/arch/evbppc/compile/OPENBLOCKS266 evbppc
>Description:
RTC (x1226) buffer over flow.
Size and the number of times of a loop do not suit.

see. sys/dev/i2c/x1226.{c,h}

>How-To-Repeat:

>Fix:
Index: x1226reg.h
===================================================================
RCS file: /cvsroot/src/sys/dev/i2c/x1226reg.h,v
retrieving revision 1.1
diff -c -r1.1 x1226reg.h
*** x1226reg.h  2003/10/06 18:02:02     1.1
--- x1226reg.h  2004/01/15 15:13:35
***************
*** 64,70 ****
  #define       X1226_REG_MN            0x31    /* bcd inute (0-59) */
  #define       X1226_REG_SC            0x30    /* bcd econd (0-59) */
  #define       X1226_REG_RTC_BASE      0x30
! #define       X1226_REG_RTC_SIZE      (X1226_REG_Y2K - X1226_REG_RTC_BASE)
  /* Watchdog RTC registers mask */
  #define       X1226_REG_Y2K_MASK      0x39
  #define       X1226_REG_DW_MASK       0x07
--- 64,70 ----
  #define       X1226_REG_MN            0x31    /* bcd inute (0-59) */
  #define       X1226_REG_SC            0x30    /* bcd econd (0-59) */
  #define       X1226_REG_RTC_BASE      0x30
! #define       X1226_REG_RTC_SIZE      (X1226_REG_Y2K - X1226_REG_RTC_BASE) + 1
  /* Watchdog RTC registers mask */
  #define       X1226_REG_Y2K_MASK      0x39
  #define       X1226_REG_DW_MASK       0x07
>Release-Note:
>Audit-Trail:
>Unformatted: