This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug malloc/12155] MALLOC_MMAP_THRESHOLD_ and MALLOC_MMAP_MAX_ have different effect for setgid than for setuid programs


https://sourceware.org/bugzilla/show_bug.cgi?id=12155

--- Comment #8 from Michael Kerrisk <mtk.manpages at gmail dot com> ---
(In reply to Florian Weimer from comment #7)
> The strace invocation looks suspicious.  Ptracing a process will inhibit the
> SUID/SGID transition, particularly if run as an unprivileged user, as the $
> prompt suggests.  Michael, are you sure you are running strace in the right
> way?

Ach! You're exactly right. I completely overlooked this strace(1) behavior.
Running my program under strace(1) the right way:

$ MALLOC_MMAP_THRESHOLD_=50000 sudo strace -u mtk -o o ./t_M_MMAP_THRESHOLD -1
-1 0 1000 100000
$ grep brk o | wc; grep mmap o| wc
   1002    3006   52104
      9      72     862

In other words, MALLOC_MMAP_THRESHOLD_ has no effect, as it should.

Thanks for educating me, Florian.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]