]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Fix unpinned address list during probing
authorDavid Howells <dhowells@redhat.com>
Thu, 26 Mar 2020 15:24:07 +0000 (15:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:02:08 +0000 (11:02 +0200)
commitf10bb22410f4fa08e3ec7431e550751727191e23
treed81eaa71ccb7e8bbfec85fcde4128bc54263b2e7
parent48da6c89ac92dfdb495f5f726387b7eda38b663a
afs: Fix unpinned address list during probing

commit dacf54aed382022d5226d14abf59bd86afd3fd7b upstream.

When it's probing all of a fileserver's interfaces to find which one is
best to use, afs_do_probe_fileserver() takes a lock on the server record
and notes the pointer to the address list.

It doesn't, however, pin the address list, so as soon as it drops the
lock, there's nothing to stop the address list from being freed under
us.

Fix this by taking a ref on the address list inside the locked section
and dropping it at the end of the function.

Fixes: b6139ef5ddf3 ("afs: Probe multiple fileservers simultaneously")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Marc Dionne <marc.dionne@auristor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/afs/fs_probe.c