Home | History | Annotate | Download | only in netbsd32
History log of /src/sys/compat/netbsd32/netbsd32_event.c
RevisionDateAuthorComments
 1.14  29-Jul-2023  rin COMPAT_NETBSD32: No need to have compat_100_netbsd32_kevent_fetch_timeout.
NFCI.
 1.13  29-Jul-2023  rin COMPAT_NETBSD32: Catch up with sys___kevent100() addition.

XXX
Add epoll_* and memfd_create.
 1.12  05-Sep-2014  matt Don't use private as a variable name since it's reserved in C++
 1.11  24-Jun-2014  maxv Allocate directly KQ_NEVENTS bytes. Otherwise a user can panic the system.

ok christos@
 1.10  23-Jan-2014  manu branches: 1.10.2;
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.
 1.9  23-May-2011  joerg branches: 1.9.4; 1.9.10; 1.9.14; 1.9.16; 1.9.18; 1.9.24;
Update from GNU extension to C99 syntax for designated initializer
 1.8  23-Apr-2010  rmind branches: 1.8.2;
Replace M_IOV and some malloc(9)s with kmem(9), and while there:
- Fix invalid free (M_TEMP vs M_IOV) in do_sys_recvmsg(), spotted by jakllsch@.
Also, same fix in osf1_sys_sendmsg_xopen().
- Fix attempt to free non-allocated memory in error path in netbsd32___getfh30().
- Plug a memory leak in compat_43_netbsd32_orecvmsg().
 1.7  11-Jan-2009  christos branches: 1.7.4; 1.7.6;
merge christos-time_t
 1.6  29-Apr-2008  martin branches: 1.6.8; 1.6.14;
Convert to new 2 clause license
 1.5  21-Mar-2008  ad branches: 1.5.2; 1.5.4;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.4  20-Dec-2007  dsl branches: 1.4.6;
Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.3  10-Sep-2007  cube branches: 1.3.8; 1.3.12;
Remove 3rd clause and my name from all the licences which were only in my
name.
 1.2  11-Dec-2005  christos branches: 1.2.18; 1.2.32; 1.2.46; 1.2.48;
merge ktrace-lwp.
 1.1  23-Oct-2005  cube branches: 1.1.4; 1.1.6;
- Split sys_kevent into kevent1 so that it can be used by COMPAT_NETBSD32
code.

- To achieve COMPAT_NETBSD32 compatibility, introduce a parameter to
kevent1 that points to functions that do the actual copyin/copyout
operations. This is similar to what was done in FreeBSD by Paul Saab.

- Add the COMPAT_NETBSD32 definitions and hooks.
 1.1.6.2  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.1.6.1  23-Oct-2005  skrll file netbsd32_event.c was added on branch ktrace-lwp on 2005-11-10 14:01:21 +0000
 1.1.4.2  26-Oct-2005  yamt sync with head
 1.1.4.1  23-Oct-2005  yamt file netbsd32_event.c was added on branch yamt-vop on 2005-10-26 08:32:44 +0000
 1.2.48.2  09-Jan-2008  matt sync with HEAD
 1.2.48.1  06-Nov-2007  matt sync with HEAD
 1.2.46.1  02-Oct-2007  joerg Sync with HEAD.
 1.2.32.1  09-Oct-2007  ad Sync with head.
 1.2.18.5  24-Mar-2008  yamt sync with head.
 1.2.18.4  21-Jan-2008  yamt sync with head
 1.2.18.3  27-Oct-2007  yamt sync with head.
 1.2.18.2  21-Jun-2006  yamt sync with head.
 1.2.18.1  11-Dec-2005  yamt file netbsd32_event.c was added on branch yamt-lazymbuf on 2006-06-21 14:59:35 +0000
 1.3.12.1  02-Jan-2008  bouyer Sync with HEAD
 1.3.8.1  26-Dec-2007  ad Sync with head.
 1.4.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.4.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.4.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.5.4.3  11-Aug-2010  yamt sync with head.
 1.5.4.2  04-May-2009  yamt sync with head.
 1.5.4.1  16-May-2008  yamt sync with head.
 1.5.2.1  18-May-2008  yamt sync with head.
 1.6.14.2  04-Jan-2009  christos add new syscalls.
 1.6.14.1  29-Apr-2008  christos file netbsd32_event.c was added on branch christos-time_t on 2009-01-04 01:56:02 +0000
 1.6.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.7.6.2  31-May-2011  rmind sync with head
 1.7.6.1  30-May-2010  rmind sync with head
 1.7.4.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.8.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.9.24.1  30-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1090):
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.24
sys/compat/netbsd32/netbsd32_event.c: revision 1.11
Allocate directly KQ_NEVENTS bytes. Otherwise a user can panic the system.
ok christos@
 1.9.18.1  18-May-2014  rmind sync with head
 1.9.16.1  30-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1090):
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.24
sys/compat/netbsd32/netbsd32_event.c: revision 1.11
Allocate directly KQ_NEVENTS bytes. Otherwise a user can panic the system.
ok christos@
 1.9.14.2  03-Dec-2017  jdolecek update from HEAD
 1.9.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.10.2  30-Jun-2014  msaitoh Pull up following revision(s) (requested by maxv in ticket #1090):
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.24
sys/compat/netbsd32/netbsd32_event.c: revision 1.11
Allocate directly KQ_NEVENTS bytes. Otherwise a user can panic the system.
ok christos@
 1.9.10.1  18-Mar-2014  msaitoh 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.
 1.9.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.10.2.1  10-Aug-2014  tls Rebase.

RSS XML Feed