[PATCH][BZ #15763][BZ #14752] Restrict shm_open and shm_unlink to SHMDIR.

Florian Weimer fweimer@redhat.com
Mon Oct 21 10:01:00 GMT 2013


On 10/15/2013 09:37 AM, Ondřej Bílka wrote:
> Hi, this patch adds validation restrict shm_open into a SHMDIR
> directory.
>
> A manpage says that it is only recomanded for portability, it is ok to
> break nonportable apps? If not then close 15763.
>
> As nobody bothered to test posix shmopen implementations I will not add
> validation until its fixed.
>
> OK to commit?

Looks okay to me in principle.

> +  if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/'))

I think most of libc uses explicit checks: strchr (name, '/') != NULL.

> +  if (name[0] == '\0' || namelen > NAME_MAX || strchr (name, '/'))

Likewise.

-- 
Florian Weimer / Red Hat Product Security Team



More information about the Libc-alpha mailing list