lockd: fix NULL dereference on lockowner allocation failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 · < 4c7fc129db061c7daab841c4f3c342d894832362| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
lockd: fix NULL dereference on lockowner allocation failure
nlmclnt_locks_init_private() installs NLM file lock operations even when nlmclnt_find_lockowner() fails to allocate a lockowner. nlmclnt_proc() then returns -ENOMEM, but the VFS still tears down the partially initialized file_lock and calls locks_release_private().
That invokes nlmclnt_locks_release_private(), which dereferences fl->fl_u.nfs_fl.owner and crashes because the owner was never installed.
Clear fl_ops before attempting to initialize the NLM private state, and install the NLM lock operations only after a lockowner has been allocated successfully.
From the CVE record · Linux
The Linux kernel's lockd can dereference a NULL lockowner when NLM lockowner allocation fails during file-lock initialization, causing a crash during cleanup. The input does not specify whether an attacker can trigger the failure, or any access or user-interaction requirements.
Anyone running the Linux kernel should check their version; affected versions are not specified.