Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix segmentation fault with --offset and output wrong result with --verify #121

Merged
merged 2 commits into from
Sep 8, 2021
Merged

Conversation

luochenglcs
Copy link
Collaborator

@luochenglcs luochenglcs commented Sep 8, 2021

1、The following command can trigger the bug:numactl --offset 4096 --length 65536 --file xxx -p0 --touch > /dev/null
Because we create a shm file, we just consider shmlen, but not consider shmoffset,resulting in the mapped memory is no within the scope of the new shm file. when we access these memory will cause SIGBUS.

2、the verify_shm function memcmp nodes,when nodemask_sz is large 64, it will output "mismatched node mask",
that's not what we expected,we expected compare nodes->mask.

Chunsheng Luo added 2 commits September 8, 2021 18:48
The following command can trigger the bug
    numactl --offset 4096 --length 65536 --file xxx -p0 --touch

When we create a shm file, we just consider shmlen, but not consider shmoffset,
resulting in the mapped memory is no within the scope of the new shm file.
When nodemask_sz is large 64 (CONFIG_NODES_SHIFT > 6), verify_shm
will output wrong result "mismatched node mask". that's not what we
expected, we expected compare nodes->maskp.
@andikleen andikleen merged commit 54963a8 into numactl:master Sep 8, 2021
@andikleen
Copy link
Contributor

Thanks!

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.

2 participants