• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2024 FUJITSU LIMITED. All Rights Reserved.
4  * Copyright (c) Linux Test Project, 2024
5  * Author: Ma Xinjian <maxj.fnst@fujitsu.com>
6  */
7 
8 /*\
9  * [Description]
10  *
11  * Verify that sigsuspend(2) fails with
12  *
13  * - EFAULT mask points to memory which is not a valid part of the
14  *          process address space.
15  */
16 
17 #include "tst_test.h"
18 
19 static void *invalid_mask;
20 
setup(void)21 static void setup(void)
22 {
23 	invalid_mask = tst_get_bad_addr(NULL);
24 }
25 
verify_sigsuspend(void)26 static void verify_sigsuspend(void)
27 {
28 	TST_EXP_FAIL(sigsuspend(invalid_mask), EFAULT);
29 }
30 
31 static struct tst_test test = {
32 	.test_all = verify_sigsuspend,
33 	.setup = setup,
34 };
35