[PATCH 3/3] getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)
Siddhesh Poyarekar
siddhesh@sourceware.org
Tue Jan 18 13:33:38 GMT 2022
On 18/01/2022 19:00, Andreas Schwab wrote:
> On Jan 18 2022, Siddhesh Poyarekar wrote:
>
>> 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.
>
> No, it returns with ERANGE.
>
Can you tell me where the reproducer is wrong then? It clearly shows
the buffer being overwritten where it shouldn't be.
Thanks,
Siddhesh
More information about the Libc-alpha
mailing list