Commit Graph

4274 Commits

Author SHA1 Message Date
elad 6e4a854552 Support multiple entry types. Direct, indirect, and file can now be
combined in the signatures file using commas.
2005-08-02 16:14:10 +00:00
elad f73e4c7b31 Simplify previous commit. 2005-07-29 22:57:34 +00:00
elad 3c0a7f641b Use real executed program in logs instead of the script that was executed.
For example, this used to give false logs of matching fingerprint for
foo.sh while foo.sh don't have an entry, and the program executed (and
matching the fingerprint) is the interpreter - /bin/sh.
2005-07-29 22:37:11 +00:00
elad 753edff337 #ifdef VERIFIED_EXEC 2005-07-29 14:49:00 +00:00
christos 5d719b264e In the SIGIO case, only check that we are the controlling tty if we are a
session leader.
2005-07-25 17:32:03 +00:00
peter cea97248d3 Fix an off-by-one in checking the return value of strlcpy(9).
Reviewed by atatat.
2005-07-23 23:34:52 +00:00
cube 875e65cda6 Introduce __sigtimedwait1 which will help adding COMPAT_NETBSD32 support
for __sigtimedwait(2).
2005-07-23 22:02:13 +00:00
cube 2844b7b432 Split sys_timer_create, sys_timer_gettime and sys_timer_settime so they
can be easily used by netbsd32 code.

XXX Meanwhile, introduce a copyinout_t type that matches the prototype of
XXX copyin(9) and copyout(9).  Its logical place would be in systm.h, near
XXX the definition of copyin, but, well, see the comment.
2005-07-23 18:54:07 +00:00
erh 5a521f35e0 Fix a null vp panic when creating a file at veriexec strict level 3. 2005-07-23 18:19:51 +00:00
yamt b7bfe82866 update file timestamps for nfsd loaned-read and mmap.
PR/25279.  discussed on tech-kern@.
2005-07-23 12:18:41 +00:00
junyoung 06e730ed76 More cosmetic changes. 2005-07-17 23:53:57 +00:00
junyoung a226b79f42 Make code prettier. 2005-07-17 23:49:49 +00:00
christos 9213de1869 catch up with verified exec defopt changes. 2005-07-17 05:22:34 +00:00
christos 1510fe1543 defopt verified_exec. 2005-07-16 22:47:18 +00:00
simonb bf458186f4 White space KNF nit. 2005-07-15 03:59:31 +00:00
christos 190b607a00 Add missing const. Reported by Allar Ritter in tech-kern. 2005-07-13 04:24:26 +00:00
cube 355bcba766 Split sys_execve() and add execve1() that does most of the work, and takes
as an argument a function that will retrieve an element of the pointer
arrays in user space.  This allows COMPAT_NETBSD32 to share the code for
the emulated version of execve(2), and fixes various issues that came from
the slow drift between the two implementations.

Note:  when splitting up a syscall function, I'll use two different ways
       of naming the resulting helper function.  If it stills does
       copyin/out operations, it will be named <syscall>1().  If it does
       not (as it was the case for get/setitimer), it will be named
       do<syscall>.
2005-07-11 20:15:26 +00:00
cube 08fd92bac5 Split sys_getitimer and sys_setitimer to make it possible to share the
relevant code with the COMPAT_NETBSD32 version, and make the latter use
the new functions.

This fixes netbsd32_setitimer() which had drifted from the native syscall
and did not work properly anymore.
2005-07-11 19:50:42 +00:00
thorpej f5546fc71e Move the rest of the extattr stuff into vfs_xattr.c 2005-07-10 22:10:00 +00:00
thorpej 9c6adeffa0 Regen:
Add Linux-compatible {,fl}{get,set,list}xattr() system call interface
to the VFS extended attribute subsystem.
2005-07-10 22:05:24 +00:00
thorpej ccbebfaaf1 Add Linux-compatible {,fl}{get,set,list}xattr() system call interface
to the VFS extended attribute subsystem.
2005-07-10 22:04:20 +00:00
cube cbb77bc452 The comment listing the arguments of fsync_range(2) wrongly described
"length" as an int.  It is an off_t.
2005-07-10 14:26:02 +00:00
christos ec1dc88c1d define syscall here. 2005-07-10 04:20:34 +00:00
christos df1b79805d don't declare syscall and syscall_intern. 2005-07-10 00:54:54 +00:00
thorpej 76fd10b45a Move VFS extended attribute support to its own file. 2005-07-09 01:05:23 +00:00
christos ac0ee9b2c0 Allow F{G,S}OWN to succeed on a tty that has no session associated with it,
and it is not the controlling tty. This change allows us to use SIGIO on
a non-controlling tty (eg. debug ntpd with a refclock on a tty).
2005-07-07 00:01:32 +00:00
thorpej f44b62c49d Collect vmcmd statistics. 2005-07-06 23:08:57 +00:00
christos de124326cb Make copy{in,out}_proc work on all processes (including curproc) by
special-casing the curproc case. Use copy{in,out}_proc directly instead
of checking for curproc each time. Discussed with thorpej.
2005-07-06 22:30:42 +00:00
kleink c6cc410a70 Addendum to previous: copyin_proc() must not be used on curproc. 2005-07-06 20:56:49 +00:00
kleink e3c2a9c2f6 Use copyin_proc() to peek for trailing zeroes in sections, as we might be
running in a different context (i.e. a process tracing).
2005-07-06 20:31:33 +00:00
thorpej d697722880 A few tweaks to magic symlinks:
- Add a @{var} syntax in addition to @var.  This allows for patterns like
  @{ostype}-@{osrelease}-@{machine_arch}.
- Add a @emul variable that expands to the process's emulation name
  (e.g. "netbsd", "netbsd32", "linux", etc.)
2005-07-06 18:53:00 +00:00
elad ab856de1bc Use `const struct sysctlnode *veriexec_count_node' so it works with the
recent changes in sysctl(9).
2005-07-01 19:50:04 +00:00
drochner 0ca89e9c3a clean up duplication which was to support the old (not locator passing)
API for bus "submatch" functions
2005-06-28 18:37:34 +00:00
elad 1b7133edad From marius@openbsd:
Fix an issue when scripts are executed under systrace where the argv[0]
would be normalized, and hence break scripts that depend on how they were
called.
2005-06-27 17:11:20 +00:00
elad 8ebc2e9bee From marius@openbsd:
Add an exec message so that whenever a set-uid/gid process executes a new
image which we may control, the exec does not go by unnoticed.
2005-06-26 19:58:29 +00:00
riz 67399f088e Use %zx in a format string to print a size_t, not %lx, so a kernel
with KSYMS_DEBUG will compile.
2005-06-25 05:30:04 +00:00
christos 0064ddfe2b the magic number is not byte-swapped. 2005-06-25 02:22:57 +00:00
thorpej 73c9fbb0e6 Use ANSI function decls. Apply some static. 2005-06-23 23:15:12 +00:00
thorpej 2f6855b6ca Use ANSI function decls. 2005-06-23 18:46:17 +00:00
thorpej 6e4d6e6cdb Use ANSI decls, liberally apply static. 2005-06-23 18:44:44 +00:00
thorpej e871a0392f Remove the last references to M_NAMEI; everything should be using PNBUF_*()
now (for a long time now).  Remove M_NAMEI, and bump the kernel version to
3.99.7 to reflect its removal.
2005-06-23 17:00:30 +00:00
thorpej 65412a2710 Implement expansion of special "magic" strings in symlinks into
system-specific values.  Submitted by Chris Demetriou in Nov 1995 (!)
in PR kern/1781, modified only slighly by me.

This is enabled on a per-mount basis with the MNT_MAGICLINKS mount
flag.  It can be enabled at mountroot() time by building the kernel
with the ROOTFS_MAGICLINKS option.

The following magic strings are supported by the implementation:

	@machine	value of MACHINE for the system
	@machine_arch	value of MACHINE_ARCH for the system
	@hostname	the system host name, as set with sethostname()
	@domainname	the system domain name, as set with setdomainname()
	@kernel_ident	the kernel config file name
	@osrelease	the releaes number of the OS
	@ostype		the name of the OS (always "NetBSD" for NetBSD)

Example usage:

	mkdir /arch/i386/bin
	mkdir /arch/sparc/bin
	ln -s /arch/@machine_arch/bin /bin
2005-06-23 00:30:28 +00:00
elad 6e7c7658ef Fix logic in verbose printing. 2005-06-22 21:50:27 +00:00
ws 9d78e0cf36 PR-30566: Poll must not return <sys/errno.h> values.
Start with those places I can easily test.
2005-06-21 14:01:11 +00:00
elad 0e4dfe1792 - Use more calls to veriexec_report() where possible.
- Change #ifdef VERIFIED_EXEC_VERBOSE to another verbose level, 2. Add
  sysctl(3) bits.

- Simplify access type conflict handling during load. This depends on
  the values of access type defines to be ordered from least to most
  'strict'.
2005-06-20 15:06:18 +00:00
atatat df13e3579e Change the rest of the sysctl subsystem to use const consistently.
The __UNCONST macro is now used only where necessary and the RW macros
are gone.  Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
2005-06-20 02:49:18 +00:00
elad c3caa55d4d - Avoid pollution of struct vnode. Save the fingerprint evaluation status
in the veriexec table entry; the lookups are very cheap now. Suggested
  by Chuq.

- Handle non-regular (!VREG) files correctly).

- Remove (no longer needed) FINGERPRINT_NOENTRY.
2005-06-19 18:22:36 +00:00
thorpej 9616fa6458 Fix some locking issues:
- Make the locking rules for pr_rmpage() sane, and don't modify fields
  protected by the pool lock without actually holding it.
- Always defer freeing the pool page to the back-end allocator, to avoid
  invoking the pool_allocator with the pool locked (which would violate
  the pool_allocator -> pool locking order).
- Fix pool_reclaim() to not violate the pool_cache -> pool locking order
  by using a trylock.

Reviewed by Chuq Silvers.
2005-06-18 01:34:03 +00:00
atatat efb4270746 Comment in new cp_id implementation was wrong since I abandoned
rewriting it in favor of some testing and then never got back to it.
It's better now.
2005-06-17 23:53:21 +00:00
elad 97d75abb70 Oops. Don't allow file delete even if it's not monitored if we're in
lockdown mode (strict level 3).
2005-06-17 22:39:08 +00:00