Commit Graph

1111 Commits

Author SHA1 Message Date
dsl e21a34c25e Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
  the item itself.
In the places where the caller specifies a function and a structure
  address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
  sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
  AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
  fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
2012-06-02 21:36:41 +00:00
pgoyette 5f373d7584 Ooopppsss! sysctl nodes created during module load time cannot be
PERMANENT
2012-05-31 16:08:14 +00:00
pgoyette 77814c5e08 When built as module, track sysctl node creations, and destroy them on
module exit.
2012-05-31 15:07:29 +00:00
christos fa636f0de9 add a task process subdirectory for emul linux 2012-05-28 13:16:10 +00:00
yamt 4f2ae9432c don't block on pager map for read-ahead.
reduce code duplication.
2012-05-22 14:20:39 +00:00
riastradh 5ecfdf8dea Implement a genfs_rename abstraction.
First major step in incrementally adapting all the file systems to a
saner rename VOP protocol.
2012-05-08 23:53:26 +00:00
christos 3a2a43f2ca - match format with the linux map printing
- fix PK_32 map printing for linux processes
should fix 32 bit java stack guard setting.
2012-05-06 03:13:11 +00:00
rmind f1d428af19 - Replace some malloc(9) uses with kmem(9).
- G/C M_IPMOPTS, M_IPMADDR and M_BWMETER.
2012-04-30 22:51:27 +00:00
chs 8306a9eddf change vflushbuf() to take the full FSYNC_* flags.
translate FSYNC_LAZY into PGO_LAZY for VOP_PUTPAGES() so that
genfs_do_io() can set the appropriate io priority for the I/O.
this is the first part of addressing PR 46325.
2012-04-29 22:53:59 +00:00
njoly 8687f711a5 uid mismatch for file flags changes is expected to fail with EPERM not
EACCES.
2012-03-30 18:24:08 +00:00
drochner 364a06bb29 remove KAME IPSEC, replaced by FAST_IPSEC 2012-03-22 20:34:37 +00:00
elad 0c9d8d15c9 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.
2012-03-13 18:40:26 +00:00
dholland 59b296daa7 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.
2012-02-01 05:34:38 +00:00
dholland 569f4e677f Remove the extra op argument to VFS_QUOTACTL() - the op is now stored
purely in the args structure.

This change requires a kernel version bump.
2012-01-29 07:14:38 +00:00
dholland 77f413b088 Introduce struct vfs_quotactl_args. Use it.
This change uglifies vfs_quotactl some in order to make room for
moving operation-specific but FS-independent logic out of ufs_quota.c.

Note: this change requires a kernel version bump.
2012-01-29 06:36:06 +00:00
dholland bfbd24c61d Move the proplib-based quota command dispatching (that is, the code
that knows the magic string names for the allowed actions) out of
UFS-specific code and to fs-independent code.

This introduces QUOTACTL_* operation codes and changes the signature
of VFS_QUOTACTL() again for compile safety.

Note: this change requires a kernel version bump.
2012-01-29 06:34:57 +00:00
dholland b6ede1b91e Move the code for iterating over the multiple RPC calls in a quota
proplib XML packet to vfs_quotactl.c out of sys/ufs/ufs.

Add a dummy extra arg to VFS_QUOTACTL for compile safety.

Note: this change requires a kernel version bump.
2012-01-29 06:32:43 +00:00
christos a6338b1483 only set CANTRCVMORE if no error. 2011-12-21 15:27:50 +00:00
christos 87d8a6fadb - Eliminate so_nbio and turn it into a bit SS_NBIO in so_state.
- Introduce MSG_NBIO so that we can turn non blocking i/o on a per call basis
- Use MSG_NBIO to fix the XXX: multi-threaded issues on the fifo sockets.
- Don't set SO_CANTRCVMORE, if we were interrupted (perhaps do it for all
  errors?).
2011-12-20 23:56:28 +00:00
christos 8ddb33d2b3 don't produce different output if we are super user. 2011-12-19 03:02:31 +00:00
christos dce4e18daf provide a root entry if one was not found. 2011-12-16 20:45:07 +00:00
christos cab865c68e PR/45700: use dostatvfs instead of grabbing the latest cached copy of
struct statvfs from the mount point, so that chroot is handled properly.
2011-12-15 20:55:02 +00:00
njoly 973e485533 Start making fs read(2) fail with EISDIR if the implementation does
not allow read on directories (kernfs, rumpfs, ptyfs and sysvbfs).
Adjust man page accordingly, and add a small corresponding vfs
testcase.
2011-12-12 19:11:21 +00:00
yamt 5594ed8178 typo in a comment 2011-10-31 12:49:32 +00:00
hannken 961731268e VOP_GETATTR() needs a shared lock at least. 2011-10-16 12:26:16 +00:00
uebayasi 5430efd94b Trim unused headers. 2011-10-09 14:34:39 +00:00
christos 44905f123b define PROCFS_MAXNAMLEN and use it. 2011-09-27 01:23:59 +00:00
christos a3c0501888 define KERNFS_MAXNAMLEN and use it.` 2011-09-27 01:23:05 +00:00
christos 7004654c0f define FDESC_MAXNAMLEN and use it. 2011-09-27 01:22:12 +00:00
manu 38de55a5dd Fix the build that was broken by struct lwp *updateproc reference in
RUMP-visible code. Instead of checking that updateproc (aka ioflush,
aka syncer) will not sleep in PUFFS code, I check for any kernel thread:
after all none of them are designed to hang awaiting for a remote filesystem
operation to complete.
2011-09-23 01:57:32 +00:00
christos 3454671372 Restore updateproc because rump uses it until we figure out how to remove it
for good.
2011-09-22 21:58:07 +00:00
jmcneill e656d3b0f6 PR# kern/45021: Please support /emul/linux/proc/version
Add /proc/version for procfs with -o linux. The version reported depends
on the emulation type of the calling process:

$ cat /proc/version
NetBSD version 5.99.55 (netbsd@localhost) (gcc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120)) NetBSD 5.99.55 (GENERIC) #39: Sun Sep  4 09:10:05 EDT 2011

$ /emul/linux/bin/cat /proc/version
Linux version 2.6.18 (linux@localhost) (gcc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120)) #0 Wed Mar 3 03:03:03 PST 2010

$ /emul/linux32/bin/cat /proc/version
Linux version 2.6.18 (linux32@localhost) (gcc version 4.1.3 20080704 prerelease (NetBSD nb2 20081120)) #0 Wed Mar 3 03:03:03 PST 2010
2011-09-04 17:32:10 +00:00
matt 2c6de4b409 Use the new UVM_KMF_COLORMATCH flag to get a congruent mappings of the user
buffer so we can use unmanaged mappings (pmap_kenter_pa/pmap_kremove).
2011-09-01 16:55:08 +00:00
rmind 8c8246dce6 genfs_do_directio: acquire the lock of page owner for now and fix PR/45177.
Will be revisited to avoid locking dance and be more efficient, e.g. we can
use unmanaged-mapping by allocating with colouring in mind.
2011-08-31 22:16:54 +00:00
plunky 7f3d4048d7 NULL does not need a cast 2011-08-31 18:31:02 +00:00
jmcneill c252921e46 both LINUX_USRSTACK32 and USRSTACK32 need to be defined for linux32 2011-08-28 18:48:14 +00:00
yamt cead2083b6 fix a botch in PRIxVADDR change (rev.1.38) 2011-07-26 13:18:55 +00:00
hannken 68ad0cad04 Layer_fsync(): when syncing a device node call spec_fsync() to clean the
layer node before descending to the lower file system.

Adresses PR kern/38762 panic: vwakeup: neg numoutput
2011-07-11 08:34:01 +00:00
hannken 49511bba25 Change VOP_BWRITE() to take a vnode as its first argument like all other
VOPs do.  Layered file systems no longer have to modify bp->b_vp and run
into trouble when an async VOP_BWRITE() uses the wrong vnode.

- change all occurences of VOP_BWRITE(bp) to VOP_BWRITE(bp->b_vp, bp).
- remove layer_bwrite().
- welcome to 5.99.55

Adresses PR kern/38762 panic: vwakeup: neg numoutput

No objections from tech-kern@.
2011-07-11 08:27:37 +00:00
christos 281288535e From Aleksey Cheusov: Don't make it easy for compromised systems to bypass
ASLR protections by providing the mapping addresses of programs to everyone.
2011-06-23 17:06:38 +00:00
rmind e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
hannken 64ee4fdf9f Remove no longer needed flag FSYNC_VFS /* fsync: via FSYNC_VFS() */. 2011-04-27 09:46:27 +00:00
hannken 87522af425 Change vflushbuf() to return an error if a synchronous write fails.
Welcome to 5.99.51.
2011-04-26 11:32:38 +00:00
matt 2420b39245 Move some #ifdefs to prevent a code path change when DEBUG .vs. !DEBUG
Solves problem an assert firing when using NFS on MIPS.
2011-04-21 06:27:17 +00:00
rmind 23e8e926b4 G/C unused speedup_syncer() mechanism and thus simplify some code.
Update some comments to reflect the reality.  No actual changes to
the (used) syncer logic.

OK ad@
2011-04-18 15:53:04 +00:00
rmind c71a09f0c6 - Use offsetof() in VOPARG_OFFSETOF() instead of re-implementing it.
- Remove VDESC_NOMAP_VPP and VDESC_VPP_WILLRELE.
- Remove VRELEL_NOINACTIVE and VRELEL_ONHEAD.
2011-04-03 01:19:35 +00:00
bouyer 063f96f3c2 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.
2011-03-06 17:08:10 +00:00
joerg 48717cfc00 Refactor ps_strings access. Based on PK_32, write either the normal
version or the 32bit compat layout in execve1. Introduce a new function
copyin_psstrings for reading it back from userland and converting it to
the native layout. Refactor procfs to share most of the code with the
kern.proc_args sysctl handler.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-04 22:25:24 +00:00
hannken 11f5c95248 Layer_revoke(): change previous to always take an extra reference on the
lower vnode before passing down the VOP_REVOKE().  This way VOP_REVOKE()
on a layered file system always inactivates and closes the lower vnode.

Should finally fix PR kern/43456.
2011-01-13 10:28:38 +00:00
hannken b89d0815aa Add layer_revoke() that adjusts the lower vnode use count to be at least as
high as the upper vnode count before passing down the VOP_REVOKE().

This way vclean() check for active (vp->v_usecount > 1) vnodes gets it right.

Should fix PR kern/43456.
2011-01-10 11:11:03 +00:00