[PATCH 3/3] getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)
Siddhesh Poyarekar
siddhesh@sourceware.org
Tue Jan 18 13:16:36 GMT 2022
On 18/01/2022 18:43, Andreas Schwab wrote:
> On Jan 18 2022, Siddhesh Poyarekar wrote:
>
>> We then process it to try and get the cwd anyway by using the posix
>> variant.
>
> Which returns the appropriate error.
>
In the specific case of an unprivileged mount on the same directory, it
ends up underflowing the buffer before returning. Whether it returns
the right error or not becomes irrelevant then. Please see the reproducer.
Siddhesh
More information about the Libc-alpha
mailing list