linux/fs/nfs/flexfilelayout
Jeff Layton a24221dca1 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 <jeff.layton@primarydata.com>
Cc: stable@vger.kernel.org # 4.0+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2015-06-25 19:34:40 -04:00
..
flexfilelayout.c pnfs/flexfiles: use swap() in ff_layout_sort_mirrors() 2015-06-16 11:14:03 -04:00
flexfilelayout.h pnfs/flexfiles: Add the FlexFile Layout Driver 2015-02-03 11:06:52 -08:00
flexfilelayoutdev.c nfs: fix potential credential leak in ff_layout_update_mirror_cred 2015-06-25 19:34:40 -04:00
Makefile pnfs/flexfiles: Add the FlexFile Layout Driver 2015-02-03 11:06:52 -08:00