Skip to content

shm: Set NOFOLLOW on Linux like glibc/musl; add shared memory tests - #1752

Open
joshuamegnauth54 wants to merge 1 commit into
bytecodealliance:mainfrom
joshuamegnauth54:shm_open-nofollow
Open

joshuamegnauth54 wants to merge 1 commit into
bytecodealliance:mainfrom
joshuamegnauth54:shm_open-nofollow

Conversation

@joshuamegnauth54

Copy link
Copy Markdown
Contributor

Rustix opens shared memory file paths with CLOEXEC. Both glibc and musl also open them with NOFOLLOW to prevent inadvertently opening a symlink.

I also added two tests since there weren't any shared memory tests.

Sources:

Rustix opens shared memory file paths with CLOEXEC. Both glibc and musl
also open them with NOFOLLOW to prevent inadvertently opening a symlink.

I also added two tests since there weren't any shared memory tests.

Sources:
* https://git.musl-libc.org/cgit/musl/tree/src/mman/shm_open.c#n33
* https://sourceware.org/git/?p=glibc.git;a=blob;f=rt/shm_open.c;h=f08d8233bd8d488cdbb205a3b8a7422a7209431e;hb=HEAD#l40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant