]> 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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 Mar 2020 23:04:29 +0000 (16:04 -0700)
commita2facb0aed302e1dc87ec83e57483f6537fd06e1
tree94886b6871d4522d3df83c3779c63d79149b2cbc
parent83cae8348c326f58953a122f673b612ccaa70bcd
afs: Fix unpinned address list during probing

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: cacf55ead0eb ("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>
fs/afs/fs_probe.c