nfsd: don't ignore the return code of svc_proc_register()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 93483ac5fec62cc1de166051b219d953bb5e4ef4 · < e31957a819e60cf0bc9a49408765e6095fd3d046| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
nfsd: don't ignore the return code of svc_proc_register()
Currently, nfsd_proc_stat_init() ignores the return value of svc_proc_register(). If the procfile creation fails, then the kernel will WARN when it tries to remove the entry later.
Fix nfsd_proc_stat_init() to return the same type of pointer as svc_proc_register(), and fix up nfsd_net_init() to check that and fail the nfsd_net construction if it occurs.
svc_proc_register() can fail if the dentry can't be allocated, or if an identical dentry already exists. The second case is pretty unlikely in the nfsd_net construction codepath, so if this happens, return -ENOMEM.
From the CVE record · Linux
The Linux kernel’s nfsd initialization ignores a failure to create a proc entry, which can cause a kernel warning when the entry is later removed. The failure can occur if a dentry cannot be allocated or an identical dentry already exists; the input does not describe an attacker path or access requirements.
Engineers running Linux kernels with nfsd should check whether their kernel is affected; no affected versions are specified.