All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes
       [not found] <cover.1704868967.git.pengfei.xu@intel.com>
@ 2024-01-10  6:50 ` Pengfei Xu
  2024-01-10 17:59   ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Pengfei Xu @ 2024-01-10  6:50 UTC (permalink / raw)
  To: ltp; +Cc: Heng Su, rpalethorpe

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


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes
  2024-01-10  6:50 ` [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes Pengfei Xu
@ 2024-01-10 17:59   ` Petr Vorel
  2024-01-11  3:02     ` Pengfei Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2024-01-10 17:59 UTC (permalink / raw)
  To: Pengfei Xu; +Cc: Heng Su, ltp

Hi Xu,

Good catch, merged.

BTW any change how to trigger autoload of dns_resolver ?

# ./keyctl05
...
keyctl05.c:99: TCONF: kernel doesn't support key type 'dns_resolver'
...

# modprobe dns_resolver
# ./keyctl05
...
keyctl05.c:143: TPASS: updating 'dns_resolver' key expectedly failed with EOPNOTSUPP
...

We consider modprobe as the last result.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes
  2024-01-10 17:59   ` Petr Vorel
@ 2024-01-11  3:02     ` Pengfei Xu
  2024-01-11  8:25       ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Pengfei Xu @ 2024-01-11  3:02 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Heng Su, ltp

Hi Petr,

On 2024-01-10 at 18:59:31 +0100, Petr Vorel wrote:
> Hi Xu,
> 
> Good catch, merged.
> 
> BTW any change how to trigger autoload of dns_resolver ?
> 
> # ./keyctl05
> ...
> keyctl05.c:99: TCONF: kernel doesn't support key type 'dns_resolver'
> ...
> 
> # modprobe dns_resolver
> # ./keyctl05
> ...
> keyctl05.c:143: TPASS: updating 'dns_resolver' key expectedly failed with EOPNOTSUPP
> ...
> 
> We consider modprobe as the last result.

Yes, it needs to load dns_resolver module to test it.
Or set kconfig CONFIG_DNS_RESOLVER=y.

Due to the bundary issue fixed patch as follows, I will send another patch to
set to 6 bytes coming data for add_key syscall for passed boundary checking:
https://lore.kernel.org/all/1784441.1704907412@warthog.procyon.org.uk/

BR,
Thanks!

> 
> Kind regards,
> Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes
  2024-01-11  8:25       ` Petr Vorel
@ 2024-01-11  8:24         ` Pengfei Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Pengfei Xu @ 2024-01-11  8:24 UTC (permalink / raw)
  To: Petr Vorel; +Cc: Heng Su, ltp

On 2024-01-11 at 09:25:49 +0100, Petr Vorel wrote:
> > Hi Petr,
> 
> > On 2024-01-10 at 18:59:31 +0100, Petr Vorel wrote:
> > > Hi Xu,
> 
> > > Good catch, merged.
> 
> > > BTW any change how to trigger autoload of dns_resolver ?
> 
> > > # ./keyctl05
> > > ...
> > > keyctl05.c:99: TCONF: kernel doesn't support key type 'dns_resolver'
> > > ...
> 
> > > # modprobe dns_resolver
> > > # ./keyctl05
> > > ...
> > > keyctl05.c:143: TPASS: updating 'dns_resolver' key expectedly failed with EOPNOTSUPP
> > > ...
> 
> > > We consider modprobe as the last result.
> 
> > Yes, it needs to load dns_resolver module to test it.
> > Or set kconfig CONFIG_DNS_RESOLVER=y.
> 
> Well, that would not work for kernels in linux distros.
> Therefore I'll send a patch to add modprobe functionality.

  Ah, ok, yes, it's better to check the module before the test.

> 
> > Due to the bundary issue fixed patch as follows, I will send another patch to
> > set to 6 bytes coming data for add_key syscall for passed boundary checking:
> > https://lore.kernel.org/all/1784441.1704907412@warthog.procyon.org.uk/
> 
> Thank you!
> 
> FYI we're planning LTP release in the end of month, it'd be great if you send
> patch soon so that fix is included.

Thanks for your info, and here is the link for new patch:
https://lore.kernel.org/ltp/48efcb1293a682182fc5db23f01be7af2889e26c.1704949719.git.pengfei.xu@intel.com/T/#u

Thanks!

> 
> Kind regards,
> Petr
> 
> > BR,
> > Thanks!
> 
> 
> > > Kind regards,
> > > Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

* Re: [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes
  2024-01-11  3:02     ` Pengfei Xu
@ 2024-01-11  8:25       ` Petr Vorel
  2024-01-11  8:24         ` Pengfei Xu
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2024-01-11  8:25 UTC (permalink / raw)
  To: Pengfei Xu; +Cc: Heng Su, ltp

> Hi Petr,

> On 2024-01-10 at 18:59:31 +0100, Petr Vorel wrote:
> > Hi Xu,

> > Good catch, merged.

> > BTW any change how to trigger autoload of dns_resolver ?

> > # ./keyctl05
> > ...
> > keyctl05.c:99: TCONF: kernel doesn't support key type 'dns_resolver'
> > ...

> > # modprobe dns_resolver
> > # ./keyctl05
> > ...
> > keyctl05.c:143: TPASS: updating 'dns_resolver' key expectedly failed with EOPNOTSUPP
> > ...

> > We consider modprobe as the last result.

> Yes, it needs to load dns_resolver module to test it.
> Or set kconfig CONFIG_DNS_RESOLVER=y.

Well, that would not work for kernels in linux distros.
Therefore I'll send a patch to add modprobe functionality.

> Due to the bundary issue fixed patch as follows, I will send another patch to
> set to 6 bytes coming data for add_key syscall for passed boundary checking:
> https://lore.kernel.org/all/1784441.1704907412@warthog.procyon.org.uk/

Thank you!

FYI we're planning LTP release in the end of month, it'd be great if you send
patch soon so that fix is included.

Kind regards,
Petr

> BR,
> Thanks!


> > Kind regards,
> > Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2024-01-11  8:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1704868967.git.pengfei.xu@intel.com>
2024-01-10  6:50 ` [LTP] [PATCH v1 1/1] keyctl05: increase dns_res_payload data due to kernel code changes Pengfei Xu
2024-01-10 17:59   ` Petr Vorel
2024-01-11  3:02     ` Pengfei Xu
2024-01-11  8:25       ` Petr Vorel
2024-01-11  8:24         ` Pengfei Xu

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.