Commit Graph

334 Commits

Author SHA1 Message Date
pooka c99c5d9840 Don't leak kernel stack into userspace. 2010-07-13 15:38:15 +00:00
hannken 1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
drochner 690a7f09c9 -fix internal use of sigwaitinfo(2) by sigwait(3): The former returns
the signal number now, as required by POSIX. The latter should just
 return 0 on success. Fixes a mysql problem reported by Kurt Schreiner.
-document the new behavior of sigwaitinfo and sigtimedwait
-retain non-POSIX behavior for NetBSD-5 binary compatibility -- the fix
 would likely not be polled into the .0-branches, and having 5.0.x and
 5.x behave differently would be confusing. Besides that, it was
 documented in the manpage all the time.
2010-05-30 19:31:39 +00:00
njoly 4f2ea8f3c9 Add a new clock_gettime1() function that holds most of the
clock_gettime syscall code (except for the copyout). Adjust all
corresponding syscalls to make use of it.
2010-04-08 11:51:13 +00:00
njoly 0876f873dd Move most clock_getres syscall code, except for coypout call, to a new
clock_getres1() function which can be used by emulations. Adjust all
clock_getres syscalls to now make of use it.
2010-04-03 17:20:05 +00:00
pooka 934159ae4a Reset sendsig_sigcontext_vec at fini to avoid having it point at
garbage and to allow re-init of the module (if DIAGNOSTIC).
2010-03-05 16:55:56 +00:00
he 7a30544200 When implementing "read directory", when there are too many empty entries
in a row, and we need to try to read the next block, and have passed a
non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie
buffer before re-doing VOP_READDIR, so that we don't leak memory.
This fix is similar to nfs_serv.c revisions 1.115 + 1.124.

This should fix the long-standing problem observed by e.g. using Linux-
emulated programs to take backup of servers, which is one of the problems
which were reported in PR#42661.

Thanks to pooka@ for the hints for traversing the VOP* layer.
2010-03-03 08:20:38 +00:00
pooka 18c92f1166 fs_union.h is not used here anymore ... diudau 2010-03-02 14:23:39 +00:00
pooka 654415b2b7 Get rid of last "easy" kernel symbols starting with __:
__assert -> kern_assert
__sigtimedwait1 -> sigtimedwait1
__wdstart -> wdstart1

The rest are MD and/or shared with userspace, so they will require
a little more involvement than what is available for this quick
"ride the 5.99.24 bump" action.
2010-01-19 22:28:30 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
njoly a82811a116 Remove SYS_compat_50_mq_timedreceive/SYS_compat_50_mq_timedsend
duplicate entries.

Fix a KASSERT when unloading the compat kernel module.
2009-12-21 15:13:13 +00:00
mrg 97c80e8ff0 replace mips:elf_check_itp() and ELFNAME2(netbsd32,probe_noteless) that
it's based upon with a common compat_elf_check_interp().

tested on MALTA64 and sparc64.
2009-12-14 04:09:38 +00:00
matt e110dba586 Merge from matt-nb5-mips64 2009-12-14 00:47:10 +00:00
rmind eaddd78061 Use lwp_getpcb() in compat code, clean from struct user. 2009-11-23 00:46:06 +00:00
mbalmer 0ae57f90dd more s/the the/the/ 2009-11-22 19:09:15 +00:00
rmind 1283950019 - selcommon/pollcommon: drop redundant l argument.
- Use cached curlwp->l_fd, instead of p->p_fd.
- Inline selscan/pollscan.
2009-11-11 09:48:50 +00:00
rmind 4c1098f541 do_sys_wait(): fix previous by checking for ru != NULL. Noticed by
Onno van der Linden.  Also, remove redundant arguments (seems that
was_zombie was not used since rev 1.177 ?).
2009-11-04 21:23:02 +00:00
yamt bb529e553e compat_50_sys_aio_suspend:
- fix the buffer size.
	- use kmem_alloc instead of kmem_zalloc for buffers which we will
	  overwrite soon.
2009-10-12 23:41:51 +00:00
rmind c9a5a18df3 mq_timedsend/mq_timedreceive: timeout value is absolute, not relative.
While here, drop unecessary (since fdesc API changes) lwp_t arguments.

Bug reported by Stathis Kamperis, thanks!
2009-10-05 23:49:46 +00:00
matt 7bb407d6e3 Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for you.
2009-08-15 23:39:35 +00:00
matt baf57f2df6 #include "opt_execfmt.h" and only compile innards if EXEC_AOUT is defined. 2009-08-13 03:53:13 +00:00
haad 5200b9b492 Add enum uio_seg argument to do_sys_mknod and do_sys_mkdir so these functions
can be called from kernel, too.

Change needed for zfs device node creation, until we have propoer devfs.

Oked by ad@.
2009-08-09 22:49:00 +00:00
rmind 029f6c41a7 - Use #ifdef AIO, instead of #ifdef notyet. Not a solution, but at
least gets it working for MONOLITHIC kernel.
- Similarily add #ifdef MQUEUE for mqueue compat.
- Amend TNF license to be 2-clause.  Approved by <christos>.
2009-07-19 02:41:27 +00:00
dholland effcf1af5c Convert 67 namei call sites to use namei_simple, in these functions:
check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
2009-06-29 05:08:15 +00:00
christos 2b1b4bc6ef Move the internal poll/select related API's to use timespec instead
of timeval (rides the uvm bump).
2009-03-29 19:21:19 +00:00
gmcgarry 65b9855fd5 Replace gcc initialisers with c99 designated initialisers. 2009-03-26 22:22:14 +00:00
dyoung a3bde60951 #include "opt_compat_netbsd.h" for COMPAT_20. 2009-03-17 00:08:10 +00:00
dyoung 1290eea0cb Add #include "opt_compat_netbsd.h" for COMPAT_09. 2009-03-17 00:01:54 +00:00
nakayama c99ea852e4 - fix copyout size in CLOCKCTL_O?ADJTIME.
- add missing break in CLOCKCTL_NTP_ADJTIME.
2009-02-22 13:06:58 +00:00
njoly 3e5b27ff8e Make all fstat(2) compat syscalls consistently use do_sys_fstat(),
instead of fd_getfile()/fd_putfile() dance.

ok by christos.
2009-01-26 13:00:04 +00:00
christos d3baa5ffd2 compile into nothing if not compat 50. 2009-01-21 16:12:20 +00:00
christos 143e6033a9 Provide compatibility for pre-christos-time_t sysv sysctls. 2009-01-19 19:39:41 +00:00
njoly 25a76c08aa Convert linux/linux32 wait(4) to use a compat50 rusage structure. 2009-01-17 22:28:52 +00:00
njoly 39f5db2b54 In rusage_to_rusage50() function, fix memcpy size to include last
struct member (ru_nivcsw) which was missing.

ok by christos.
2009-01-14 22:50:12 +00:00
martin 90daabb504 Add a few missing includes, so the ifdefs work as expected. 2009-01-13 20:47:47 +00:00
christos 91306aae6f fix lutimes. 2009-01-11 21:23:22 +00:00
christos 52ef6203ff *utimes should allow NULL tvp. 2009-01-11 20:46:53 +00:00
tsutsui 348730301a <sys/syscallargs.h> requires <sys/sched.h> for cpuset_t. 2009-01-11 12:19:14 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
ad 11c98a4abf PR port-amd64 modules/compat missing symbols on amd64
Also, test for compat_??_machdep.c so we don't have to grow more ifdefs
in the makefile.
2008-11-20 09:22:57 +00:00
cegger 89ba8d828a make this compile (for next68k) 2008-11-19 23:31:13 +00:00
ad c4d65a7c5e Additionally, set emul_netbsd_object=NULL after detaching it. 2008-11-19 21:29:25 +00:00
ad 5473327d60 compat_modcmd: emul_netbsd_object will be NULL if no exec has taken place
between load and unload of the compat module.
2008-11-19 21:27:54 +00:00
ad 92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
martin 42cab0447c Make it compile 2008-11-16 15:17:05 +00:00
ad 57de28fac5 - Move some more compat code into sys/compat.
- Split 4.3BSD ifioctl stuff into its own file.
- Remove some ifdefs that include small fragments of vfs compat code
  which are difficult to relocate elsewhere.
2008-11-14 23:10:57 +00:00
ad c5122072aa _KERNEL_OPT 2008-11-14 13:10:33 +00:00
ad a00bd89dab Replace references to getsock/getvnode. 2008-06-24 11:18:14 +00:00
tsutsui d7d2a525b1 Include <sys/sched.h> before <sys/syscallargs.h> for cpuset_t. 2008-06-17 16:17:21 +00:00
mrg c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00