Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFSv4: Fix a slot leak in nfs40_sequence_done

The check for whether or not we sent an RPC call in nfs40_sequence_done
is insufficient to decide whether or not we are holding a session slot,
and thus should not be used to decide when to free that slot.

This patch replaces the RPC_WAS_SENT() test with the correct test for
whether or not slot == NULL.

Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org # 3.12+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

+1 -1
+1 -1
fs/nfs/nfs4proc.c
··· 539 539 struct nfs4_slot *slot = res->sr_slot; 540 540 struct nfs4_slot_table *tbl; 541 541 542 - if (!RPC_WAS_SENT(task)) 542 + if (slot == NULL) 543 543 goto out; 544 544 545 545 tbl = slot->table;