-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a testcase with the mask parameter points to an invalid address. Signed-off-by: Ma Xinjian <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/sigsuspend01 | ||
/sigsuspend02 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
/* | ||
* Copyright (c) 2024 FUJITSU LIMITED. All Rights Reserved. | ||
* Copyright (c) Linux Test Project, 2024 | ||
* Author: Ma Xinjian <[email protected]> | ||
*/ | ||
|
||
/*\ | ||
* [Description] | ||
* | ||
* Verify that sigsuspend(2) fails with | ||
* | ||
* - EFAULT mask points to memory which is not a valid part of the | ||
* process address space. | ||
*/ | ||
|
||
#include "tst_test.h" | ||
|
||
static void *invalid_mask; | ||
|
||
static void setup(void) | ||
{ | ||
invalid_mask = tst_get_bad_addr(NULL); | ||
} | ||
|
||
static void verify_sigsuspend(void) | ||
{ | ||
TST_EXP_FAIL(sigsuspend(invalid_mask), EFAULT); | ||
} | ||
|
||
static struct tst_test test = { | ||
.test_all = verify_sigsuspend, | ||
.setup = setup, | ||
}; |