[LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes

Pengfei Xu pengfei.xu@intel.com
Wed Jan 10 07:50:21 CET 2024


keyctl05 was failed in v6.7-rc8 kernel, related discussion link:
https://lore.kernel.org/all/ZZ4vaJMN2w%2FilkR3@xpf.sh.intel.com/

>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 after kernel v6.7-rc8 is 6 bytes.

Fixes: 9662d802a0 ("keyctl05: use data that passes dns_resolver_preparse() check")

Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/keyctl/keyctl05.c b/testcases/kernel/syscalls/keyctl/keyctl05.c
index 7d7c076c0..90cf1ef06 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl05.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl05.c
@@ -198,8 +198,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.
 	 */
-	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00 };
+	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00, \
+					  0x00, 0x00 };
 
 	switch (i) {
 	case 0:
-- 
2.39.3



More information about the ltp mailing list