From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23390 invoked by alias); 23 Oct 2010 14:02:31 -0000 Received: (qmail 23377 invoked by uid 22791); 23 Oct 2010 14:02:30 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID,TW_RW,TW_WX X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Oct 2010 14:02:26 +0000 From: "mtk.manpages at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12155] MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ (wrongly) have effect in setgid programs X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mtk.manpages at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Sat, 23 Oct 2010 14:02:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00135.txt.bz2 Message-ID: <20101023140200.lCR65haKK2Xf-2NAjyp-Mo1vZS8_dLKsFB-q6hKh4sI@z> http://sourceware.org/bugzilla/show_bug.cgi?id=12155 --- Comment #2 from Michael Kerrisk 2010-10-23 14:02:05 UTC --- Initial runs of test program as normal user. Grepping the strace output of the second run shows that MALLOC_MMAP_THRESHOLD_ has an effect. == $ strace -o o ./t_M_MMAP_THRESHOLD -1 -1 0 1000 100000 $ grep brk o | wc; grep mmap o| wc 503 1509 26156 7 56 612 $ MALLOC_MMAP_THRESHOLD_=50000 strace -o o ./t_M_MMAP_THRESHOLD -1 -1 0 1000 100000 $ grep brk o | wc; grep mmap o| wc 3 9 156 1006 8048 89523 == Now, run the program first as setuid-root, and then as setgid-root. In the first case, MALLOC_MMAP_THRESHOLD_ has no effect, but in the second, MALLOC_MMAP_THRESHOLD_ does have an effect. == $ sudo chown root:root t_M_MMAP_THRESHOLD $ sudo chmod u+s,g-s t_M_MMAP_THRESHOLD $ ls -l t_M_MMAP_THRESHOLD -rwsr-xr-x 1 root root 10126 Oct 23 15:32 t_M_MMAP_THRESHOLD $ MALLOC_MMAP_THRESHOLD_=50000 strace -o o ./t_M_MMAP_THRESHOLD -1 -1 0 1000 100000 $ grep brk o | wc; grep mmap o| wc 503 1509 26156 7 56 612 $ sudo chmod u-s,g+s t_M_MMAP_THRESHOLD $ ls -l t_M_MMAP_THRESHOLD -rwxr-sr-x 1 root root 10126 Oct 23 15:32 t_M_MMAP_THRESHOLD $ MALLOC_MMAP_THRESHOLD_=50000 strace -o o ./t_M_MMAP_THRESHOLD -1 -1 0 1000 100000 $ grep brk o | wc; grep mmap o| wc 3 9 156 1006 8048 89523 == -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.