Home | History | Annotate | Download | only in common
History log of /src/sys/compat/common/vfs_syscalls_50.c
RevisionDateAuthorComments
 1.26  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.25  21-Jan-2020  pgoyette Split the compat_50 module into two, separating the QUOTA-related
stuff from the rest of the module. This allows loading of the
(main) compat_50 module on kernels that don't include ``options
QUOTA''.

Welcome to 9.99.40 !

Addresses PR kern/54875
 1.24  15-Dec-2019  tsutsui branches: 1.24.2;
Remove clause 3 and 4 leftovers from TNF licenses in more sources.

Confirmed by martin@ in PR/54760.
 1.23  18-Jun-2019  kamil branches: 1.23.2;
Drop unused retval pointer from do_sys_mknod{,at}()

No functional change intended.
 1.22  17-Jun-2019  christos Add QUOTA ifdef (Paul Goyette)
 1.21  17-Jun-2019  pgoyette Use tabs, not spaces, for indentation. NFCI
 1.20  17-Jun-2019  christos If we don't compile a kernel with QUOTA, we don't support the compat quota
syscalls. XXX: need to fix the modules build.
 1.19  27-Jan-2019  pgoyette Merge the [pgoyette-compat] branch
 1.18  05-Sep-2014  matt branches: 1.18.12; 1.18.18; 1.18.20;
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
 1.17  13-Mar-2012  elad branches: 1.17.2;
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.16  01-Feb-2012  dholland Change the syscall API for quotas over to the new non-proplib one.

- struct vfs_quotactl_args -> struct quotactl_args
- add sys/stdint.h to sys/quotactl.h for clean userland build
- install sys/quotactl.h in /usr/include
- update set lists for same
- add new marshalling code in libquota
- add new unmarshalling code in vfs_syscalls.c
- discard proplib interpreter code in vfs_quotactl.c
- add dispatching code for the 14 quotactl ops in vfs_quotactl.c
- mark the proplib quotactl syscall obsolete
- add a new syscall number for the new quotactl syscall
- change the name of the syscall to __quotactl()
- remove the decl of the old quotactl from quota/quotaprop.h
- add a decl of the new quotactl to sys/quotactl.h
- update the libc build
- update ktruss
- remove proplib marshalling code from libquota
- update copy of syscall table in gdb ppc sources
- hack rumphijack to accomodate new quotactl name (as I recall,
pooka wanted such a name change to simplify something, but I
don't really see what/how)

This change appears to require a kernel version bump for rumpish
reasons.
 1.15  29-Jan-2012  dholland Some further tidying for the COMPAT_50 quotactl code. Mostly cosmetic,
but also use PNBUF_GET() and PNBUF_PUT() for a path buffer instead of
malloc with M_TEMP.
 1.14  29-Jan-2012  dholland Remove the proplib goop from the COMPAT_50 code for the old quotactl;
use the new VFS_QUOTACTL instead.
 1.13  29-Jan-2012  dholland Rename static inline "helper" functions:
ufsclass2qtype -> quota_idtype_to_ufs
qtype2ufsclass -> quota_idtype_from_ufs

The reason for the direction of "ufs" changing is that the old names
were among the symbols using "ufs" to mean "fs-independent". So the
old names were for translating "ufsclass" (fs-independent quota id
type) to "qtype" (ufs-specific quota id type) and vice versa.

These functions are used in only two places, both of which are
inappropriate, so at some point they should probably be removed.
They're also identity transformations so not particularly helpful,
unless one were to make a careful and concerted effort to distinguish
the ufs quota code numbers from the fs-independent ones. This has not
been done and is probably impossible without support from a program
verifier, and maybe not even then.

They are static inline, so no compat concerns arise.

Also adjust the symbols they use to avoid <quota/quotaprop.h>.
 1.12  29-Jan-2012  dholland Add vfs_quotactl() in between the syscall and VFS_QUOTACTL. Call it
from the COMPAT_50 code as well as the current sys_quotactl instead
of going directly to VFS_QUOTACTL. Doesn't actually do anything yet.
 1.11  29-Jan-2012  dholland Change dqblk_to_quotaval() from quota1_subr.c to dqblk_to_quotavals(),
and pass in two single quotaval structs (for blocks and inodes)
instead of an array of (implicitly) QUOTA_NLIMITS quotaval structs
indexed by constants from quotaprop.h.

Note: because this code is used by COMPAT_50 as well as ufs, this
change requires a kernel version bump. (The code is also used by
edquota, but via .PATH so it's not ABI-sensitive there.)
 1.10  25-Nov-2011  dholland branches: 1.10.2;
Rename struct ufs_quota_entry -> struct quotaval.
 1.9  20-Nov-2011  dholland Reshuffle decls among the quota headers so everything is in the place
it should be:
- stuff for the proplib interface goes in <quota/quotaprop.h>
- stuff for userlevel only goes in <quota/quota.h>
- stuff shared between user and kernel goes in <sys/quota.h>

Note that <quota/quota.h> and <quota/quotaprop.h> are expected to be
moved or removed later on... one thing at a time.

Update include directives in other files as needed.
 1.8  24-Mar-2011  bouyer branches: 1.8.4;
Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
 1.7  06-Mar-2011  bouyer merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
 1.6  13-Jul-2010  pooka branches: 1.6.2; 1.6.4;
Don't leak kernel stack into userspace.
 1.5  09-Aug-2009  haad branches: 1.5.2; 1.5.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.4  26-Jan-2009  njoly Make all fstat(2) compat syscalls consistently use do_sys_fstat(),
instead of fd_getfile()/fd_putfile() dance.

ok by christos.
 1.3  11-Jan-2009  christos branches: 1.3.2; 1.3.4;
*utimes should allow NULL tvp.
 1.2  11-Jan-2009  christos merge christos-time_t
 1.1  29-Mar-2008  christos branches: 1.1.2; 1.1.6;
file vfs_syscalls_50.c was initially added on branch christos-time_t.
 1.1.6.3  11-Aug-2010  yamt sync with head.
 1.1.6.2  19-Aug-2009  yamt sync with head.
 1.1.6.1  04-May-2009  yamt sync with head.
 1.1.2.4  28-Dec-2008  christos for now don't bother with aio and lfs.
 1.1.2.3  09-Nov-2008  christos fix fhstat.
 1.1.2.2  26-Apr-2008  christos fix broken futimes.
 1.1.2.1  29-Mar-2008  christos new files
 1.3.4.3  03-Mar-2009  skrll Sync with HEAD.
 1.3.4.2  19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1  11-Jan-2009  skrll file vfs_syscalls_50.c was added on branch nick-hppapmap on 2009-01-19 13:17:17 +0000
 1.3.2.2  17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1  11-Jan-2009  mjf file vfs_syscalls_50.c was added on branch mjf-devfs2 on 2009-01-17 13:28:41 +0000
 1.5.4.2  21-Apr-2011  rmind sync with head
 1.5.4.1  05-Mar-2011  rmind sync with head
 1.5.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.6.4.1  15-Feb-2011  bouyer Implement COMPAT_50 quotactl(2)
 1.6.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.8.4.1  17-Apr-2012  yamt sync with head
 1.10.2.2  05-Apr-2012  mrg sync to latest -current.
 1.10.2.1  18-Feb-2012  mrg merge to -current.
 1.17.2.1  03-Dec-2017  jdolecek update from HEAD
 1.18.20.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.18.20.1  10-Jun-2019  christos Sync with HEAD
 1.18.18.2  22-Sep-2018  pgoyette #include "opt_compat_netbsd.h" for all sources that provide compat code.
 1.18.18.1  19-Mar-2018  pgoyette Initial pass at a COMPAT_50 module. More to come.
 1.18.12.1  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.23.2.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.23.2.1  18-Dec-2019  martin Pull up following revision(s) (requested by tsutsui in ticket #570):

sys/compat/netbsd32/netbsd32_compat_50_sysv.c: revision 1.3
sys/dev/raidframe/rf_compat50.h: revision 1.6
sys/arch/emips/emips/bus_space.c: revision 1.3
sys/compat/net/if.h: revision 1.5
sys/arch/emips/stand/common/bootinfo.c: revision 1.2
sys/compat/common/sysv_msg_50.c: revision 1.5
sys/compat/common/kern_time_30.c: revision 1.8
sys/arch/emips/stand/common/bootinfo.h: revision 1.2
sys/arch/ia64/include/bus.h: revision 1.4
sys/arch/ia64/ia64/bus_space.c: revision 1.2
sys/compat/common/sysv_shm_50.c: revision 1.5
sys/dev/ic/adw.h: revision 1.15
sys/compat/common/uipc_syscalls_50.c: revision 1.10
sys/arch/emips/ebus/flash_ebus.c: revision 1.22
sys/dev/ic/adv.h: revision 1.15
sys/dev/ic/adwmcode.c: revision 1.18
sys/dev/ic/advlib.c: revision 1.29
sys/arch/hpcarm/include/kloader.h: revision 1.3
sys/dev/usb/uberry.c: revision 1.16
sys/compat/common/sysv_sem_50.c: revision 1.5
sys/compat/netbsd32/netbsd32_compat_50.c: revision 1.43
sys/dev/ic/advlib.h: revision 1.21
sys/dev/ic/adv.c: revision 1.50
sys/compat/netinet6/in6_var.h: revision 1.5
sys/arch/hpc/stand/hpcboot/arm/arm_sa1100_asm.asm: revision 1.2
sys/arch/emips/include/loadfile_machdep.h: revision 1.3
sys/arch/emips/stand/common/prom_iface.c: revision 1.7
sys/dev/ic/adw.c: revision 1.56
sys/dev/ic/adwmcode.h: revision 1.12
sys/dev/ic/advmcode.c: revision 1.10
sys/arch/emips/ebus/ace_ebus.c: revision 1.22
sys/compat/netbsd32/netbsd32_compat_60.c: revision 1.5
sys/dev/raidframe/rf_compat50.c: revision 1.13
sys/arch/x68k/dev/intiovar.h: revision 1.15
sys/dev/usb/uipad.c: revision 1.8
sys/arch/zaurus/include/kloader.h: revision 1.3
sys/arch/emips/stand/common/bootxx.c: revision 1.2
sys/dev/ic/adwlib.h: revision 1.23
sys/dev/ic/adwlib.c: revision 1.44
sys/compat/netbsd32/netbsd32_compat_16.c: revision 1.3
sys/arch/amigappc/include/intr.h: revision 1.27
sys/arch/x68k/dev/mfp.c: revision 1.27
sys/arch/arm/at91/at91dbgu.c: revision 1.17
sys/dev/ic/advmcode.h: revision 1.7
sys/compat/ultrix/ultrix_exec.h: revision 1.7
sys/compat/common/vfs_syscalls_50.c: revision 1.24
sys/arch/mips/cavium/octeon_dma.c: revision 1.3
sys/arch/hpc/stand/hpcboot/arm/arm_pxa2x0_asm.asm: revision 1.2

Remove clause 3 and 4 from TNF licenses.
Ok'ed by martin@ in PR/54760.

Remove clause 3 and 4 leftovers from TNF licenses in more sources.
Confirmed by martin@ in PR/54760.
 1.24.2.1  25-Jan-2020  ad Sync with head.

RSS XML Feed