Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 15 Oct 2020 10:50:24 +0200
From: Szabolcs Nagy <>
To: Alexey Izbyshev <>
Subject: Re: Why is setrlimit() considered to have per-thread effect?

* Alexey Izbyshev <> [2020-10-15 08:01:00 +0300]:
> Commit 544ee752cd[1] claims that setrlimit() is per-thread on Linux,
> similarly to setxid() calls, so it should be called via __synccall(). But
> this appears to be wrong: the kernel code operates on tsk->signal[2], which
> is a per-thread-group structure. Glibc doesn't call setrlimit() for each
> thread either. Am I missing something?

note that prlimit does not have synccall in
musl: the kernel implemented the per process
rlimit setting when prlimit was added.
(i think this is linux commit
 1c1e618ddd15f69fd87ccea596769f78c8065504 )

but older kernels don't have that.

> Tangentially, setgroups() is not called via __synccall(), though it does
> have per-thread effect. Is this intentional?

that may be a bug, but it's not a posix api
so not a conformance issue, but a linux issue:
if other linux libcs don't do synccall then
that's the defacto interface contract.

> Alexey
> [1]
> [2]

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.