Skip to content

Commit

Permalink
numactl.c: fix use after free
Browse files Browse the repository at this point in the history
The following command can trigger the bug
  numactl --length 65536 --shm xxx -p0 -V > /dev/null

So reset mask to block any new access inside this loop.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
  • Loading branch information
Pingfan Liu authored and andikleen committed Jun 18, 2021
1 parent cc1d7d1 commit 498385e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions numactl.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ int main(int ac, char **av)
if (nnodes != 1)
usage();
numa_bitmask_free(mask);
mask = NULL;
errno = 0;
did_node_cpu_parse = 1;
numa_set_bind_policy(0);
Expand Down

0 comments on commit 498385e

Please sign in to comment.