lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 7 May 2012 03:06:36 -0700
From:	Maciej Żenczykowski <zenczykowski@...il.com>
To:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc:	James Morris <jmorris@...ei.org>, neilb@...e.de,
	Vasiliy Kulikov <segoon@...nwall.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: setuid and RLIMIT_NPROC and 3.1+

Commit 72fa59970f8698023045ab0713d66f3f4f96945c
Author: Vasiliy Kulikov <segoon@...nwall.com>
Date:   Mon Aug 8 19:02:04 2011 +0400

    move RLIMIT_NPROC check from set_user() to do_execve_common()

intentionally 'breaks' error return codes from setuid and friends in
the presence of RLIMIT_NPROC.

3.0.30:
setresuid(0, 0, 0)                      = 0
setrlimit(RLIMIT_NPROC, {rlim_cur=1, rlim_max=1}) = 0
clone(Process 20070 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x1344b30) = 20070  [fork() succeeds only because we're
root]
[pid 20069] setuid(65534)               = 0
[pid 20070] setuid(65534)      = -1 EAGAIN (Resource temporarily unavailable)

3.1:
setresuid(0, 0, 0)                      = 0
setrlimit(RLIMIT_NPROC, {rlim_cur=1, rlim_max=1}) = 0
clone(Process 13507 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0x135cb30) = 13507 [fork() succeeds only because we're
root]
[pid 13506] setuid(65534)      = 0
[pid 13507] setuid(65534)      = 0

Having read the commit in question I get what it is trying to prevent,
but perhaps the setuid call should still be returning an error code
[E2BIG? EBUSY? EOVERFLOW? ENAVAIL?] for those programs that do bother
to check, even though it would 'succeed' in changing uid?

(In my case there is no exec following the setuid...)

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ