summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_uid16.c
Commit message (Collapse)AuthorAgeFilesLines
* Where possible we will use M_LINUX malloc(9) type.dchagin2015-05-241-5/+5
| | | | | | | Move M_FUTEX defines to the linux_common.ko. Differential Revision: https://reviews.freebsd.org/D1077 Reviewed by: emaste
* cred: add proc_set_cred helpermjg2015-03-161-1/+1
| | | | | | | The goal here is to provide one place altering process credentials. This eases debugging and opens up posibilities to do additional work when such an action is performed.
* Remove the no-at variants of the kern_xx() syscall helpers. E.g., wekib2014-11-131-4/+4
| | | | | | | | | | | | have both kern_open() and kern_openat(); change the callers to use kern_openat(). This removes one (sometimes two) levels of indirection and consolidates arguments checks. Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week
* - For kernel compiled only with KDTRACE_HOOKS and not any lock debuggingattilio2013-11-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | option, unbreak the lock tracing release semantic by embedding calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined version of the releasing functions for mutex, rwlock and sxlock. Failing to do so skips the lockstat_probe_func invokation for unlocking. - As part of the LOCKSTAT support is inlined in mutex operation, for kernel compiled without lock debugging options, potentially every consumer must be compiled including opt_kdtrace.h. Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES is linked there and it is only used as a compile-time stub [0]. [0] immediately shows some new bug as DTRACE-derived support for debug in sfxge is broken and it was never really tested. As it was not including correctly opt_kdtrace.h before it was never enabled so it was kept broken for a while. Fix this by using a protection stub, leaving sfxge driver authors the responsibility for fixing it appropriately [1]. Sponsored by: EMC / Isilon storage division Discussed with: rstone [0] Reported by: rstone [1] Discussed with: philip
* Fix some typos that were causing probe argument types to show up as unknown.markj2013-10-011-1/+1
| | | | | | Reviewed by: rwatson (mac provider) Approved by: re (glebius) MFC after: 1 week
* - >500 static DTrace probes for the linuxulatornetchild2012-05-051-28/+161
| | | | | | | | | | | | | | | | | | - DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probe;s with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs).
* Add curly braces missed in r226247.brueffer2011-10-111-1/+2
| | | | | | Pointy hat to: brueffer Submitted by: many MFC after: 1 week
* Properly free linux_gidset in case of an error.brueffer2011-10-111-0/+1
| | | | | | CID: 4136 Found with: Coverity Prevent(tm) MFC after: 1 week
* In order to maximize the re-usability of kernel code in user space thiskmacy2011-09-161-8/+8
| | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
* Since all other comparisons involving ngroups_max usebrooks2010-01-151-1/+1
| | | | | "ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent "> ngroups_max" to reduce confusion.
* Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamicbrooks2010-01-121-1/+1
| | | | | | | | kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to INT_MAX-1. Given that the Windows group limit is 1024, this range should be sufficient for most applications. MFC after: 1 month
* Rework the credential code to support larger values of NGROUPS andbrooks2009-06-191-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867
* Add the support for the AT_FDCWD and fd-relative name lookups to thekib2008-03-311-0/+1
| | | | | | | | | namei(9). Based on the submission by rdivacky, sponsored by Google Summer of Code 2007 Reviewed by: rwatson, rdivacky Tested by: pho
* Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); inrwatson2007-06-121-2/+1
| | | | | | | | | | | | | | | some cases, move to priv_check() if it was an operation on a thread and no other flags were present. Eliminate caller-side jail exception checking (also now-unused); jail privilege exception code now goes solely in kern_jail.c. We can't yet eliminate suser() due to some cases in the KAME code where a privilege check is performed and then used in many different deferred paths. Do, however, move those prototypes to priv.h. Reviewed by: csjp Obtained from: TrustedBSD Project
* Partial MFp4 of 114977:netchild2007-02-241-4/+3
| | | | | | Whitespace commit: Fix grammar, spelling and punctuation. Submitted by: "Scot Hetzel" <swhetzel@gmail.com>
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-1/+3
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Unbreak COMPAT_LINUX32 option support on amd64.ru2006-03-191-0/+2
| | | | Broken by: netchild
* Fixup some problems in my previous commit (COMPAT_43).netchild2006-03-181-2/+0
| | | | Pointyhat to: netchild
* Get rid of the need of COMPAT_43 in the linuxolator.netchild2006-03-181-2/+2
| | | | | Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Obtained from: DragonFly (some parts)
* Match the LINUX32's style with existing styleobrien2005-01-141-4/+4
| | | | | | Submitted by: Jung-uk Kim <jkim@niksun.com> Use positive, not negative logic.
* Changes to MI Linux emulation code necessary to run 32-bit Linux binariestjr2004-08-161-0/+7
| | | | | | | | | | | | | | | on AMD64, and the general case where the emulated platform has different size pointers than we use natively: - declare certain structure members as l_uintptr_t and use the new PTRIN and PTROUT macros to convert to and from native pointers. - declare some structures __packed on amd64 when the layout would differ from that used on i386. - include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h> if compiling with COMPAT_LINUX32. This will need to be revisited before 32-bit and 64-bit Linux emulation support can coexist in the same kernel. - other small scattered changes. This should be a no-op on i386 and Alpha.
* Rename suser_cred()'s PRISON_ROOT flag to SUSER_ALLOWJAIL. This iscperciva2004-07-261-1/+1
| | | | | | | | | | | somewhat clearer, but more importantly allows for a consistent naming scheme for suser_cred flags. The old name is still defined, but will be removed in a few days (unless I hear any complaints...) Discussed with: rwatson, scottl Requested by: jhb
* Deorbit COMPAT_SUNOS.phk2004-06-111-1/+1
| | | | | We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither a sparc32 port nor a SunOS4.x compatibility desire these days.
* Reject negative ngrp arguments in linux_setgroups() and linux_setgroups16();tjr2003-10-211-1/+1
| | | | | stops users being able to cause setgroups to clobber the kernel stack by copying in data past the end of the linux_gidset array.
* Use __FBSDID().obrien2003-06-101-2/+3
|
* More caddr_t removal, in conjunction with copy{in,out}(9) this time.des2003-03-031-4/+2
| | | | Also clean up some egregious casts and incorrect use of sizeof.
* Include <sys/malloc.h> instead of depending on namespace pollution 2bde2002-09-051-3/+3
| | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Sorted includes.
* Use the new kern_* functions to avoid the need to store argumentsiedowse2002-09-011-22/+18
| | | | | | | | in the stack gap. This converts most VFS and signal related system calls, as well as select(). Discussed on: -arch Approved by: marcel
* Rework logic of syscalls that modify process credentials as described injhb2002-04-131-12/+20
| | | | rev 1.152 of sys/kern/kern_prot.c.
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-3/+3
| | | | reference.
* When casting from uid16/gid16 to uid/gid respectively, make suremarcel2001-10-141-14/+16
| | | | | | | that "no change" (ie 0xFFFF) is properly cast to (int)-1 for those syscalls that set uids and/or gids. Verified by: LTP
* KSE Milestone 2julian2001-09-121-35/+37
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Speculatively add this file. It's part of the Linuxulator updatemarcel2001-09-011-0/+285
to make it emulate Linux kernel version 2.4.2, which is required in order to upgrade the linux_base port to RH 7.1. Note that this file is only needed for 32-bit architectures. To us this means i386 (for now?)
OpenPOWER on IntegriCloud