lkml.org 
[lkml]   [2020]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] stress-shm-sysv: exercise shmat with invalid flags
From
Date
I believe these patches should have gone directly to me and not various
other folk.

Colin

On 22/09/2020 08:27, Piyush Goyal wrote:
> Exercise shmat syscall with invalid flags resulting in more kernel
> coverage.
>
> Signed-off-by: Piyush Goyal <piyushgoyaliit@gmail.com>
> ---
> stress-shm-sysv.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/stress-shm-sysv.c b/stress-shm-sysv.c
> index aa03d718..5a3e0cc1 100644
> --- a/stress-shm-sysv.c
> +++ b/stress-shm-sysv.c
> @@ -128,6 +128,19 @@ static int stress_shm_sysv_check(
> return 0;
> }
>
> +/*
> + * exercise_shmat()
> + * exercise shmat syscall with all possible values of arguments
> + */
> +static void exercise_shmat(int shm_id)
> +{
> + void *addr;
> +
> + /* Exercise shmat syscall with invalid flags */
> + addr = shmat(shm_id, NULL, ~0);
> + (void)addr;
> +}
> +
> #if defined(__linux__)
> /*
> * stress_shm_get_procinfo()
> @@ -337,6 +350,7 @@ static int stress_shm_sysv_child(
> goto reap;
> }
>
> + exercise_shmat(shm_id);
> addr = shmat(shm_id, NULL, 0);
> if (addr == (char *) -1) {
> ok = false;
>

\
 
 \ /
  Last update: 2020-09-22 10:17    [W:0.031 / U:2.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site