All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] keyctl05: use data that passes dns_resolver_preparse() check
@ 2018-10-25  8:19 Jan Stancek
  2018-10-25 13:04 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2018-10-25  8:19 UTC (permalink / raw)
  To: ltp

commit bbb4c4323a4d ("dns: Allow the dns resolver to retrieve a server set")
introduced extra checks in dns_resolver_preparse(), which led to failure
when creating a key:
  keyctl05.c:119: BROK: unexpected error adding 'dns_resolver' key: EINVAL
  tst_test.c:884: BROK: Test 1 haven't reported results!

This patches replaces 2 zero-es with payload that passes checks introduced
by bbb4c4323a4d. Since these checks didn't exist before, this change
is backwards-compatible with earlier kernels without this patch.

Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/keyctl/keyctl05.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/keyctl/keyctl05.c b/testcases/kernel/syscalls/keyctl/keyctl05.c
index 2384f7f67167..e2ed8ad4841b 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl05.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl05.c
@@ -194,8 +194,11 @@ static void test_update_setperm_race(void)
 
 static void do_test(unsigned int i)
 {
-	/* two 0 bytes is accepted as a dns_resolver key payload */
-	static char zeroes[2];
+	/*
+	 * We need to pass check in dns_resolver_preparse(),
+	 * give it dummy server list request.
+	 */
+	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00 };
 
 	switch (i) {
 	case 0:
@@ -203,8 +206,8 @@ static void do_test(unsigned int i)
 					 x509_cert, sizeof(x509_cert));
 		break;
 	case 1:
-		test_update_nonupdatable("dns_resolver",
-					 zeroes, sizeof(zeroes));
+		test_update_nonupdatable("dns_resolver", dns_res_payload,
+			sizeof(dns_res_payload));
 		break;
 	case 2:
 		test_update_setperm_race();
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] keyctl05: use data that passes dns_resolver_preparse() check
  2018-10-25  8:19 [LTP] [PATCH] keyctl05: use data that passes dns_resolver_preparse() check Jan Stancek
@ 2018-10-25 13:04 ` Cyril Hrubis
  2018-10-26  7:22   ` Jan Stancek
  0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2018-10-25 13:04 UTC (permalink / raw)
  To: ltp

Hi!
Looks good, acked.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] keyctl05: use data that passes dns_resolver_preparse() check
  2018-10-25 13:04 ` Cyril Hrubis
@ 2018-10-26  7:22   ` Jan Stancek
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2018-10-26  7:22 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> Hi!
> Looks good, acked.

Pushed.

> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-26  7:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-25  8:19 [LTP] [PATCH] keyctl05: use data that passes dns_resolver_preparse() check Jan Stancek
2018-10-25 13:04 ` Cyril Hrubis
2018-10-26  7:22   ` Jan Stancek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.