[PATCH] shm_open/unlink: fix errno if namelen >= NAME_MAX

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Oct 27 11:53:43 GMT 2020



On 27/10/2020 07:27, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> I think it would be good to refactor the code to use a PATH_MAX variable
>> instead, something like:
> 
> As this is generic code, I don't think we can assume PATH_MAX is defined
> (Hurd does not have it AFAIK).

Although Hurd uses the POSIX implementation, I am not sure if it is fully
functional.  It does not support sem [1] [2].

I would like to avoid creating a unbounded path, at least on Linux with
BZ#25383 expected fix it would highly unlikely we will even need paths
larger than PATH_MAX (and current implementation does imposes the NAME_MAX
limit).

So I think it would be better to make Linux uses at maximum PATH_MAX, or 
even NAME_MAX plus "/dev/shm/".

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=25524
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=25521


More information about the Libc-alpha mailing list