[LTP] [PATCH 1/1] keyctl05: Improve the dns_res_payload for boundary testing

Petr Vorel pvorel@suse.cz
Thu Jan 11 11:06:36 CET 2024


From: Pengfei Xu <pengfei.xu@intel.com>

kernel commit acc657692aed ("keys, dns: Fix size check of V1 server-list header")
from upcoming v6.8-rc1 (going to be backported to stable), which fixes
the add_key syscall incoming data boundary size issue, 6 bytes incoming
data is now enough.

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
[ pvorel: add acc657692aed, reword commit message ]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
NOTE: I would wait with this to at least v6.8-rc2. Ideally it should be
released, when the commit reaches any stable tree or when v6.8 is released.

Changes v1->v2:
* mention acc657692aed
* update doc (v6.8-rc1 and acc657692aed438e9931438f8c923b2b107aebf9)
* reword commit message

 testcases/kernel/syscalls/keyctl/keyctl05.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/keyctl/keyctl05.c b/testcases/kernel/syscalls/keyctl/keyctl05.c
index f0e09fe5d..0c01fa034 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl05.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl05.c
@@ -201,11 +201,12 @@ static void do_test(unsigned int i)
 	/*
 	 * We need to pass check in dns_resolver_preparse(),
 	 * give it dummy server list request.
-	 * From v6.7-rc8 commit 1997b3cb4217b09e49659b634c94da47f0340409:
-	 * the incoming data for add_key syscall should be larger than 6 bytes,
-	 * because struct dns_server_list_v1_header without body is 6 bytes.
+	 * From v6.8-rc1 commit acc657692aed438e9931438f8c923b2b107aebf9:
+	 * the incoming data for add_key() sysdall should be not less than 6
+	 * bytes, because struct dns_server_list_v1_header is 6 bytes.
+	 * The minimum payload will be tested here for boundary testing.
 	 */
-	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00, 0x00, 0x00 };
+	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00, 0x00 };
 
 	switch (i) {
 	case 0:
@@ -229,6 +230,7 @@ static struct tst_test test = {
 	.forks_child = 1,
 	.tags = (const struct tst_tag[]) {
 		{"linux-git", "63a0b0509e70"},
+		{"linux-git", "acc657692aed"},
 		{}
 	}
 };
-- 
2.43.0



More information about the ltp mailing list