From: Jeff Layton Date: Wed, 24 Jun 2015 16:10:23 +0000 (-0400) Subject: nfs: fix potential credential leak in ff_layout_update_mirror_cred X-Git-Tag: omap-for-v4.3/legacy-v2-signed~68^2~17 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a24221dca1868101c9b4b5adde4a6a5b1a3a64a7;p=pandora-kernel.git nfs: fix potential credential leak in ff_layout_update_mirror_cred If we have two tasks racing to update a mirror's credentials, then they can end up leaking one (or more) sets of credentials. The first task will set mirror->cred and then the second task will just overwrite it. Use a cmpxchg to ensure that the creds are only set once. If we get to the point where we would set mirror->cred and find that they're already set, then we just release the creds that were just found. Signed-off-by: Jeff Layton Cc: stable@vger.kernel.org # 4.0+ Signed-off-by: Trond Myklebust --- Reading git-diff-tree failed