Home | History | Annotate | Download | only in common
History log of /src/sys/compat/linux/common/linux_file.c
RevisionDateAuthorComments
 1.133  01-Oct-2024  riastradh linux_sys_copy_file_range: Nix unused variable new_size.
 1.132  01-Oct-2024  riastradh linux_sys_copy_file_range: Avoid more UB arithmetic overflow.

Need to check the input offset too, not just the output offset.

No functional change in the non-UB case.
 1.131  01-Oct-2024  riastradh linux_sys_copy_file_range: Avoid UB arithmetic overflow.

No functional change intended in the non-UB case.
 1.130  01-Oct-2024  riastradh sys/compat/linux/common/linux_file.c: KNF

No functional change intended.
 1.129  01-Oct-2024  riastradh linux_sys_copy_file_range: Prune dead branch.

kmem_alloc(KM_SLEEP) can't fail.

No functional change intended.
 1.128  01-Oct-2024  riastradh sys/compat/linux/common/linux_file.c: Fix blank lines and comments.

No functional change intended.
 1.127  01-Oct-2024  riastradh sys/compat/linux/common/linux_file.c: KNF in function heads.

No functional change intended.
 1.126  01-Oct-2024  riastradh sys/compat/linux/common: Nix trailing whitespace, and one blank line.

No functional change intended.
 1.125  28-Sep-2024  christos Linux GSoC-2024: renameat2, clone3, sync_file_range, syncfs (Shivraj Jamgade)
 1.124  29-Jun-2024  christos From gsoc 2024: Implement faccessat2 and getcpu (Shivraz)
 1.123  10-Jul-2023  christos Add memfd_create(2) from GSoC 2023 by Theodore Preduta
 1.122  25-Nov-2021  ryo add support COMPAT_LINUX32 for aarch64
 1.121  23-Sep-2021  ryo add support COMPAT_LINUX for aarch64
 1.120  20-Sep-2021  thorpej Add preadv(2) and pwritev(2) system calls to COMPAT_LINUX and COMPAT_LINUX32.
 1.119  07-Sep-2021  riastradh sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.118  23-May-2020  ad branches: 1.118.2;
Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.117  09-Nov-2019  jdolecek add dummy implementation of linux fallocate() which just returns EOPNOTSUPP;
this is needed so that glibc falls back to emulation and apps behaving
properly, since EOPNOTSUPP is a documented and expected return code, but
ENOSYS is not

right now there are no filesystems in NetBSD tree supporting the fallocate
VOP, so no point trying to map this to a native call

supposed to help with problem reported in
https://mail-index.netbsd.org/tech-kern/2019/11/03/msg025641.html
 1.116  18-Jun-2019  kamil branches: 1.116.2;
Drop unused retval pointer from do_sys_mknod{,at}()

No functional change intended.
 1.115  01-Mar-2015  njoly branches: 1.115.10; 1.115.18;
Add Linux specific fcntl(2) commands. Support F_DUPFD_CLOEXEC.
 1.114  09-Nov-2014  maxv branches: 1.114.2;
Do not uselessly include <sys/malloc.h>.
 1.113  25-Jun-2014  njoly branches: 1.113.2;
Add support for more open flags that have a native equivalent
(O_NONBLOCK, O_DIRECT and O_NOFOLLOW).
Translate native EFTYPE error (missing on Linux) to expected ELOOP;
when opening symlinks with flag O_NOFOLLOW.
 1.112  01-Jun-2014  njoly Cleanup pipe(2) flags, now that native handle them.
 1.111  18-May-2014  njoly Simplify dup3 emulation to call dodup() directly instead of
sys_dup2()+fd_set_exclose(). While here, add some error conditions.
 1.110  06-May-2014  njoly linux_off_t -> off_t in pwrite() syscall args comment.
 1.109  04-May-2014  njoly Fix pread/pwrite syscalls which need a 64bit offset argument.
 1.108  08-Dec-2013  njoly branches: 1.108.2;
Sprinkle a few more linux_umode_t where appropriate.
Reduce diffs between archs.
 1.107  08-Dec-2013  njoly Add missing syscall argument fd in comment.
 1.106  18-Nov-2013  chs implement the *at() syscalls.
bring the unimplemented syscall list up to date.
 1.105  24-Sep-2013  njoly Add utimensat(2) for compat linux.
 1.104  14-Oct-2011  hannken branches: 1.104.2; 1.104.12; 1.104.16;
Change the vnode locking protocol of VOP_GETATTR() to request at least
a shared lock. Make all calls outside of file systems respect it.

The calls from file systems need review.

No objections from tech-kern.
 1.103  14-Apr-2011  christos move dup3 to a more appropriate place because pipe is "special". Gotta love
linux.
 1.102  10-Apr-2011  christos We have O_CLOEXEC now
 1.101  19-Nov-2010  dholland branches: 1.101.2;
Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
 1.100  21-Sep-2010  chs implement O_DIRECTORY as standardized in POSIX-2008,
for both native and linux emulations.
this fixes the rest of PR 43695.
 1.99  01-Jul-2010  rmind Remove pfind() and pgfind(), fix locking in various broken uses of these.
Rename real routines to proc_find() and pgrp_find(), remove PFIND_* flags
and have consistent behaviour. Provide proc_find_raw() for special cases.
Fix memory leak in sysctl_proc_corename().

COMPAT_LINUX: rework ptrace() locking, minimise differences between
different versions per-arch.

Note: while this change adds some formal cosmetics for COMPAT_DARWIN and
COMPAT_IRIX - locking there is utterly broken (for ages).

Fixes PR/43176.
 1.98  09-Aug-2009  haad branches: 1.98.2; 1.98.4;
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@.
 1.97  11-Jan-2009  christos merge christos-time_t
 1.96  28-Apr-2008  martin branches: 1.96.2; 1.96.8;
Remove clause 3 and 4 from TNF licenses
 1.95  24-Apr-2008  ad branches: 1.95.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.94  23-Apr-2008  ad - Use cdev_tty().
- Tweak locking.
 1.93  21-Mar-2008  ad branches: 1.93.2; 1.93.4;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.92  02-Feb-2008  dsl branches: 1.92.6;
Fix the linux32 emulations of fcntl() locking.
The 64bit linux emulation versions can't be used because the lock structure
alignment and field sizes all differ.
Since there need to be 4 different versions of the linux struct flock, and
amd64 kernel needs 3 of them compiled in, rather than replicating the same
code block twice more, move the body of the code into a few #defines
that can be expanded with the correct types in the linux[32]_sys_fcntl[64]()
functions.
Should fix problems running progams like skype running under linux32
emulation on amd64.
 1.91  15-Jan-2008  njoly compat linux (and linux32) uid16 functions cleanup and fixes.

- Move uid16 functions to their own file linux_uid16.c, included by
needed archs (arm, i386 and m68k).
- Add new MI types linux_{u,g}id16_t.
- Add macros to handle linux_uid16_t and uid_t conversions.
- Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with
bad sizes given to copyout when linux_sys_getres{uid,gid} are used.
- Update arm syscall table to use more uid16 functions.
 1.90  20-Dec-2007  dsl 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.89  08-Dec-2007  pooka branches: 1.89.4;
Remove cn_lwp from struct componentname. curlwp should be used
from on. The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
 1.88  08-Dec-2007  dsl ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.87  04-Dec-2007  dsl Remove all the __P
 1.86  26-Nov-2007  pooka branches: 1.86.2;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.85  16-Nov-2007  njoly Cleanup. Remove a few linux syscalls definitions, now identical to
native ones (with stackgap and ALT_CHECK_xxx removal). No functional
changes expected.
 1.84  19-Oct-2007  njoly branches: 1.84.2;
Add compat_linux and exec_linux_elf lkm support for amd64:
- Add needed COMPAT_OSSAUDIO to GENERIC.
- Add missing includes needed by linux_syscallargs.h.
- Add lkm building.
 1.83  12-May-2007  dsl branches: 1.83.6; 1.83.8; 1.83.12;
Split the fcntl locking code out from its copyin/out.
Use to avoid all the stackgap stuff in compat code.
 1.82  22-Apr-2007  dsl Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
- which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
search for absolute pathnames in the emulation root, if that fails it will
retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
the real root is returned instead (matching the behaviour of emul_lookup,
but being a cheap comparison here) so that programs that scan "../.."
looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
 1.81  10-Mar-2007  dsl branches: 1.81.2;
Update all the compat stuff to not use the 'stackgap' for processing
sys_stat() and friends, instead use do_sys_stat() and do_sys_fstat()
that write the answer into a kernel buffer (on stack) that can be
converted to the correct form and written the userspace.
I've test compiled a few kernels, and tested i386 netbsd1.6 ls.
Given I think I've fixed some bugs, it might be 50-50 with new ones.
 1.80  09-Mar-2007  ad branches: 1.80.2;
- Make the proclist_lock a mutex. The write:read ratio is unfavourable,
and mutexes are cheaper use than RW locks.
- LOCK_ASSERT -> KASSERT in some places.
- Hold proclist_lock/kernel_lock longer in a couple of places.
 1.79  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.78  17-Feb-2007  dsl Acquire proclist_lock across the calls to p_find() and pg_find().
 1.77  09-Feb-2007  ad branches: 1.77.2;
Merge newlock2 to head.
 1.76  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.75  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.74  25-Sep-2006  pavel Replace homegrown tests for FIFO (... & S_IFIFO) by S_ISFIFO. The old code
was "correct" by luck - we don't have any other file type whose S_IF* bits
in sys/stat.h overlap with S_IFIFO.

Originally discovered by Paul Stoeber in OpenBSD.
 1.73  23-Jul-2006  ad branches: 1.73.4; 1.73.6;
Use the LWP cached credentials where sane.
 1.72  14-May-2006  elad integrate kauth.
 1.71  11-Dec-2005  christos branches: 1.71.4; 1.71.6; 1.71.8; 1.71.10; 1.71.12;
merge ktrace-lwp.
 1.70  19-Aug-2005  christos 64 bit inode changes.
 1.69  29-May-2005  christos branches: 1.69.2;
- sprinkle const.
- add XXXUNCONST to the emul_find() pbuf argument free'ing. XXX: this needs
an api change.
- avoid variable shadowing.
 1.68  16-May-2005  fvdl Add *xattr functions (they all return EOPNOTSUPP).
 1.67  03-May-2005  manu First work on COMPAT_LINUX/amd64
Process startup and dynamiclinking work, but processes hang due to
Linux arch_prctl(2) not being really supported yet.
 1.66  10-Mar-2005  christos Add nanosecond handling on the stat and stat64 code for the i386.
 1.65  26-Feb-2005  perry nuke trailing whitespace
 1.64  12-Dec-2004  abs branches: 1.64.2; 1.64.4;
Fix comments slighly
 1.63  13-Aug-2004  jdolecek on Linux, unlink() fails with EISDIR if the target is directory,
rather than EPERM; to emulate this properly, translate the error to EISDIR
if the target patch exists and points to a directory

this fixes the 'ant clean' problem reported by Marc Recht on current-users@
with SuSE 9.1 libraries
 1.62  09-Aug-2003  jdolecek branches: 1.62.2;
fix linux_sys_p{read|write}() to actually call correct syscall after
arg massage, i.e. sys_p{read|write} as appropriate; up to now, the functions
called sys_{read|write}() by mistake
 1.61  29-Jun-2003  fvdl branches: 1.61.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.60  29-Jun-2003  jdolecek properly FILE_USE/FILE_UNUSE descriptor in linux_sys_fcntl()
adresses PR kern/21628 by Wolfgang Solfrank
 1.59  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.58  19-Mar-2003  dsl Alternative pid/proc allocater, removes all searches associated with pid
lookup and allocation, and any dependency on NPROC or MAXUSERS.
NO_PID changed to -1 (and renamed NO_PGID) to remove artificial limit
on PID_MAX.
As discussed on tech-kern.
 1.57  27-Feb-2003  yamt make compat_linux struct file interlock friendly.
 1.56  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.55  17-Dec-2002  simonb Use the already-filled-in-but-not-used native syscall args in
linux_sys_mknod().
 1.54  11-Dec-2002  jdolecek linux_sys_mknod(): if creating device file (i.e. !fifo case), mask
the passed device number to only contain lower 16 bits; older glibc
appears to pass some junk in upper bits sometimes, resulting in incorrect
device entries being created

Problem initially analyzed by Thor Lancelot Simon.
 1.53  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.52  13-May-2002  simonb branches: 1.52.2; 1.52.4;
Remove an unreachable "break" after a return statement.
 1.51  10-Apr-2002  christos implement getdents64; my full java tree builds now.
 1.50  24-Mar-2002  jdolecek add explicit comment a FILE_USE() is not needed here
 1.49  24-Mar-2002  jdolecek Fix problem with assumption non-socket == vnode in F_{G,S}ETOWN different way
(revisions 1.47 & 1.48 effectively backed off):
* for all but vnodes, just fallback to sys_fcntl(); assumming
state of support for F_SETOWN/F_GETOWN and even hardcoding it here is
not right (e.g. rev. 1.47 had this incorrect for DTYPE_PIPE)
* fallback to sys_fcntl() also for vnodes which don't represent tty
* don't need to use FILE_{,UN}USE() here, the code won't block while
using the pointer
* add/fix some comments
 1.48  23-Mar-2002  christos correct placement for FILE_UNUSE [from Izumi Tsutsui]
 1.47  22-Mar-2002  christos - obey FILE_USE and FILE_UNUSE
- don't assume that non sockets point to vnodes.
 1.46  16-Mar-2002  christos make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.45  15-Feb-2002  christos - add a real linux_sys___sysctl because the mib numbers are different.
implement only the kernel version getting entries.
- make the signal conversion functions consistent; dest is arg 1.
- make linux_fakedev deal with block and char devices differently.
- add linux_sys_ugetrlimit, and flesh out the regular get/setrlimit so
that they work properly.
- add linux_mmap2 [untested].
- bump kernel to 2.4.18, and make the date be valentine's day :-)
- linux_sys_*stat64 family was totally busted. Fix it.

tested only on i386.

Status:
gdb, telnet, work
jdk-1.4.0 extractor works, jdk still coredumps.

christos
 1.44  14-Jan-2002  bjh21 Crude first cut at ARMLinux binary compatibility. Successfully runs
"/emul/linux/bin/echo hello, world", dynamically linked.
 1.43  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.42  22-Sep-2001  manu Fixes for mips support
 1.41  04-Sep-2001  jdolecek branches: 1.41.2;
change LINUX_F_SETFL so that SIGIO handling for sockets
matches more closely
add support for NEW_PIPE to the SIGIO hack
 1.40  22-Jul-2001  wiz seperate -> separate
 1.39  16-Jun-2001  manu branches: 1.39.2;
Linux does not send a SIGIO to the write end of a socket,
neither it does send any SIGIO for pipes. If async I/O
was requested, we keep the SS_ASYNC in struct socket flag
set, but we clear SB_ASYNC flags on the sending buffer
(for socket), and on the sending and the receiving buffer
(for pipes).

Because we do not alter to SS_ASYNC in struct socket,
the Linux process keeps a consistent view of async I/O
status if it attemps to read the async flag (SS_ASYNC)

This async I/O problem does matters, since some Linux
a programs such as the JDK request async I/O on pipes,
but they fail if they happen to get a SIGIO to the write
end of the pipe.
 1.38  14-Jun-2001  thorpej Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.37  22-Jan-2001  jdolecek branches: 1.37.2;
use CHECK_ALT_SYMLINK() for lstat(2)
don't call stackgap_init() for pwrite(2) and pread(2), it's not necessary
 1.36  22-Jan-2001  jdolecek Use CHECK_ALT_SYMLINK() instead CHECK_ALT_EXISTS() where appropriate.
This addresses kern/11757.
 1.35  19-Jan-2001  manu Added support for powerpc Linux compatibility
 1.34  29-Dec-2000  fvdl Do alternate path checks for link(2).
 1.33  27-Dec-2000  fvdl Use CHECK_ALT_* for chown and lchown, missed in my previous commit.
Get *id16 calls right; most can be passed through directly, but
some need the 16->32 check for -1 values.
 1.32  21-Dec-2000  thorpej Only include the 16-bit chown/fchown/lchown stuff if on i386 or m68k.
This is a little ugly, but hey, so is Linux.
 1.31  18-Dec-2000  fvdl Add seperate entries for 16 bit uid/gid calls, so that border cases
like 0xffff can be handled better (not done yet).
 1.30  01-Dec-2000  jdolecek add e_path (emulation path) to struct emul, which replaces emulation-specific
*_emul_path variables

change macros CHECK_ALT_{CREAT|EXIST} to use that, 'root' doesn't need
to be passed explicitly any more and *_CHECK_ALT_{CREAT|EXIST} are removed
change explicit emul_find() calls in probe functions to get the emulation
path from the checked exec switch entry's emulation

remove no longer needed header files

add e_flags and e_syscall to struct emul; these are unsed and empty for now
 1.29  29-Aug-2000  sommerfeld Emulation stackgap sanity checks, based partly on fixes from
FreeBSD-SA00:42.

Change stackgap_alloc to bounds-check the allocation vs. the stack
gap, returning NULL if there isn't room for the allocation.

Change emul_find() to check for a NULL return from stackgap_alloc()
and convert that into ENAMETOOLONG.

Reorder various emulation syscalls so that all *_CHECK_ALT_{EXIST,CREAT}
calls (which turn into emul_find() under the covers come *after* small,
fixed-size stackgap_alloc() calls.

Clean up ibcs2 {get,set}groups.
 1.28  05-Dec-1999  tron branches: 1.28.4;
Add proper stub code to make emulation of Linux's pread(2) and pwrite(2)
work. Fixes PR kern/8945 by Dave Sainty.
 1.27  09-Feb-1999  christos branches: 1.27.2; 1.27.8; 1.27.14;
const poisoning.
 1.26  07-Oct-1998  erh The siginfo include line is not needed here anymore.
 1.25  04-Oct-1998  fvdl Assign my copyright to TNF. Merge with others were appropriate.
Regen syscall files after script change.
 1.24  03-Oct-1998  christos Attempt to fix the mess.
 1.23  01-Oct-1998  erh Split compat/linux/linux_file.c into common and multi-architechture parts.
 1.22  14-Feb-1998  kleink * Use sys___posix_{chown,fchown}() instead of sys_{chown,fchown}().
* Change reference from sys_posix_rename() to sys___posix_rename().
 1.21  20-Oct-1997  thorpej Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2). This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
 1.20  19-Oct-1997  mycroft Fix bogosity in mknod(2) translation.
 1.19  16-Oct-1997  christos check for st_nlink overflow
 1.18  05-Sep-1997  kleink Add missing preparation of F_GETLK parameters in linux_sys_fcntl(); fixes PR
port-i386/4083 from Matthias Scheler <tron@lyssa.owl.de>, but vastly cleaned
up as previously suggested by myself.
 1.17  27-Jun-1997  kleink branches: 1.17.4;
Use sys_posix_rename() instead of sys_rename() as it's the behaviour of the
native implementation.
 1.16  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.15  20-May-1996  fvdl Update list of Linux syscalls and implement the ones that are likely to be
used and doable.
 1.14  05-Apr-1996  christos Prototyping changes.
 1.13  08-Oct-1995  fvdl Work around calling the NetBSD fcntl(F_{G,S}ETOWN) for now; it is too
restrictive to implement the Linux equivalent (and perhaps too restrictive
overall).
 1.12  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.11  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.10  07-Sep-1995  fvdl Fix some bugs & typing problems.
 1.9  27-Aug-1995  fvdl Add a hook for MD ioctl calls, plus a couple of more changes to make
svgalib binaries work on the i386
 1.8  14-Aug-1995  mycroft Rearrange #includes.
 1.7  24-Jul-1995  fvdl mkdir() has 2 arguments.. fixes PR 1248 (from Brad Spencer)
 1.6  03-Jul-1995  fvdl Fix totally bogus implementation of a few fcntl() calls. I think I'll go
live on a deserted island now..
 1.5  24-Jun-1995  christos Use compat_util.[ch].
 1.4  22-Jun-1995  fvdl * Changed to use generic ELF code from kern/exec_elf.c (which was taken
from the svr4 exec code plus the linux compat mods)
* Include file change
* Add multicast sockopts (from John Brezak)
 1.3  04-Apr-1995  mycroft Fix conversion of `type' and `whence' values in struct flock.
 1.2  05-Mar-1995  fvdl Added a few more system calls.
More consistent alternate root file semantics throughout.
 1.1  28-Feb-1995  fvdl Added Linux compat code.
 1.17.4.1  06-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.27.14.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.27.8.4  11-Feb-2001  bouyer Sync with HEAD.
 1.27.8.3  05-Jan-2001  bouyer Sync with HEAD
 1.27.8.2  08-Dec-2000  bouyer Sync with HEAD.
 1.27.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.27.2.1  09-Sep-2000  he Pull up revision 1.29 (requested by simonb):
More carefully check length of user-supplied data, in particular
make sure we don't overrun the available stack gap in stack gap
allocations.
 1.28.4.2  30-Mar-2001  he Pull up revision 1.34 (via patch, requested by fvdl):
Add some required Linux emulation bits to support the Linux
version of VMware.
 1.28.4.1  30-Aug-2000  sommerfeld Pull up:
syssrc/sys/compat/common/compat_util.c 1.16
syssrc/sys/compat/hpux/hpux_file.c 1.14
syssrc/sys/compat/ibcs2/ibcs2_misc.c 1.52
syssrc/sys/compat/ibcs2/ibcs2_stat.c 1.16
syssrc/sys/compat/linux/common/linux_file.c 1.29
syssrc/sys/compat/linux/common/linux_misc_notalpha.c 1.58
syssrc/sys/compat/svr4/svr4_stat.c 1.40
syssrc/sys/compat/svr4/svr4_stream.c 1.40,1.41

Approved by thorpej and jhawk.

Emulation stackgap sanity checks, based partly on fixes from
FreeBSD-SA00:42.

Change stackgap_alloc to bounds-check the allocation vs. the stack
gap, returning NULL if there isn't room for the allocation.

Change emul_find() to check for a NULL return from stackgap_alloc()
and convert that into ENAMETOOLONG.

Reorder various emulation syscalls so that all *_CHECK_ALT_{EXIST,CREAT}
calls (which turn into emul_find() under the covers come *after* small,
fixed-size stackgap_alloc() calls.

Clean up ibcs2 {get,set}groups.

Add range checks to svr4_stream.c
 1.37.2.14  20-Dec-2002  nathanw LWPify new mkfifo code.
 1.37.2.13  19-Dec-2002  thorpej Sync with HEAD.
 1.37.2.12  17-Sep-2002  nathanw Catch up to -current.
 1.37.2.11  20-Jun-2002  nathanw Catch up to -current.
 1.37.2.10  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.37.2.9  17-Apr-2002  nathanw Catch up to -current.
 1.37.2.8  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.37.2.7  28-Feb-2002  nathanw Catch up to -current.
 1.37.2.6  14-Nov-2001  nathanw Catch up to -current.
 1.37.2.5  26-Sep-2001  nathanw Catch up to -current.
Again.
 1.37.2.4  21-Sep-2001  nathanw Catch up to -current.
 1.37.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.37.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.37.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.39.2.7  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.39.2.6  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.39.2.5  16-Mar-2002  jdolecek Catch up with -current.
 1.39.2.4  11-Feb-2002  jdolecek Sync w/ -current.
 1.39.2.3  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.39.2.2  13-Sep-2001  thorpej Update the kqueue branch to HEAD.
 1.39.2.1  03-Aug-2001  lukem update to -current
 1.41.2.2  01-Oct-2001  fvdl Catch up with -current.
 1.41.2.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.52.4.1  01-May-2005  tron Pull up revision 1.62 via patch (requested by bad in ticket #5762):
fix linux_sys_p{read|write}() to actually call correct syscall after
arg massage, i.e. sys_p{read|write} as appropriate; up to now, the functions
called sys_{read|write}() by mistake
 1.52.2.1  16-May-2002  gehenna Replace the direct-access to devsw table with calling devsw API.
 1.61.2.9  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.61.2.8  01-Apr-2005  skrll Sync with HEAD.
 1.61.2.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.61.2.6  18-Dec-2004  skrll Sync with HEAD.
 1.61.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.61.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.61.2.3  25-Aug-2004  skrll Sync with HEAD.
 1.61.2.2  03-Aug-2004  skrll Sync with HEAD
 1.61.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.62.2.1  15-Aug-2004  tron Pull up revision 1.63 (requested by jdolecek in ticket #764):
on Linux, unlink() fails with EISDIR if the target is directory,
rather than EPERM; to emulate this properly, translate the error to EISDIR
if the target patch exists and points to a directory
this fixes the 'ant clean' problem reported by Marc Recht on current-users@
with SuSE 9.1 libraries
 1.64.4.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.64.2.1  29-Apr-2005  kent sync with -current
 1.69.2.9  24-Mar-2008  yamt sync with head.
 1.69.2.8  04-Feb-2008  yamt sync with head.
 1.69.2.7  21-Jan-2008  yamt sync with head
 1.69.2.6  07-Dec-2007  yamt sync with head
 1.69.2.5  27-Oct-2007  yamt sync with head.
 1.69.2.4  03-Sep-2007  yamt sync with head.
 1.69.2.3  26-Feb-2007  yamt sync with head.
 1.69.2.2  30-Dec-2006  yamt sync with head.
 1.69.2.1  21-Jun-2006  yamt sync with head.
 1.71.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.71.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.71.8.2  11-Aug-2006  yamt sync with head
 1.71.8.1  24-May-2006  yamt sync with head.
 1.71.6.1  01-Jun-2006  kardel Sync with head.
 1.71.4.1  09-Sep-2006  rpaulo sync with head
 1.73.6.2  10-Dec-2006  yamt sync with head.
 1.73.6.1  22-Oct-2006  yamt sync with head
 1.73.4.3  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.73.4.2  18-Nov-2006  ad Sync with head.
 1.73.4.1  17-Nov-2006  ad Checkpoint work in progress.
 1.77.2.4  17-May-2007  yamt sync with head.
 1.77.2.3  07-May-2007  yamt sync with head.
 1.77.2.2  12-Mar-2007  rmind Sync with HEAD.
 1.77.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.80.2.2  27-May-2007  ad Sync with head.
 1.80.2.1  13-Mar-2007  ad Sync with head.
 1.81.2.1  11-Jul-2007  mjf Sync with head.
 1.83.12.2  18-Nov-2007  bouyer Sync with HEAD
 1.83.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.83.8.3  23-Mar-2008  matt sync with HEAD
 1.83.8.2  09-Jan-2008  matt sync with HEAD
 1.83.8.1  06-Nov-2007  matt sync with HEAD
 1.83.6.4  09-Dec-2007  jmcneill Sync with HEAD.
 1.83.6.3  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.83.6.2  21-Nov-2007  joerg Sync with HEAD.
 1.83.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.84.2.4  18-Feb-2008  mjf Sync with HEAD.
 1.84.2.3  27-Dec-2007  mjf Sync with HEAD.
 1.84.2.2  08-Dec-2007  mjf Sync with HEAD.
 1.84.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.86.2.2  26-Dec-2007  ad Sync with head.
 1.86.2.1  08-Dec-2007  ad Sync with head.
 1.89.4.2  19-Jan-2008  bouyer Sync with HEAD
 1.89.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.92.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.92.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.92.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.93.4.1  18-May-2008  yamt sync with head.
 1.93.2.2  01-Nov-2008  christos Sync with head.
 1.93.2.1  29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.95.2.5  09-Oct-2010  yamt sync with head
 1.95.2.4  11-Aug-2010  yamt sync with head.
 1.95.2.3  19-Aug-2009  yamt sync with head.
 1.95.2.2  04-May-2009  yamt sync with head.
 1.95.2.1  16-May-2008  yamt sync with head.
 1.96.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.96.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.96.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.98.4.3  21-Apr-2011  rmind sync with head
 1.98.4.2  05-Mar-2011  rmind sync with head
 1.98.4.1  03-Jul-2010  rmind sync with head
 1.98.2.2  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.98.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.101.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.104.16.1  18-May-2014  rmind sync with head
 1.104.12.2  03-Dec-2017  jdolecek update from HEAD
 1.104.12.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.104.2.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.108.2.1  10-Aug-2014  tls Rebase.
 1.113.2.1  17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.114.2.1  06-Apr-2015  skrll Sync with HEAD
 1.115.18.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.115.10.1  21-Jun-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1836):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.116.2.1  03-Aug-2022  martin Pull up following revision(s), all via patch
(requested by riastradh in ticket #1487):

sys/compat/linux/arch/i386/linux_machdep.c: revision 1.168
sys/compat/sunos/sunos_misc.c: revision 1.177
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.52
sys/compat/common/kern_resource_43.c: revision 1.23
sys/compat/netbsd32/netbsd32_conv.h: revision 1.46
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.35
sys/compat/common/vfs_syscalls_12.c: revision 1.38
sys/compat/ultrix/ultrix_misc.c: revision 1.126
sys/compat/common/kern_sig_43.c: revision 1.37
sys/compat/linux/common/linux_mtio.c: revision 1.8
sys/compat/freebsd/freebsd_misc.c: revision 1.34
sys/compat/freebsd/freebsd_machdep.c: revision 1.5
sys/compat/linux/common/linux_olduname.c: revision 1.67
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.44
sys/compat/freebsd/freebsd_sched.c: revision 1.23
sys/compat/ossaudio/ossaudio.c: revision 1.84
sys/compat/sys/time_types.h: revision 1.6
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.51
sys/compat/common/ieee80211_20.c: revision 1.7
sys/compat/linux/common/linux_file.c: revision 1.119
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.34
sys/compat/netbsd32/netbsd32_wait.c: revision 1.25
sys/compat/linux32/common/linux32_time.c: revision 1.38
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.33
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.52
sys/compat/linux32/arch/amd64/linux32_machdep.c: revision 1.46
sys/compat/netbsd32/netbsd32_compat_12.c: revision 1.36
sys/compat/ultrix/ultrix_ioctl.c: revision 1.39
sys/compat/linux/common/linux_misc.c: revision 1.252
sys/compat/linux/common/linux_hdio.c: revision 1.19
sys/compat/sunos/sunos_ioctl.c: revision 1.71
sys/compat/linux/common/linux_sched.c: revision 1.79
sys/compat/common/kern_info_43.c: revision 1.40
sys/compat/linux32/common/linux32_exec_elf32.c: revision 1.20
sys/compat/linux/common/linux_socket.c: revision 1.153
sys/compat/linux/arch/amd64/linux_machdep.c: revision 1.60
sys/compat/common/vfs_syscalls_43.c: revision 1.68
sys/compat/linux/arch/powerpc/linux_exec_powerpc.c: revision 1.25
sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.9
sys/compat/common/kern_time_50.c: revision 1.37
sys/compat/netbsd32/netbsd32_compat_20.c: revision 1.42
sys/compat/linux/common/linux_cdrom.c: revision 1.28
sys/compat/linux/arch/m68k/linux_machdep.c: revision 1.43
sys/compat/common/kern_info_09.c: revision 1.22
sys/compat/linux32/common/linux32_resource.c: revision 1.12
sys/compat/linux/common/linux_oldolduname.c: revision 1.67
sys/compat/common/if_media_80.c: revision 1.4
sys/compat/linux/arch/alpha/linux_osf1.c: revision 1.5
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.8
sys/compat/linux32/common/linux32_signal.c: revision 1.21
sys/compat/common/kern_sig_13.c: revision 1.22
sys/compat/sunos32/sunos32_ioctl.c: revision 1.36
sys/compat/netbsd32/netbsd32_compat_43.c: revision 1.62
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.23
sys/compat/netbsd32/netbsd32_time.c: revision 1.56
sys/compat/linux/common/linux_signal.c: revision 1.84
sys/compat/netbsd32/netbsd32_signal.c: revision 1.52
sys/compat/sunos32/sunos32_misc.c: revision 1.85
sys/compat/linux/common/linux_time.c: revision 1.40
sys/compat/linux/common/linux_fdio.c: revision 1.14
sys/compat/common/vfs_syscalls_30.c: revision 1.43

sys/compat: Memset zero before copyout.

Just in case of uninitialized padding which would lead to kernel
stack disclosure. If the compiler can prove the memset redundant
then it can optimize it away; otherwise better safe than sorry.
 1.118.2.1  17-Dec-2020  thorpej Add suppport for Linux preadv(2) and pwritev(2). Same as native, except
for the silly way that the offset argument is passed in.

RSS XML Feed