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

(-)/usr/src/sys/alpha/osf1/osf1_sysvec.c (-1 / +1 lines)
Lines 121-127 Link Here
121
121
122
	sz = *(imgp->proc->p_sysent->sv_szsigcode);
122
	sz = *(imgp->proc->p_sysent->sv_szsigcode);
123
	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
123
	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
124
		roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
124
		roundup((argmax - imgp->stringspace), sizeof(char *));
125
125
126
	destp -= imgp->stringspace;
126
	destp -= imgp->stringspace;
127
127
(-)/usr/src/sys/ia64/ia32/ia32_sysvec.c (-2 / +2 lines)
Lines 146-152 Link Here
146
	arginfo = (struct ia32_ps_strings *)IA32_PS_STRINGS;
146
	arginfo = (struct ia32_ps_strings *)IA32_PS_STRINGS;
147
	szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
147
	szsigcode = *(imgp->proc->p_sysent->sv_szsigcode);
148
	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
148
	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
149
		roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
149
		roundup((argmax - imgp->stringspace), sizeof(char *));
150
150
151
	/*
151
	/*
152
	 * install sigcode
152
	 * install sigcode
Lines 194-200 Link Here
194
	/*
194
	/*
195
	 * Copy out strings - arguments and environment.
195
	 * Copy out strings - arguments and environment.
196
	 */
196
	 */
197
	copyout(stringp, destp, ARG_MAX - imgp->stringspace);
197
	copyout(stringp, destp, argmax - imgp->stringspace);
198
198
199
	/*
199
	/*
200
	 * Fill in "ps_strings" struct for ps, w, etc.
200
	 * Fill in "ps_strings" struct for ps, w, etc.
(-)/usr/src/sys/kern/kern_exec.c (-7 / +7 lines)
Lines 235-241 Link Here
235
	 * Allocate temporary demand zeroed space for argument and
235
	 * Allocate temporary demand zeroed space for argument and
236
	 *	environment strings
236
	 *	environment strings
237
	 */
237
	 */
238
	imgp->stringbase = (char *)kmem_alloc_wait(exec_map, ARG_MAX +
238
	imgp->stringbase = (char *)kmem_alloc_wait(exec_map, argmax +
239
	    PAGE_SIZE);
239
	    PAGE_SIZE);
240
	if (imgp->stringbase == NULL) {
240
	if (imgp->stringbase == NULL) {
241
		error = ENOMEM;
241
		error = ENOMEM;
Lines 243-250 Link Here
243
		goto exec_fail;
243
		goto exec_fail;
244
	}
244
	}
245
	imgp->stringp = imgp->stringbase;
245
	imgp->stringp = imgp->stringbase;
246
	imgp->stringspace = ARG_MAX;
246
	imgp->stringspace = argmax;
247
	imgp->image_header = imgp->stringbase + ARG_MAX;
247
	imgp->image_header = imgp->stringbase + argmax;
248
248
249
	/*
249
	/*
250
	 * Translate the file name. namei() returns a vnode pointer
250
	 * Translate the file name. namei() returns a vnode pointer
Lines 260-266 Link Here
260
	error = namei(ndp);
260
	error = namei(ndp);
261
	if (error) {
261
	if (error) {
262
		kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase,
262
		kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase,
263
		    ARG_MAX + PAGE_SIZE);
263
		    argmax + PAGE_SIZE);
264
		goto exec_fail;
264
		goto exec_fail;
265
	}
265
	}
266
266
Lines 633-639 Link Here
633
633
634
	if (imgp->stringbase != NULL)
634
	if (imgp->stringbase != NULL)
635
		kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase,
635
		kmem_free_wakeup(exec_map, (vm_offset_t)imgp->stringbase,
636
		    ARG_MAX + PAGE_SIZE);
636
		    argmax + PAGE_SIZE);
637
637
638
	if (imgp->object)
638
	if (imgp->object)
639
		vm_object_deallocate(imgp->object);
639
		vm_object_deallocate(imgp->object);
Lines 987-993 Link Here
987
	if (p->p_sysent->sv_szsigcode != NULL)
987
	if (p->p_sysent->sv_szsigcode != NULL)
988
		szsigcode = *(p->p_sysent->sv_szsigcode);
988
		szsigcode = *(p->p_sysent->sv_szsigcode);
989
	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
989
	destp =	(caddr_t)arginfo - szsigcode - SPARE_USRSPACE -
990
	    roundup((ARG_MAX - imgp->stringspace), sizeof(char *));
990
	    roundup((argmax - imgp->stringspace), sizeof(char *));
991
991
992
	/*
992
	/*
993
	 * install sigcode
993
	 * install sigcode
Lines 1035-1041 Link Here
1035
	/*
1035
	/*
1036
	 * Copy out strings - arguments and environment.
1036
	 * Copy out strings - arguments and environment.
1037
	 */
1037
	 */
1038
	copyout(stringp, destp, ARG_MAX - imgp->stringspace);
1038
	copyout(stringp, destp, argmax - imgp->stringspace);
1039
1039
1040
	/*
1040
	/*
1041
	 * Fill in "ps_strings" struct for ps, w, etc.
1041
	 * Fill in "ps_strings" struct for ps, w, etc.
(-)/usr/src/sys/kern/kern_mib.c (-1 / +1 lines)
Lines 111-117 Link Here
111
    &maxusers, 0, "Hint for kernel tuning");
111
    &maxusers, 0, "Hint for kernel tuning");
112
112
113
SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD,
113
SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD,
114
    0, ARG_MAX, "Maximum bytes of argument to execve(2)");
114
    &argmax, 0, "Maximum bytes of argument to execve(2)");
115
115
116
SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD,
116
SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD,
117
    0, _POSIX_VERSION, "Version of POSIX attempting to comply to");
117
    0, _POSIX_VERSION, "Version of POSIX attempting to comply to");
(-)/usr/src/sys/kern/subr_param.c (+4 lines)
Lines 75-80 Link Here
75
int	nswbuf;
75
int	nswbuf;
76
int	maxswzone;			/* max swmeta KVA storage */
76
int	maxswzone;			/* max swmeta KVA storage */
77
int	maxbcache;			/* max buffer cache KVA storage */
77
int	maxbcache;			/* max buffer cache KVA storage */
78
int	argmax;				/* max bytes of argument to exec */
78
u_quad_t	maxtsiz;			/* max text size */
79
u_quad_t	maxtsiz;			/* max text size */
79
u_quad_t	dfldsiz;			/* initial data size limit */
80
u_quad_t	dfldsiz;			/* initial data size limit */
80
u_quad_t	maxdsiz;			/* max data size */
81
u_quad_t	maxdsiz;			/* max data size */
Lines 166-169 Link Here
166
167
167
	ncallout = 16 + maxproc + maxfiles;
168
	ncallout = 16 + maxproc + maxfiles;
168
	TUNABLE_INT_FETCH("kern.ncallout", &ncallout);
169
	TUNABLE_INT_FETCH("kern.ncallout", &ncallout);
170
171
	argmax = ARG_MAX;
172
	TUNABLE_INT_FETCH("kern.argmax", &argmax);
169
}
173
}
(-)/usr/src/sys/sys/proc.h (+1 lines)
Lines 827-832 Link Here
827
extern int hogticks;			/* Limit on kernel cpu hogs. */
827
extern int hogticks;			/* Limit on kernel cpu hogs. */
828
extern int nprocs, maxproc;		/* Current and max number of procs. */
828
extern int nprocs, maxproc;		/* Current and max number of procs. */
829
extern int maxprocperuid;		/* Max procs per uid. */
829
extern int maxprocperuid;		/* Max procs per uid. */
830
extern int argmax;			/* Max bytes of argument to exec. */
830
extern u_long ps_arg_cache_limit;
831
extern u_long ps_arg_cache_limit;
831
extern int ps_argsopen;
832
extern int ps_argsopen;
832
extern int ps_showallprocs;
833
extern int ps_showallprocs;
(-)/usr/src/sys/vm/vm_init.c (-1 / +1 lines)
Lines 193-199 Link Here
193
				(nswbuf*MAXPHYS) + pager_map_size);
193
				(nswbuf*MAXPHYS) + pager_map_size);
194
	pager_map->system_map = 1;
194
	pager_map->system_map = 1;
195
	exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,
195
	exec_map = kmem_suballoc(kernel_map, &minaddr, &maxaddr,
196
				(16*(ARG_MAX+(PAGE_SIZE*3))));
196
				(16*(argmax+(PAGE_SIZE*3))));
197
197
198
	/*
198
	/*
199
	 * XXX: Mbuf system machine-specific initializations should
199
	 * XXX: Mbuf system machine-specific initializations should

Return to bug 58803