Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel dns_resolver not working #9540

Closed
1 of 2 tasks
jabbera opened this issue Jan 26, 2023 · 4 comments
Closed
1 of 2 tasks

Kernel dns_resolver not working #9540

jabbera opened this issue Jan 26, 2023 · 4 comments

Comments

@jabbera
Copy link

jabbera commented Jan 26, 2023

Note: This is NOT a dupe of: #8365

Version

Microsoft Windows [Version 10.0.22621.1105]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

CUSTOM 5.15.83.1-microsoft-standard-WSL2

Distro Version

22.04.01

Other Software

No response

Repro Steps

Compile kernel with DFS config options and mount a DFS share. (or try to mount and NFS 4.1 share with a redirect I think)

CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SWN_UPCALL=y

Mount:

[ 95.460468] kernel: [mount.] ==> dns_query((null),MARPRDDFS001.top.tld,20,(null))
[ 95.460473] kernel: [mount.] call request_key(,MARPRDDFS001.top.tld,)
[ 95.463970] kernel: do_filp_open returnuing error: /sbin/request-key
[ 95.463972] kernel: do_filp_open returnuing error: -2
[ 95.464092] kernel: [mount.] <== dns_query() = -2

Expected Behavior

request-key upcall should work

Actual Behavior

request-key upcall fails. I dug into this until my brain hurt and for some reason the linked line below is returning -2 in WSL but does not on standard ubuntu:

https://github.com/microsoft/WSL2-Linux-Kernel/blob/292031a0f1af813fddf924151f5cccfa2f6f4642/fs/exec.c#L918

I can tell request-key isn't being called because I replaced it with a custom binary that just sleeps and touches a marker file.

Diagnostic Logs

No response

@jabbera
Copy link
Author

jabbera commented Jan 26, 2023

Side question: Is there a way to actually use a debugger on a custom kernel? I did all of this via printk and it was painful.

@jabbera jabbera changed the title Kernel dns_resolver not working Kernel dns_resolver and key request servcie not working Jan 27, 2023
@jabbera jabbera changed the title Kernel dns_resolver and key request servcie not working Kernel dns_resolver not working Jan 27, 2023
@jaltman
Copy link

jaltman commented Apr 17, 2024

The root cause of this issue is the lack of keyutils being installed in the CBL-Mariner base image. As a result, the kernel's attempt to execute /bin/request-key to perform the dns resolution upcall fails.

@jabbera
Copy link
Author

jabbera commented Apr 17, 2024

@jaltman is the mariner image the vm image that runs the wsl container instances?

@jaltman
Copy link

jaltman commented Apr 17, 2024

@jaltman is the mariner image the vm image that runs the wsl container instances?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants