Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6]: src/sys/compat/netbsd32 Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/6be3f6ed3997
branches:  netbsd-6
changeset: 776583:6be3f6ed3997
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Mar 18 08:01:34 2014 +0000

description:
Pull up following revision(s) (requested by manu in ticket #1021):
        sys/compat/netbsd32/netbsd32_event.c: revision 1.10
Fix netbsd32 compatibility bug in kevent().

The keo_put_events() callback copies the events from kernel to userland.
It is called for sets of up to 8 events (constant chosen in kevbuf
definitition in kevent1()). The callback is called with pointer to
userland buffer, count of events to copy, and an index parameter which tracks
where we are in userland buffer when called multiple time.
COMPAT_NETBSD32's flavor of keo_put_events() is
netbsd32_kevent_put_events(). It did not honour the index parameter, which
caused invalid event data to be returned when userland requested more that 8
events. This caused many reliability problems, and the obvious startup crash
of dovecot log process when it accessed udata in the nineth event in its
buffer, which was NULL.

diffstat:

 sys/compat/netbsd32/netbsd32_event.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6ef39bea2303 -r 6be3f6ed3997 sys/compat/netbsd32/netbsd32_event.c
--- a/sys/compat/netbsd32/netbsd32_event.c      Tue Mar 18 07:18:22 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_event.c      Tue Mar 18 08:01:34 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_event.c,v 1.9 2011/05/23 21:34:47 joerg Exp $ */
+/*     $NetBSD: netbsd32_event.c,v 1.9.10.1 2014/03/18 08:01:34 msaitoh Exp $  */
 
 /*
  *  Copyright (c) 2005 The NetBSD Foundation.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_event.c,v 1.9 2011/05/23 21:34:47 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_event.c,v 1.9.10.1 2014/03/18 08:01:34 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -86,7 +86,7 @@
 
        for (i = 0, kev32 = events32; i < n; i++, kev32++, events++)
                netbsd32_from_kevent(events, kev32);
-       kev32 = (struct netbsd32_kevent *)eventlist;
+       kev32 = ((struct netbsd32_kevent *)eventlist) + index;
        return  copyout(events32, kev32, n * sizeof(*events32));
 }
 



Home | Main Index | Thread Index | Old Index