Home | History | Annotate | Download | only in common
History log of /src/sys/compat/common/vfs_syscalls_43.c
RevisionDateAuthorComments
 1.68  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.67  15-Aug-2021  christos - memset struct stat to avoid kernel memory disclosure of padded fields
(thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions
 1.66  24-Jun-2020  jdolecek remove special handling for symbolic links for COMPAT_43 lstat, it's
not necessary; this removes the only places in kernel which did namei
LOOKUP with LOCKPARENT

fixes diagnostic KASSERT() in namei() code

Reported-by: syzbot+628382ecf1438e53d08d@syzkaller.appspotmail.com
 1.65  27-Feb-2020  pgoyette Include all of the vfs syscalls in the syscall_package, not just oquota.

Should fix PR kern/55025

XXX pullup-9
 1.64  27-Jan-2019  pgoyette branches: 1.64.4; 1.64.6;
Merge the [pgoyette-compat] branch
 1.63  03-Sep-2018  riastradh Rename min/max -> uimin/uimax for better honesty.

These functions are defined on unsigned int. The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER! Some subsystems have

#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX. Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate. But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all. (Who knows, maybe in some cases integer
truncation is actually intended!)
 1.62  03-Dec-2017  christos branches: 1.62.2; 1.62.4;
Make code look the same, in particular zero out the rest of the directory
record.
XXX: pullup-8
 1.61  29-Jul-2017  riastradh Declare mountcompatnames in sys/vfs_syscalls.h to kill nested extern.
 1.60  28-Jul-2017  riastradh Fail, don't panic, on bad dirents from file system.

Controllable via puffs from userland.

From Ilja Van Sprundel.
 1.59  13-Jan-2017  christos branches: 1.59.8;
convert strcpy to a bounded copy to avoid compiler warnings, although the
reclen test prevents overflow.
 1.58  20-Aug-2016  mrg fill in the tv_nsec parts of the converted timespec in cvtstat().
 1.57  05-Sep-2014  matt branches: 1.57.2; 1.57.4;
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
 1.56  28-Jan-2014  christos branches: 1.56.4; 1.56.6;
Fix the compat-4.3 getdirentries call (pre d_type). This is used in NetBSD-0.9.
 1.55  21-Feb-2013  pgoyette branches: 1.55.2;
Move boottime50 and its associated sysctl into the compat module. As
noted on tech-kern. Should fix PR/47579.

OK christos@

Will request pull-up to 6.0 in a few days.
 1.54  19-Nov-2010  dholland branches: 1.54.8; 1.54.14; 1.54.18; 1.54.20;
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.53  24-Jun-2010  hannken 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.
 1.52  02-Mar-2010  pooka branches: 1.52.2;
fs_union.h is not used here anymore ... diudau
 1.51  08-Jan-2010  pooka branches: 1.51.2;
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
 1.50  17-Mar-2009  dyoung Add #include "opt_compat_netbsd.h" for COMPAT_09.
 1.49  26-Jan-2009  njoly branches: 1.49.2;
Make all fstat(2) compat syscalls consistently use do_sys_fstat(),
instead of fd_getfile()/fd_putfile() dance.

ok by christos.
 1.48  19-Nov-2008  ad 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
 1.47  24-Jun-2008  ad branches: 1.47.2; 1.47.4;
Replace references to getsock/getvnode.
 1.46  21-Mar-2008  ad branches: 1.46.4; 1.46.6; 1.46.8;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.45  20-Dec-2007  dsl branches: 1.45.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.44  08-Dec-2007  pooka branches: 1.44.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.43  08-Dec-2007  dsl ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
 1.42  04-Dec-2007  dsl Remove all the __P
 1.41  26-Nov-2007  pooka branches: 1.41.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.40  10-Oct-2007  ad branches: 1.40.4;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.39  17-Jul-2007  christos branches: 1.39.6; 1.39.8; 1.39.10;
MFSNAMELEN only belongs in compat.
 1.38  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.37  10-Mar-2007  dsl branches: 1.37.2; 1.37.4;
Use the support routines from kern_syscalls.c instead of rolling our own code.
 1.36  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35  09-Feb-2007  ad branches: 1.35.2;
Merge newlock2 to head.
 1.34  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.33  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.32  01-Mar-2006  yamt branches: 1.32.14; 1.32.16;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.31  11-Dec-2005  christos branches: 1.31.2; 1.31.4; 1.31.6;
merge ktrace-lwp.
 1.30  13-Sep-2005  christos compat code reorg.
 1.29  26-Feb-2005  perry branches: 1.29.4;
nuke trailing whitespace
 1.28  15-Aug-2004  mycroft branches: 1.28.4; 1.28.6;
Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
FS-specific checks littered throughout the code. This may be used later to
make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
 1.27  19-Nov-2003  christos - don't use MALLOC for non constant counts
- check malloc() size.
 1.26  19-Nov-2003  christos Don't include malloc.h if you are not going to use it.
 1.25  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.24  29-Jun-2003  fvdl branches: 1.24.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.23  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.22  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.21  25-Nov-2002  thorpej Avoid strict-alias warnings.
 1.20  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.19  14-Jun-2001  thorpej branches: 1.19.2; 1.19.4;
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.18  30-May-2001  mrg use _KERNEL_OPT.
 1.17  09-Apr-2001  jdolecek Change the first arg to fileops fo_stat routine to struct file *, adjust
callers and appropriate routines to cope. This makes fo_stat more
consistent with rest of fileops routines and also makes the fo_stat
match FreeBSD as an added bonus.
Discussed with Luke Mewburn on tech-kern@.
 1.16  07-Apr-2001  jdolecek Add new 'stat' fileop and call the stat function via f_ops rather
than directly.
For compat syscalls, also add necessary FILE_USE()/FILE_UNUSE().
Now that soo_stat() gets a proc arg, pass it on to usrreq function.
 1.15  29-Nov-2000  jdolecek branches: 1.15.2;
LKMify
 1.14  26-Jul-2000  pk lstat: since namei() returns an error (EISDIR) if there is no parent to lock,
retry the lookup without LOCKPARENT if that happens. This is safe, since
need to have LOCKPARENT only if the vnode is of type VLNK.
 1.13  30-Mar-2000  augustss Kill register declarations.
 1.12  05-May-1999  thorpej branches: 1.12.2;
Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
 1.11  30-Mar-1999  wrstuden branches: 1.11.4;
Explicitly mask mode returned in old stat structure to 16 bits. Also correct
comment (we're converting from a new to an old struct stat).
 1.10  01-Mar-1998  fvdl Merge with Lite2 + local changes
 1.9  19-Feb-1998  thorpej Include the UNION option header.
 1.8  16-Oct-1997  christos add stat12 compatibility calls and rename ostat to stat43
 1.7  10-Oct-1997  fvdl u_long -> off_t, I missed the big endian case. From Juergen Hannken-Illjes
 1.6  10-Oct-1997  fvdl Add getdirentries backward compat syscall. Provide common function to
signal cookie overflow during emulated getdents and friends.
 1.5  06-Jun-1997  christos branches: 1.5.4;
PR/3701: Arne H. Juul: olstat can't stat "/", because it still pretended
that symlinks don't have inodes.
 1.4  14-Mar-1996  christos Fix compiler warnings
 1.3  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.2  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.1  24-Jun-1995  christos - Extracted all compat routines from the kern directory and moved here.
- Created compat_util.c and compat_util.h to be used by the compatibility
modules, so they don't duplicate the same code.
- Added prototypes to the stackgap allocation routines.
 1.5.4.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.12.2.3  21-Apr-2001  bouyer Sync with HEAD
 1.12.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.12.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.15.2.7  11-Dec-2002  thorpej Sync with HEAD.
 1.15.2.6  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.15.2.5  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.15.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.15.2.3  21-Jun-2001  nathanw Catch up to -current.
 1.15.2.2  09-Apr-2001  nathanw Catch up with -current.
 1.15.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.19.4.1  18-Sep-2001  fvdl Various changes to make cloning devices possible:

* Add an extra argument (struct vnode **) to VOP_OPEN. If it is
not NULL, specfs will create a cloned (aliased) vnode during
the call, and return it there. The caller should release and
unlock the original vnode if a new vnode was returned. The
new vnode is returned locked.

* Add a flag field to the cdevsw and bdevsw structures.
DF_CLONING indicates that it wants a new vnode for each
open (XXX is there a better way? devprop?)

* If a device is cloning, always call the close entry
point for a VOP_CLOSE.


Also, rewrite cons.c to do the right thing with vnodes. Use VOPs
rather then direct device entry calls. Suggested by mycroft@

Light to moderate testing done an i386 system (arch doesn't matter
though, these are MI changes).
 1.19.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.24.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.24.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.24.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.24.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.24.2.3  25-Aug-2004  skrll Sync with HEAD.
 1.24.2.2  03-Aug-2004  skrll Sync with HEAD
 1.24.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.28.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.28.4.1  29-Apr-2005  kent sync with -current
 1.29.4.8  24-Mar-2008  yamt sync with head.
 1.29.4.7  21-Jan-2008  yamt sync with head
 1.29.4.6  07-Dec-2007  yamt sync with head
 1.29.4.5  27-Oct-2007  yamt sync with head.
 1.29.4.4  03-Sep-2007  yamt sync with head.
 1.29.4.3  26-Feb-2007  yamt sync with head.
 1.29.4.2  30-Dec-2006  yamt sync with head.
 1.29.4.1  21-Jun-2006  yamt sync with head.
 1.31.6.1  22-Apr-2006  simonb Sync with head.
 1.31.4.1  09-Sep-2006  rpaulo sync with head
 1.31.2.1  31-Dec-2005  yamt adapt some random parts of kernel to uio_vmspace.
 1.32.16.2  10-Dec-2006  yamt sync with head.
 1.32.16.1  22-Oct-2006  yamt sync with head
 1.32.14.2  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.32.14.1  18-Nov-2006  ad Sync with head.
 1.35.2.2  07-May-2007  yamt sync with head.
 1.35.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.37.4.1  11-Jul-2007  mjf Sync with head.
 1.37.2.4  20-Aug-2007  ad Sync with HEAD.
 1.37.2.3  17-Jun-2007  ad - Increase the number of thread priorities from 128 to 256. How the space
is set up is to be revisited.
- Implement soft interrupts as kernel threads. A generic implementation
is provided, with hooks for fast-path MD code that can run the interrupt
threads over the top of other threads executing in the kernel.
- Split vnode::v_flag into three fields, depending on how the flag is
locked (by the interlock, by the vnode lock, by the file system).
- Miscellaneous locking fixes and improvements.
 1.37.2.2  27-May-2007  ad Sync with head.
 1.37.2.1  13-May-2007  ad - Pass the error number and residual count to biodone(), and let it handle
setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.
 1.39.10.1  14-Oct-2007  yamt sync with head.
 1.39.8.2  09-Jan-2008  matt sync with HEAD
 1.39.8.1  06-Nov-2007  matt sync with HEAD
 1.39.6.3  09-Dec-2007  jmcneill Sync with HEAD.
 1.39.6.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.39.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.40.4.2  27-Dec-2007  mjf Sync with HEAD.
 1.40.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.41.2.2  26-Dec-2007  ad Sync with head.
 1.41.2.1  08-Dec-2007  ad Sync with head.
 1.44.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.45.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.45.6.2  29-Jun-2008  mjf Sync with HEAD.
 1.45.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.46.8.1  27-Jun-2008  simonb Sync with head.
 1.46.6.3  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.46.6.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.46.6.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.46.4.3  11-Aug-2010  yamt sync with head.
 1.46.4.2  11-Mar-2010  yamt sync with head
 1.46.4.1  04-May-2009  yamt sync with head.
 1.47.4.3  28-Apr-2009  skrll Sync with HEAD.
 1.47.4.2  03-Mar-2009  skrll Sync with HEAD.
 1.47.4.1  19-Jan-2009  skrll Sync with HEAD.
 1.47.2.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.49.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.51.2.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.51.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.52.2.2  05-Mar-2011  rmind sync with head
 1.52.2.1  03-Jul-2010  rmind sync with head
 1.54.20.3  19-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1483):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.54.20.2  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1469):
sys/compat/common/vfs_syscalls_12.c: revision 1.30
sys/compat/common/vfs_syscalls_43.c: revision 1.56
sys/compat/sys/dirent.h: revision 1.3
It is wishful thinking that vn_readdir will return dirent12 structures.
--
Fix the compat-4.3 getdirentries call (pre d_type). This is used in NetBSD-0.9.
--
add a struct for the 4.3BSD struct direct
 1.54.20.1  27-Aug-2016  bouyer Pull up following revision(s) (requested by mrg in ticket #1400):
sys/compat/common/vfs_syscalls_43.c: revision 1.58
fill in the tv_nsec parts of the converted timespec in cvtstat().
 1.54.18.3  03-Dec-2017  jdolecek update from HEAD
 1.54.18.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.54.18.1  25-Feb-2013  tls resync with head
 1.54.14.4  19-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1483):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.54.14.3  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1469):
sys/compat/common/vfs_syscalls_12.c: revision 1.30
sys/compat/common/vfs_syscalls_43.c: revision 1.56
sys/compat/sys/dirent.h: revision 1.3
It is wishful thinking that vn_readdir will return dirent12 structures.
--
Fix the compat-4.3 getdirentries call (pre d_type). This is used in NetBSD-0.9.
--
add a struct for the 4.3BSD struct direct
 1.54.14.2  27-Aug-2016  bouyer Pull up following revision(s) (requested by mrg in ticket #1400):
sys/compat/common/vfs_syscalls_43.c: revision 1.58
fill in the tv_nsec parts of the converted timespec in cvtstat().
 1.54.14.1  14-Mar-2013  riz branches: 1.54.14.1.2;
Pull up following revision(s) (requested by pgoyette in ticket #837):
sys/compat/common/kern_time_50.c: revision 1.25
sys/kern/init_sysctl.c: revision 1.195
sys/kern/init_main.c: revision 1.447
sys/compat/common/compat_util.h: revision 1.23
sys/compat/common/compat_mod.h: revision 1.1
sys/compat/common/compat_mod.c: revision 1.16
sys/compat/common/compat_mod.c: revision 1.17
sys/compat/common/compat_mod.c: revision 1.18
sys/compat/common/vfs_syscalls_43.c: revision 1.55
Move boottime50 and its associated sysctl into the compat module. As
noted on tech-kern. Should fix PR/47579.
OK christos@
Will request pull-up to 6.0 in a few days.
Wrap sysctl_teardown(&compat_clog) with the appropriate #if defined()s
remove empty #if
 1.54.14.1.2.3  19-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1483):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.54.14.1.2.2  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1469):
sys/compat/common/vfs_syscalls_12.c: revision 1.30
sys/compat/common/vfs_syscalls_43.c: revision 1.56
sys/compat/sys/dirent.h: revision 1.3
It is wishful thinking that vn_readdir will return dirent12 structures.
--
Fix the compat-4.3 getdirentries call (pre d_type). This is used in NetBSD-0.9.
--
add a struct for the 4.3BSD struct direct
 1.54.14.1.2.1  27-Aug-2016  bouyer Pull up following revision(s) (requested by mrg in ticket #1400):
sys/compat/common/vfs_syscalls_43.c: revision 1.58
fill in the tv_nsec parts of the converted timespec in cvtstat().
 1.54.8.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.55.2.1  18-May-2014  rmind sync with head
 1.56.6.2  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.56.6.1  27-Aug-2016  bouyer Pull up following revision(s) (requested by mrg in ticket #1240):
sys/compat/common/vfs_syscalls_43.c: revision 1.58
fill in the tv_nsec parts of the converted timespec in cvtstat().
 1.56.4.2  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.56.4.1  27-Aug-2016  bouyer branches: 1.56.4.1.4;
Pull up following revision(s) (requested by mrg in ticket #1240):
sys/compat/common/vfs_syscalls_43.c: revision 1.58
fill in the tv_nsec parts of the converted timespec in cvtstat().
 1.56.4.1.4.1  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.57.4.1  20-Mar-2017  pgoyette Sync with HEAD
 1.57.2.3  28-Aug-2017  skrll Sync with HEAD
 1.57.2.2  05-Feb-2017  skrll Sync with HEAD
 1.57.2.1  05-Oct-2016  skrll Sync with HEAD
 1.59.8.4  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.59.8.3  15-Aug-2021  martin Pull up following revision(s) (requested by christos in ticket #1691):

sys/compat/common/vfs_syscalls_43.c: revision 1.67
sys/compat/common/vfs_syscalls_50.c: revision 1.26
sys/compat/common/vfs_syscalls_30.c: revision 1.42

- memset struct stat to avoid kernel memory disclosure of padded fields
(thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions
 1.59.8.2  10-Dec-2017  snj Pull up following revision(s) (requested by christos in ticket #418):
sys/compat/common/vfs_syscalls_12.c: revision 1.35
sys/compat/common/vfs_syscalls_43.c: revision 1.62
Make code look the same, in particular zero out the rest of the directory
record.
 1.59.8.1  09-Aug-2017  snj Pull up following revision(s) (requested by spz in ticket #193):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
From Ilja Van Sprundel.
 1.62.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.62.4.1  10-Jun-2019  christos Sync with HEAD
 1.62.2.4  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.62.2.3  17-Apr-2018  pgoyette Finish separating the compat_09 and compat_43 stuff
 1.62.2.2  17-Apr-2018  pgoyette First pass at compat modules for 4.3BSD, NetBSD-0.9, and NetBSD-1.0

XXX Still need to deal with the sysctl stuff and other code shared
XXX between 09 and 43
 1.62.2.1  31-Mar-2018  pgoyette Only need to #include sysctl.h once
 1.64.6.1  29-Feb-2020  ad Sync with head.
 1.64.4.3  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.64.4.2  15-Aug-2021  martin Pull up following revision(s) (requested by christos in ticket #1337):

sys/compat/common/vfs_syscalls_43.c: revision 1.67
sys/compat/common/vfs_syscalls_50.c: revision 1.26
sys/compat/common/vfs_syscalls_30.c: revision 1.42

- memset struct stat to avoid kernel memory disclosure of padded fields
(thanks Trend Micro for the report)
- use do_fhstat
- consistency in argument order of compat functions
 1.64.4.1  27-Feb-2020  martin Pull up following revision(s) (requested by pgoyette in ticket #741):

sys/compat/common/vfs_syscalls_43.c: revision 1.65

Include all of the vfs syscalls in the syscall_package, not just oquota.
Should fix PR kern/55025

XXX pullup-9

RSS XML Feed