Skip to content

Commit 3648aa5

Browse files
Pingfan Liuandikleen
authored andcommitted
shm: exit when ftruncate() fails
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>
1 parent 7a4fc04 commit 3648aa5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

shm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ void attach_shared(char *name, char *opt)
151151
would be impossible to apply policy then.
152152
need to fix that in the kernel. */
153153
perror("ftruncate");
154+
exit(1);
154155
}
155156
}
156157

0 commit comments

Comments
 (0)