]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: lock against ->sock changing during sysfs read
authorNeilBrown <neilb@suse.de>
Mon, 17 Jan 2022 05:36:53 +0000 (16:36 +1100)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 8 Feb 2022 14:14:26 +0000 (09:14 -0500)
commit6d351cc7fd17c2bc991dd15d9b0a156325b730a3
treef2c725e739f87b03ccbc0cababb25d71026b1f9a
parent217d335fb6d45bc749a65419170fe5904730063f
SUNRPC: lock against ->sock changing during sysfs read

->sock can be set to NULL asynchronously unless ->recv_mutex is held.
So it is important to hold that mutex.  Otherwise a sysfs read can
trigger an oops.
Commit 0136d0c05726 ("SUNRPC: Check if the xprt is connected before
handling sysfs reads") appears to attempt to fix this problem, but it
only narrows the race window.

Fixes: 0136d0c05726 ("SUNRPC: Check if the xprt is connected before handling sysfs reads")
Fixes: 64a0e1f0cc44 ("SUNRPC query transport's source port")
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/sysfs.c
net/sunrpc/xprtsock.c