nfs: Handle error of rpc_proc_register() in nfs_net_init().
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 9909dde2e53a19585212c32fe3eda482b5faaaa3| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfs: Handle error of rpc_proc_register() in nfs_net_init().
syzkaller reported a warning [0] triggered while destroying immature netns.
rpc_proc_register() was called in init_nfs_fs(), but its error has been ignored since at least the initial commit 1da177e4c3f4 ("Linux-2.6.12-rc2").
Recently, commit d47151b79e32 ("nfs: expose /proc/net/sunrpc/nfs in net namespaces") converted the procfs to per-netns and made the problem more visible.
Even when rpc_proc_register() fails, nfs_net_init() could succeed, and thus nfs_net_exit() will be called while destroying the netns.
Then, remove_proc_entry() will be called for non-existing proc directory and trigger the warning below.
Let's handle the error of rpc_proc_register() properly in nfs_net_init().
From the CVE record · Linux
The Linux kernel’s NFS initialization can ignore a failed proc registration and later try to remove a proc directory that does not exist. This can trigger a kernel warning when an incompletely initialized network namespace is destroyed. The report demonstrates the issue through a local namespace operation; it does not specify authentication requirements.
Engineers running Linux kernels with NFS support should check whether their kernel includes the fix; affected version ranges were not provided.