Commit 45bcdfe
committed
net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change
jira LE-1907
cve CVE-2021-47624
Rebuild_History Non-Buildable kernel-4.18.0-553.16.1.el8_10
commit-author Xiyu Yang <[email protected]>
commit 776d794
The refcount leak issues take place in an error handling path. When the
3rd argument buf doesn't match with "offline", "online" or "remove", the
function simply returns -EINVAL and forgets to decrease the reference
count of a rpc_xprt object and a rpc_xprt_switch object increased by
rpc_sysfs_xprt_kobj_get_xprt() and
rpc_sysfs_xprt_kobj_get_xprt_switch(), causing reference count leaks of
both unused objects.
Fix this issue by jumping to the error handling path labelled with
out_put when buf matches none of "offline", "online" or "remove".
Signed-off-by: Xiyu Yang <[email protected]>
Signed-off-by: Xin Xiong <[email protected]>
Signed-off-by: Xin Tan <[email protected]>
Signed-off-by: Anna Schumaker <[email protected]>
(cherry picked from commit 776d794)
Signed-off-by: Jonathan Maple <[email protected]>1 parent 334e257 commit 45bcdfe
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
0 commit comments