Skip to contentSkip to conversation

keyctl05: improve the dns_res_payload for boundary testing

PATCH In review Pengfei Xu 2 participants 7 messages Jan 11, 2024 – Jan 23, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Pengfei Xu

author
#1 lore raw

PATCH 1/1 keyctl05: improve the dns_res_payload for boundary testing

Because the following patch will fix the add_key syscall incoming data boundary size issue, 6 bytes incoming data should pass:
https://lore.kernel.org/all/[email protected]/
-> https://lore.kernel.org/all/[email protected]/
In order to test above boundary incoming data size, change the dns_res_payload size.

---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/keyctl/keyctl05.c +4 -4
index 90cf1ef06..50e78853c 100644
@@ -199,11 +199,11 @@ 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.
+	 * the incoming data for add_key syscall 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:
Signature · 5 lines
2.39.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
Quoted 17 lines

Because the following patch will fix the add_key syscall incoming data boundary size issue, 6 bytes incoming data should pass:
https://lore.kernel.org/all/[email protected]/
-> https://lore.kernel.org/all/[email protected]/
In order to test above boundary incoming data size, change the dns_res_payload size.

---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/keyctl/keyctl05.c +0 -0
index 90cf1ef06..50e78853c 100644

testcases/kernel/syscalls/keyctl/keyctl05.c static void do_test(unsigned int i) · line 205

Quoted 10 lines
testcases/kernel/syscalls/keyctl/keyctl05.c +3 -3
@@ -199,11 +199,11 @@ 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.
+	 * the incoming data for add_key syscall 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, \

nit (already pushed): \ is not needed for arrays.

Kind regards,
Petr

Quoted 5 lines
testcases/kernel/syscalls/keyctl/keyctl05.c +1 -1
-					  0x00, 0x00 };
+	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00, 0x00 };
 
 	switch (i) {
 	case 0:
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#3 lore raw
Quoted 21 lines · Petr Vorel
Quoted 21 lines

Because the following patch will fix the add_key syscall incoming data boundary size issue, 6 bytes incoming data should pass:
https://lore.kernel.org/all/[email protected]/
-> https://lore.kernel.org/all/[email protected]/
In order to test above boundary incoming data size, change the dns_res_payload size.

---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/keyctl/keyctl05.c +0 -1
index 90cf1ef06..50e78853c 100644
@@ -199,11 +199,11 @@ 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,
Quoted 8 lines

testcases/kernel/syscalls/keyctl/keyctl05.c static void do_test(unsigned int i) · line 205

Quoted 6 lines
testcases/kernel/syscalls/keyctl/keyctl05.c +3 -2
-	 * because struct dns_server_list_v1_header without body is 6 bytes.
+	 * the incoming data for add_key syscall 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, \

nit (already pushed): \ is not needed for arrays.

Indeed, thanks for your remind!

Thanks!

Quoted 9 lines

Kind regards,
Petr

Quoted 5 lines
testcases/kernel/syscalls/keyctl/keyctl05.c +1 -1
-					  0x00, 0x00 };
+	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00, 0x00 };
 
 	switch (i) {
 	case 0:
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
In reply to Pengfei Xu

Hi Xu,

Quoted 6 lines

Because the following patch will fix the add_key syscall incoming data boundary size issue, 6 bytes incoming data should pass:
https://lore.kernel.org/all/[email protected]/
-> https://lore.kernel.org/all/[email protected]/
In order to test above boundary incoming data size, change the dns_res_payload size.

I'm sorry, I was faster and just fixed \ myself.
Rebasing is trivial, but there was missing commit (already merged and other things). Thus I have sent v2 under your name (which I actually forget to mark as v2 :().

https://lore.kernel.org/ltp/[email protected]/
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Can you please have a look on it?

Kind regards,
Petr

Quoted 25 lines
---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/keyctl/keyctl05.c +4 -4
index 90cf1ef06..50e78853c 100644
@@ -199,11 +199,11 @@ 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.
+	 * the incoming data for add_key syscall 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:
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#5 lore raw

Hi Petr,

Quoted 14 lines · Petr Vorel

Hi Xu,

Quoted 6 lines

Because the following patch will fix the add_key syscall incoming data boundary size issue, 6 bytes incoming data should pass:
https://lore.kernel.org/all/[email protected]/
-> https://lore.kernel.org/all/[email protected]/
In order to test above boundary incoming data size, change the dns_res_payload size.

I'm sorry, I was faster and just fixed \ myself.
Rebasing is trivial, but there was missing commit (already merged and other things). Thus I have sent v2 under your name (which I actually forget to mark as v2 :().

Quoted 4 lines

https://lore.kernel.org/ltp/[email protected]/
https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/

Can you please have a look on it?

Yes, it's better to add the linux-git acc657692aed and it looks good. Thanks for your improvment!

Best Regards,
Thanks!

Quoted 29 lines

Kind regards,
Petr

Quoted 25 lines
---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/keyctl/keyctl05.c +4 -4
index 90cf1ef06..50e78853c 100644
@@ -199,11 +199,11 @@ 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.
+	 * the incoming data for add_key syscall 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:
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw

Hi Xu, all,

fix will be backported to stable series: 6.7, 6.6, 6.1, 5.15 and 5.10, it's not applicable to 4.19 and 5.4 stable).

Therefore merged. Thanks!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#7 lore raw

Hi Petr,

Quoted 6 lines · Petr Vorel

Hi Xu, all,

fix will be backported to stable series: 6.7, 6.6, 6.1, 5.15 and 5.10, it's not applicable to 4.19 and 5.4 stable).

Therefore merged. Thanks!

Great, thank you for your info and remind in community:
https://lore.kernel.org/all/CA+icZUUc_0M_6JU3dZzVqrUUrWJceY1uD8dO2yFMCwtHtkaa_Q@mail.gmail.com/

Best Regards,
Thanks!

Quoted 3 lines

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp