Subject: Re: kern/35021: root cannot get/set rlimit information of user
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Havard Eidnes <he@NetBSD.org>
List: netbsd-bugs
Date: 11/10/2006 09:35:03
The following reply was made to PR kern/35021; it has been noted by GNATS.
From: Havard Eidnes <he@NetBSD.org>
To: bsd@cs.ubc.ca
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org, gnats-bugs@NetBSD.org
Subject: Re: kern/35021: root cannot get/set rlimit information of user
processes through sysctl
Date: Fri, 10 Nov 2006 10:27:14 +0100 (CET)
> >How-To-Repeat:
> As a user (using /bin/sh), set the hard datalimit to 256MB:
> $ ulimit -d 256000
> $ echo $$
> 2657
> $
I think this is actually setting the soft data limit. Certainly that
matches with what I observe:
$ ulimit -d
262144
$ sysctl -a | egrep rlimit.datasize
proc.curproc.rlimit.datasize.soft =3D 268435456
proc.curproc.rlimit.datasize.hard =3D 1073741824
$ echo 262144 1024 '*p' | dc
268435456
$ =
> As root, try to raise hard datalimit for proc 2657 to 384M
> # sysctl -w 'proc.2657.rlimit.datasize.hard=3D402653184'
> sysctl: proc.2657.rlimit.datasize.hard: sysctl() failed with Operati=
on not permitted
> #
This is trying to lower the hard data size limit from the default (1GB
in NetBSD 3.1) to 384MB. I'm not sure that's what you want/need. A
process which hits the soft data limit will be killed...
BTW, if you want to increase the maximum data limit up above the
default, I suspect you will need to tweak MAXDSIZ in the kernel config
and build and install a new kernel, c.f. options(4).
Regards,
- H=E5vard