Home | History | Annotate | Download | only in common
History log of /src/sys/compat/linux/common/linux_uselib.c
RevisionDateAuthorComments
 1.33  09-Nov-2014  maxv Do not uselessly include <sys/malloc.h>.
 1.32  30-Oct-2014  maxv Reject non-regular files.

Patch from njoly@.
 1.31  19-Oct-2014  maxv Resource leak.

Found by my code scanner.

Tested by njoly@; ok njoly@ rmind@ on tech-kern@.
 1.30  28-Aug-2009  dholland branches: 1.30.22; 1.30.38;
Another one that needs <sys/exec_aout.h>.
 1.29  15-Aug-2009  matt Include <sys/exec_aout.h> explicitly instead of relying on <sys/exec.h> to
do it for you.
 1.28  29-Jun-2009  dholland Convert 67 namei call sites to use namei_simple, in these functions:

check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
 1.27  28-Apr-2008  martin branches: 1.27.2; 1.27.14;
Remove clause 3 and 4 from TNF licenses
 1.26  20-Dec-2007  dsl branches: 1.26.6; 1.26.8; 1.26.10;
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.25  08-Dec-2007  pooka branches: 1.25.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.24  19-Oct-2007  njoly branches: 1.24.4;
Add compat_linux and exec_linux_elf lkm support for amd64:
- Add needed COMPAT_OSSAUDIO to GENERIC.
- Add missing includes needed by linux_syscallargs.h.
- Add lkm building.
 1.23  19-Oct-2007  ad machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.22  30-Apr-2007  dsl branches: 1.22.6; 1.22.8; 1.22.12;
Remove some unused calls to stackgap_init()
 1.21  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.20  04-Mar-2007  christos branches: 1.20.2; 1.20.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.19  09-Feb-2007  ad branches: 1.19.2;
Merge newlock2 to head.
 1.18  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.17  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.16  23-Jul-2006  ad branches: 1.16.4; 1.16.6;
Use the LWP cached credentials where sane.
 1.15  14-May-2006  elad integrate kauth.
 1.14  11-Dec-2005  christos branches: 1.14.4; 1.14.6; 1.14.8; 1.14.10; 1.14.12;
merge ktrace-lwp.
 1.13  17-Sep-2004  skrll branches: 1.13.12;
There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
 1.12  29-Jun-2003  fvdl branches: 1.12.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.11  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.10  01-Apr-2003  thorpej Use PAGE_SIZE rather than NBPG.
 1.9  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.8  06-Jan-2003  wiz writable, not writeable.
 1.7  05-Oct-2002  chs count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
 1.6  16-Mar-2002  christos branches: 1.6.6;
make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.5  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.4  30-Oct-2001  thorpej - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings. Stop overloading VTEXT for this purpose (VTEXT
also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
than making a function call to do this (it no longer makes sense to
use a function call, since we no longer overload VTEXT with VEXECMAP's
meaning).

VEXECMAP suggested by Chuq Silvers.
 1.3  22-Jul-2001  wiz branches: 1.3.4;
seperate -> separate
 1.2  12-Dec-2000  jdolecek branches: 1.2.2; 1.2.4;
define EXEC_AOUT (if not defined) before including linux_syscallargs.h,
to get linux_sys_uselib() prototype
 1.1  01-Dec-2000  jdolecek branches: 1.1.2;
put linux_sys_uselib() to separate file linux_uselib.c
 1.1.2.3  13-Dec-2000  bouyer Sync with HEAD (for UBC fixes).
 1.1.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.1.2.1  01-Dec-2000  bouyer file linux_uselib.c was added on branch thorpej_scsipi on 2000-12-08 09:08:31 +0000
 1.2.4.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.2.4.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.4.1  03-Aug-2001  lukem update to -current
 1.2.2.7  07-Jan-2003  thorpej Sync with HEAD.
 1.2.2.6  18-Oct-2002  nathanw Catch up to -current.
 1.2.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.2.2.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.2.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.2.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.2.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.3.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.6.6.1  02-Oct-2003  tron Pull up revision 1.7 (requested by junyoung in ticket #1488):
count executable image pages as executable for vm-usage purposes.
also, always do the VTEXT vs. v_writecount mutual exclusion
(which we previously skipped if the text or data segment was empty).
 1.12.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.12.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.12.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.13.12.6  21-Jan-2008  yamt sync with head
 1.13.12.5  27-Oct-2007  yamt sync with head.
 1.13.12.4  03-Sep-2007  yamt sync with head.
 1.13.12.3  26-Feb-2007  yamt sync with head.
 1.13.12.2  30-Dec-2006  yamt sync with head.
 1.13.12.1  21-Jun-2006  yamt sync with head.
 1.14.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.14.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.14.8.2  11-Aug-2006  yamt sync with head
 1.14.8.1  24-May-2006  yamt sync with head.
 1.14.6.1  01-Jun-2006  kardel Sync with head.
 1.14.4.1  09-Sep-2006  rpaulo sync with head
 1.16.6.2  10-Dec-2006  yamt sync with head.
 1.16.6.1  22-Oct-2006  yamt sync with head
 1.16.4.2  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.16.4.1  18-Nov-2006  ad Sync with head.
 1.19.2.2  07-May-2007  yamt sync with head.
 1.19.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.20.4.1  11-Jul-2007  mjf Sync with head.
 1.20.2.2  23-Oct-2007  ad Sync with head.
 1.20.2.1  27-May-2007  ad Sync with head.
 1.22.12.1  25-Oct-2007  bouyer Sync with HEAD.
 1.22.8.2  09-Jan-2008  matt sync with HEAD
 1.22.8.1  06-Nov-2007  matt sync with HEAD
 1.22.6.2  09-Dec-2007  jmcneill Sync with HEAD.
 1.22.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.24.4.1  26-Dec-2007  ad Sync with head.
 1.25.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.26.10.4  16-Sep-2009  yamt sync with head
 1.26.10.3  19-Aug-2009  yamt sync with head.
 1.26.10.2  18-Jul-2009  yamt sync with head.
 1.26.10.1  16-May-2008  yamt sync with head.
 1.26.8.1  18-May-2008  yamt sync with head.
 1.26.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.27.14.1  23-Jul-2009  jym Sync with HEAD.
 1.27.2.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.27.2.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.30.38.2  17-Jan-2015  martin Pull up following revision(s) (requested by maxv in ticket #427):
sys/compat/svr4/svr4_schedctl.c: revision 1.8
sys/netinet/tcp_timer.c: revision 1.88
sys/miscfs/genfs/layer_vfsops.c: revision 1.45
sys/compat/svr4/svr4_ioctl.c: revision 1.37
sys/ufs/chfs/chfs_vfsops.c: revision 1.14
sys/miscfs/fdesc/fdesc_vfsops.c: revision 1.91
sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.30
sys/compat/common/kern_time_50.c: revision 1.28
sys/netinet6/ip6_forward.c: revision 1.74
sys/miscfs/umapfs/umap_vnops.c: revision 1.57
sys/compat/svr4/svr4_fcntl.c: revision 1.74
distrib/sets/lists/comp/mi: revision 1.1931
sys/netinet6/udp6_output.c: revision 1.46
sys/fs/puffs/puffs_compat.c: revision 1.3
sys/fs/udf/udf_rename.c: revision 1.11
sys/compat/svr4/svr4_filio.c: revision 1.24
sys/fs/udf/udf_rename.c: revision 1.12
sys/netinet/tcp_usrreq.c: revision 1.202
sys/miscfs/umapfs/umap_subr.c: revision 1.29
sys/compat/linux/common/linux_fadvise64.c: revision 1.3
sys/netinet/if_atm.c: revision 1.34
sys/miscfs/procfs/procfs_subr.c: revision 1.106
sys/miscfs/genfs/layer_subr.c: revision 1.37
sys/netinet/tcp_sack.c: revision 1.30
sys/compat/freebsd/freebsd_misc.c: revision 1.33
sys/compat/freebsd/freebsd_file.c: revision 1.33
sys/ufs/chfs/chfs_vnode.c: revision 1.12
sys/compat/svr4/svr4_ttold.c: revision 1.34
sys/compat/linux/common/linux_file.c: revision 1.114
sys/compat/linux/arch/mips/linux_machdep.c: revision 1.43
sys/compat/linux/common/linux_signal.c: revision 1.76
sys/compat/common/compat_util.c: revision 1.46
sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.18
sys/compat/svr4/svr4_sockio.c: revision 1.36
sys/compat/linux/arch/arm/linux_machdep.c: revision 1.32
sys/compat/svr4/svr4_signal.c: revision 1.66
sys/kern/kern_exec.c: revision 1.410
sys/fs/puffs/puffs_vfsops.c: revision 1.115
sys/compat/svr4/svr4_exec_elf64.c: revision 1.15
sys/compat/linux/arch/i386/linux_machdep.c: revision 1.159
sys/compat/linux/arch/alpha/linux_machdep.c: revision 1.50
sys/compat/linux32/common/linux32_misc.c: revision 1.24
sys/netinet/in_pcb.c: revision 1.153
sys/sys/malloc.h: revision 1.116
sys/compat/common/if_43.c: revision 1.9
share/man/man9/Makefile: revision 1.380
sys/netinet/tcp_vtw.c: revision 1.12
sys/miscfs/umapfs/umap_vfsops.c: revision 1.95
sys/ufs/ext2fs/ext2fs_vfsops.c: revision 1.186
sys/compat/common/uipc_syscalls_43.c: revision 1.46
sys/ufs/ext2fs/ext2fs_vnops.c: revision 1.115
sys/fs/puffs/puffs_msgif.c: revision 1.97
sys/compat/svr4/svr4_ipc.c: revision 1.27
sys/compat/linux/common/linux_exec.c: revision 1.117
sys/ufs/ext2fs/ext2fs_readwrite.c: revision 1.66
sys/netinet/tcp_output.c: revision 1.179
sys/compat/svr4/svr4_termios.c: revision 1.28
sys/fs/udf/udf_strat_bootstrap.c: revision 1.4
sys/fs/puffs/puffs_subr.c: revision 1.67
sys/fs/puffs/puffs_node.c: revision 1.36
sys/miscfs/overlay/overlay_vnops.c: revision 1.21
sys/fs/cd9660/cd9660_node.c: revision 1.34
sys/netinet/raw_ip.c: revision 1.146
sys/sys/mallocvar.h: revision 1.13
sys/miscfs/overlay/overlay_vfsops.c: revision 1.63
share/man/man9/malloc.9: revision 1.50
sys/netinet6/dest6.c: revision 1.18
sys/compat/linux/common/linux_uselib.c: revision 1.33
sys/compat/linux/common/linux_socket.c: revision 1.120
share/man/man9/malloc.9: revision 1.51
sys/netinet/tcp_subr.c: revision 1.257
sys/compat/linux/common/linux_socketcall.c: revision 1.45
sys/compat/linux/common/linux_fadvise64_64.c: revision 1.3
sys/compat/freebsd/freebsd_ipc.c: revision 1.17
sys/compat/linux/common/linux_misc_notalpha.c: revision 1.109
sys/compat/linux/arch/alpha/linux_pipe.c: revision 1.17
sys/netinet6/in6_pcb.c: revision 1.132
sys/netinet6/in6_ifattach.c: revision 1.94
sys/compat/svr4/svr4_exec_elf32.c: revision 1.15
sys/miscfs/nullfs/null_vfsops.c: revision 1.90
sys/fs/cd9660/cd9660_util.c: revision 1.12
sys/compat/linux/arch/powerpc/linux_machdep.c: revision 1.48
sys/compat/freebsd/freebsd_exec_elf32.c: revision 1.20
sys/miscfs/procfs/procfs_vfsops.c: revision 1.94
sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.28
sys/compat/linux/common/linux_sched.c: revision 1.67
sys/compat/linux/common/linux_exec_aout.c: revision 1.67
sys/compat/linux/common/linux_pipe.c: revision 1.67
sys/compat/linux/common/linux_llseek.c: revision 1.34
sys/compat/linux/arch/mips/linux_ptrace.c: revision 1.10
Do not uselessly include <sys/malloc.h>.
Cleanup:
- remove struct kmembuckets (dead)
- correctly deadify MALLOC_XX
- remove MALLOC_DEFINE_LIMIT and MALLOC_JUSTDEFINE_LIMIT (dead)
- remove malloc_roundup(), malloc_type_setlimit(), MALLOC_DEFINE_LIMIT()
and MALLOC_JUSTDEFINE_LIMIT() from man 9 malloc
New sentence, new line. Bump date for previous.
Obsolete malloc_roundup(9), malloc_type_setlimit(9) and MALLOC_DEFINE_LIMIT(9)
man pages.
 1.30.38.1  29-Dec-2014  martin Pull up following revision(s) (requested by maxv in ticket #353):
sys/ufs/chfs/chfs_vfsops.c: revision 1.12
sys/compat/common/vfs_syscalls_30.c: revision 1.35
sys/compat/linux/common/linux_uselib.c: revision 1.31
sys/compat/linux/common/linux_uselib.c: revision 1.32
Resource leak.
Memory leaks.
Reject non-regular files.
 1.30.22.1  03-Dec-2017  jdolecek update from HEAD

RSS XML Feed