Skip to content

Commit

Permalink
shm: exit when ftruncate() fails
Browse files Browse the repository at this point in the history
numa_police_memory() accesses the mapping region, which size is shmlen.
If the shared file can not be extended to shmlen, then SIGBUS will be
triggered. Instead exit() is more graceful.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
  • Loading branch information
Pingfan Liu authored and andikleen committed Nov 12, 2019
1 parent 7a4fc04 commit 3648aa5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ void attach_shared(char *name, char *opt)
would be impossible to apply policy then.
need to fix that in the kernel. */
perror("ftruncate");
exit(1);
}
}

Expand Down

0 comments on commit 3648aa5

Please sign in to comment.