stress-shm-sysv: exercise shmat with invalid flags
PATCH 1/3 stress-shm-sysv: exercise shmat with invalid flags
Exercise shmat syscall with invalid flags resulting in more kernel coverage.
Signed-off-by Piyush Goyal <[email protected]>
--- stress-shm-sysv.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
stress-shm-sysv.c +14 -0
@@ -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;
Signature · 1 line
2.25.1
PATCH 2/3 stress-shm-sysv: exercise shmat with all possible flags
Exercise shmat syscall with all possible flags resulting in more kernel coverage.
Signed-off-by Piyush Goyal <[email protected]>
--- stress-shm-sysv.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
stress-shm-sysv.c +10 -0
@@ -139,6 +139,16 @@ static void exercise_shmat(int shm_id)/* Exercise shmat syscall with invalid flags */ addr =shmat (shm_id,NULL , ~0 ); (void )addr; + +/* Exercise shmat with all possible values of flags */ + addr =shmat (shm_id,NULL ,SHM_RDONLY ); + (void )addr; + + addr =shmat (shm_id,NULL ,SHM_EXEC ); + (void )addr; + + addr =shmat (shm_id,NULL ,SHM_RND ); + (void )addr; }#if defined(__linux__)
Signature · 1 line
2.25.1
PATCH 3/3 stress-shmsysv: exercise shmat with SHM_REMAP flag on NULL address
In reply to Piyush GoyalExercise shmat syscall with SHM_REMAP flag on NULL address resulting in EINVAL error and more kernel coverage.
Signed-off-by Piyush Goyal <[email protected]>
--- stress-shm-sysv.c | 4 ++++ 1 file changed, 4 insertions(+)
stress-shm-sysv.c +4 -0
@@ -149,6 +149,10 @@ static void exercise_shmat(int shm_id) addr =shmat (shm_id,NULL ,SHM_RND ); (void )addr; + +/* Exercise shmat with SHM_REMAP flag on NULL address */ + addr =shmat (shm_id,NULL ,SHM_REMAP ); + (void )addr; }#if defined(__linux__)
Signature · 1 line
2.25.1
I believe these patches should have gone directly to me and not various other folk.
Colin
Quoted 41 lines · Piyush Goyal
Exercise shmat syscall with invalid flags resulting in more kernel coverage.
Signed-off-by Piyush Goyal <[email protected]>--- stress-shm-sysv.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)stress-shm-sysv.c +14
-0@@ -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;