[patch] Re: What is the difference between 'login: root' and 'su -' ?

From: Peter Seiderer (Peter.Seiderer@ciselant.de)
Date: Thu Nov 08 2001 - 09:20:38 EST


On Thu, Nov 08, 2001 at 11:14:21AM +0100, Peter Seiderer wrote:
> Hello,
> the SIGXFSZ signal is produced in the file mm/filemap.c (linx-2.4.14) in
> line 2771:
>
> 2769: if (limit != RLIM_INFINITY) {
> 2770: if (pos >= limit) {
> 2771: send_sig(SIGXFSZ, current, 0);
> 2772: goto out;
> 2773: }
>
> The valus at this point are
> limit: 0x7fffffff
> RLIM_INFINITY: 0xffffffff
> pos: 0x80004000
>
> where limit comes from:
> unsigned long limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
>
> but I did not yet detected the point(s) where
> current->rlim[RLIMIT_FSIZE].rlim_cur
> is(are) set/changed.
> Peter
>

Investigated a litte bit in the kernel I detected there is a
sys_getrlimit function and a sys_old_getrlimit function which is
called in arch i386, m68k, sh, ppc, s390, cris, arm which mangles the
RLIM_INFINITY: 0xffffffff to 0x7fffffff.

The problem is that it is now impossible to set the limits to
RLIM_INFINITY while only 0x7fffffff is given as input.

Therefor I programed analog to sys_old_getrlimit the function sys_old_setrlimit
which mangles all values >= 0x7fffffff to 0xffffffff (see attached patch).

Peter



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 15 2001 - 21:00:18 EST