View | Details | Raw Unified | Return to bug 206083
Collapse All | Expand All

(-)b/sys/amd64/linux/linux_sysvec.c (-1 / +17 lines)
Lines 120-125 extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; Link Here
120
SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
120
SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler);
121
121
122
static register_t * linux_copyout_strings(struct image_params *imgp);
122
static register_t * linux_copyout_strings(struct image_params *imgp);
123
static int	linux_coredump(struct thread *td, struct vnode *vp,
124
		    off_t limit, int flags);
123
static int	elf_linux_fixup(register_t **stack_base,
125
static int	elf_linux_fixup(register_t **stack_base,
124
		    struct image_params *iparams);
126
		    struct image_params *iparams);
125
static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
127
static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
Lines 794-799 linux_vsyscall(struct thread *td) Link Here
794
	return (0);
796
	return (0);
795
}
797
}
796
798
799
static int
800
linux_coredump(struct thread *td, struct vnode *vp, off_t limit, int flags)
801
{
802
	struct linux_pemuldata *pem;
803
804
	pem = pem_find(td->td_proc);
805
	KASSERT(pem != NULL, ("linux_coredump: proc emuldata not found.\n"));
806
807
	if (pem->flags & LINUX_FNONDUMPABLE)
808
		return (ENOSYS);
809
		
810
	return (__elfN(coredump)(td, vp, limit, flags));
811
}
812
797
struct sysentvec elf_linux_sysvec = {
813
struct sysentvec elf_linux_sysvec = {
798
	.sv_size	= LINUX_SYS_MAXSYSCALL,
814
	.sv_size	= LINUX_SYS_MAXSYSCALL,
799
	.sv_table	= linux_sysent,
815
	.sv_table	= linux_sysent,
Lines 806-812 struct sysentvec elf_linux_sysvec = { Link Here
806
	.sv_sigcode	= &_binary_linux_locore_o_start,
822
	.sv_sigcode	= &_binary_linux_locore_o_start,
807
	.sv_szsigcode	= &linux_szsigcode,
823
	.sv_szsigcode	= &linux_szsigcode,
808
	.sv_name	= "Linux ELF64",
824
	.sv_name	= "Linux ELF64",
809
	.sv_coredump	= elf64_coredump,
825
	.sv_coredump	= linux_coredump,
810
	.sv_imgact_try	= exec_linux_imgact_try,
826
	.sv_imgact_try	= exec_linux_imgact_try,
811
	.sv_minsigstksz	= LINUX_MINSIGSTKSZ,
827
	.sv_minsigstksz	= LINUX_MINSIGSTKSZ,
812
	.sv_pagesize	= PAGE_SIZE,
828
	.sv_pagesize	= PAGE_SIZE,
(-)b/sys/amd64/linux32/linux32_sysvec.c (-1 / +17 lines)
Lines 122-127 SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); Link Here
122
static int	elf_linux_fixup(register_t **stack_base,
122
static int	elf_linux_fixup(register_t **stack_base,
123
		    struct image_params *iparams);
123
		    struct image_params *iparams);
124
static register_t *linux_copyout_strings(struct image_params *imgp);
124
static register_t *linux_copyout_strings(struct image_params *imgp);
125
static int	linux_coredump(struct thread *td, struct vnode *vp,
126
		    off_t limit, int flags);
125
static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
127
static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
126
static void	exec_linux_setregs(struct thread *td, 
128
static void	exec_linux_setregs(struct thread *td, 
127
				   struct image_params *imgp, u_long stack);
129
				   struct image_params *imgp, u_long stack);
Lines 1007-1012 linux32_fixlimit(struct rlimit *rl, int which) Link Here
1007
	}
1009
	}
1008
}
1010
}
1009
1011
1012
static int
1013
linux_coredump(struct thread *td, struct vnode *vp, off_t limit, int flags)
1014
{
1015
	struct linux_pemuldata *pem;
1016
1017
	pem = pem_find(td->td_proc);
1018
	KASSERT(pem != NULL, ("linux_coredump: proc emuldata not found.\n"));
1019
1020
	if (pem->flags & LINUX_FNONDUMPABLE)
1021
		return (ENOSYS);
1022
1023
	return (__elfN(coredump)(td, vp, limit, flags));
1024
}
1025
1010
struct sysentvec elf_linux_sysvec = {
1026
struct sysentvec elf_linux_sysvec = {
1011
	.sv_size	= LINUX32_SYS_MAXSYSCALL,
1027
	.sv_size	= LINUX32_SYS_MAXSYSCALL,
1012
	.sv_table	= linux32_sysent,
1028
	.sv_table	= linux32_sysent,
Lines 1019-1025 struct sysentvec elf_linux_sysvec = { Link Here
1019
	.sv_sigcode	= &_binary_linux32_locore_o_start,
1035
	.sv_sigcode	= &_binary_linux32_locore_o_start,
1020
	.sv_szsigcode	= &linux_szsigcode,
1036
	.sv_szsigcode	= &linux_szsigcode,
1021
	.sv_name	= "Linux ELF32",
1037
	.sv_name	= "Linux ELF32",
1022
	.sv_coredump	= elf32_coredump,
1038
	.sv_coredump	= linux_coredump,
1023
	.sv_imgact_try	= exec_linux_imgact_try,
1039
	.sv_imgact_try	= exec_linux_imgact_try,
1024
	.sv_minsigstksz	= LINUX_MINSIGSTKSZ,
1040
	.sv_minsigstksz	= LINUX_MINSIGSTKSZ,
1025
	.sv_pagesize	= PAGE_SIZE,
1041
	.sv_pagesize	= PAGE_SIZE,
(-)b/sys/compat/linux/linux_emul.h (+5 lines)
Lines 62-67 int linux_common_execve(struct thread *, struct image_args *); Link Here
62
						   futex REQUEUE op*/
62
						   futex REQUEUE op*/
63
#define	LINUX_XUNSUP_EPOLL	0x00000002	/* unsupported epoll events */
63
#define	LINUX_XUNSUP_EPOLL	0x00000002	/* unsupported epoll events */
64
#define	LINUX_XUNSUP_FUTEXPIOP	0x00000004	/* uses unsupported pi futex */
64
#define	LINUX_XUNSUP_FUTEXPIOP	0x00000004	/* uses unsupported pi futex */
65
#define	LINUX_FNONDUMPABLE	0x00000008	/* state of the "dumpable"
66
						   flag, which determines
67
						   whether core dumps are
68
						   produced
69
						 */
65
70
66
struct linux_pemuldata {
71
struct linux_pemuldata {
67
	uint32_t	flags;		/* process emuldata flags */
72
	uint32_t	flags;		/* process emuldata flags */
(-)b/sys/compat/linux/linux_misc.c (+22 lines)
Lines 1945-1950 linux_prctl(struct thread *td, struct linux_prctl_args *args) Link Here
1945
	int error = 0, max_size;
1945
	int error = 0, max_size;
1946
	struct proc *p = td->td_proc;
1946
	struct proc *p = td->td_proc;
1947
	char comm[LINUX_MAX_COMM_LEN];
1947
	char comm[LINUX_MAX_COMM_LEN];
1948
	struct linux_pemuldata *pem;
1948
	struct linux_emuldata *em;
1949
	struct linux_emuldata *em;
1949
	int pdeath_signal;
1950
	int pdeath_signal;
1950
1951
Lines 2023-2028 linux_prctl(struct thread *td, struct linux_prctl_args *args) Link Here
2023
		error = copyout(comm, (void *)(register_t)args->arg2,
2024
		error = copyout(comm, (void *)(register_t)args->arg2,
2024
		    strlen(comm) + 1);
2025
		    strlen(comm) + 1);
2025
		break;
2026
		break;
2027
	case LINUX_PR_SET_DUMPABLE:
2028
		if (args->arg2 != LINUX_SUID_DUMP_DISABLE ||
2029
		    args->arg2 != LINUX_SUID_DUMP_USER)
2030
			return (EINVAL);
2031
		pem = pem_find(td->td_proc);
2032
		PROC_LOCK(p);
2033
		if (args->arg2 == LINUX_SUID_DUMP_DISABLE)
2034
			pem->flags |= LINUX_FNONDUMPABLE;
2035
		else
2036
			pem->flags &= ~LINUX_FNONDUMPABLE;
2037
		PROC_UNLOCK(p);
2038
		break;
2039
	case LINUX_PR_GET_DUMPABLE:
2040
		pem = pem_find(td->td_proc);
2041
		PROC_LOCK(p);
2042
		if (pem->flags & LINUX_FNONDUMPABLE)
2043
			td->td_retval[0] = 0;
2044
		else
2045
			td->td_retval[0] = 1;
2046
		PROC_UNLOCK(p);
2047
		break;
2026
	default:
2048
	default:
2027
		error = EINVAL;
2049
		error = EINVAL;
2028
		break;
2050
		break;
(-)b/sys/compat/linux/linux_misc.h (+7 lines)
Lines 50-55 Link Here
50
					 * Second arg is a ptr to return the
50
					 * Second arg is a ptr to return the
51
					 * signal.
51
					 * signal.
52
					 */
52
					 */
53
#define	LINUX_PR_SET_DUMPABLE	3	/* Second arg is a SUID_DUMP flag. */
54
#define	LINUX_PR_GET_DUMPABLE	4
55
56
/* for [S|G]ET_DUMPABLE */
57
#define	LINUX_SUID_DUMP_DISABLE	0	/* No setuid dumping. */
58
#define	LINUX_SUID_DUMP_USER	1	/* Dump as user of a process. */
59
53
#define	LINUX_PR_GET_KEEPCAPS	7	/* Get drop capabilities on setuid */
60
#define	LINUX_PR_GET_KEEPCAPS	7	/* Get drop capabilities on setuid */
54
#define	LINUX_PR_SET_KEEPCAPS	8	/* Set drop capabilities on setuid */
61
#define	LINUX_PR_SET_KEEPCAPS	8	/* Set drop capabilities on setuid */
55
#define	LINUX_PR_SET_NAME	15	/* Set process name. */
62
#define	LINUX_PR_SET_NAME	15	/* Set process name. */
(-)b/sys/i386/linux/linux_sysvec.c (-1 / +17 lines)
Lines 118-123 static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); Link Here
118
static void	exec_linux_setregs(struct thread *td,
118
static void	exec_linux_setregs(struct thread *td,
119
		    struct image_params *imgp, u_long stack);
119
		    struct image_params *imgp, u_long stack);
120
static register_t *linux_copyout_strings(struct image_params *imgp);
120
static register_t *linux_copyout_strings(struct image_params *imgp);
121
static int	linux_coredump(struct thread *td, struct vnode *vp,
122
		    off_t limit, int flags);
121
static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
123
static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
122
static void	linux_vdso_install(void *param);
124
static void	linux_vdso_install(void *param);
123
static void	linux_vdso_deinstall(void *param);
125
static void	linux_vdso_deinstall(void *param);
Lines 952-957 linux_get_machine(const char **dst) Link Here
952
	}
954
	}
953
}
955
}
954
956
957
static int
958
linux_coredump(struct thread *td, struct vnode *vp, off_t limit, int flags)
959
{
960
	struct linux_pemuldata *pem;
961
962
	pem = pem_find(td->td_proc);
963
	KASSERT(pem != NULL, ("linux_coredump: proc emuldata not found.\n"));
964
965
	if (pem->flags & LINUX_FNONDUMPABLE)
966
		return (ENOSYS);
967
968
	return (__elfN(coredump)(td, vp, limit, flags));
969
}
970
955
struct sysentvec linux_sysvec = {
971
struct sysentvec linux_sysvec = {
956
	.sv_size	= LINUX_SYS_MAXSYSCALL,
972
	.sv_size	= LINUX_SYS_MAXSYSCALL,
957
	.sv_table	= linux_sysent,
973
	.sv_table	= linux_sysent,
Lines 1001-1007 struct sysentvec elf_linux_sysvec = { Link Here
1001
	.sv_sigcode	= &_binary_linux_locore_o_start,
1017
	.sv_sigcode	= &_binary_linux_locore_o_start,
1002
	.sv_szsigcode	= &linux_szsigcode,
1018
	.sv_szsigcode	= &linux_szsigcode,
1003
	.sv_name	= "Linux ELF",
1019
	.sv_name	= "Linux ELF",
1004
	.sv_coredump	= elf32_coredump,
1020
	.sv_coredump	= linux_coredump,
1005
	.sv_imgact_try	= exec_linux_imgact_try,
1021
	.sv_imgact_try	= exec_linux_imgact_try,
1006
	.sv_minsigstksz	= LINUX_MINSIGSTKSZ,
1022
	.sv_minsigstksz	= LINUX_MINSIGSTKSZ,
1007
	.sv_pagesize	= PAGE_SIZE,
1023
	.sv_pagesize	= PAGE_SIZE,

Return to bug 206083