lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200922072730.68911-1-piyushgoyaliit@gmail.com>
Date:   Tue, 22 Sep 2020 12:57:28 +0530
From:   Piyush Goyal <piyushgoyaliit@...il.com>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Cc:     linux-kernel@...r.kernel.org
Subject: [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 <piyushgoyaliit@...il.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;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ