keyctl05: increase dns_res_payload data due to kernel code changes
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 keyctl05: increase dns_res_payload data due to kernel code changes
keyctl05 was failed in v6.7-rc8 kernel, related discussion link:
https://lore.kernel.org/all/ZZ4vaJMN2w%[email protected]/
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.
--- testcases/kernel/syscalls/keyctl/keyctl05.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
testcases/kernel/syscalls/keyctl/keyctl05.c +5 -1
@@ -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 :
Signature · 5 lines
2.39.3 -- Mailing list info: https://lists.linux.it/listinfo/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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Petr,
Quoted 11 lines · Petr Vorel
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' ...
Quoted 7 lines
# 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/[email protected]/
BR,
Thanks!
Quoted 3 lines
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 20 lines
Hi Petr,
Quoted 16 lines · Petr Vorel
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 ...
Quoted 4 lines
Quoted 1 line
We consider modprobe as the last result.
Yes, it needs to load
dns_resolvermodule to test it. Or set kconfigCONFIG_DNS_RESOLVER=y.
Well, that would not work for kernels in linux distros. Therefore I'll send a patch to add modprobe functionality.
Quoted 3 lines
Due to the bundary issue fixed patch as follows, I will send another patch to set to 6 bytes coming data for
add_keysyscall for passed boundary checking:
https://lore.kernel.org/all/[email protected]/
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
Quoted 6 lines
BR,
Thanks!Quoted 2 lines
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 20 lines · Petr Vorel
Quoted 19 lines
Hi Petr,
Quoted 16 lines · Petr Vorel
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 ...
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
We consider modprobe as the last result.
Yes, it needs to load
dns_resolvermodule to test it. Or set kconfigCONFIG_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.
Quoted 9 lines
Quoted 4 lines
Due to the bundary issue fixed patch as follows, I will send another patch to set to 6 bytes coming data for
add_keysyscall for passed boundary checking:
https://lore.kernel.org/all/[email protected]/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!
Quoted 10 lines
Kind regards,
PetrQuoted 6 lines
BR,
Thanks!Quoted 2 lines
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp