Re: [PATCH v1 1/3] policycoreutils/setfiles: reject invalid -T arguments
Stephen Smalley <[email protected]>
| Newsgroups | org.kernel.vger.selinux |
|---|---|
| Message-ID | <CAEjxPJ59MhYLc1ivJWVKX9H_EOvwyGKyaEHvULRWkFq=Xc-Q5Q@mail.gmail.com> |
On Tue, Aug 18, 2026 at 3:24 PM jboero <[email protected]> wrote: > > From: Johnny Boero <[email protected]> > > The -T option is parsed with strtoull(3), which happily accepts leading > whitespace, a sign and, in particular, negative values: "-T -1" wraps > around to SIZE_MAX threads, which then fails a calloc(3) of SIZE_MAX > pthread_t entries rather than reporting a usage error. > > Factor the parsing out into a helper and reject anything that is not a > plain decimal thread count. > > Signed-off-by: Johnny Boero <[email protected]> Acked-by: Stephen Smalley <[email protected]>