diff options
| author | Baptiste Lepers <[email protected]> | 2021-05-01 04:10:51 +0000 |
|---|---|---|
| committer | Trond Myklebust <[email protected]> | 2021-05-01 23:42:14 +0000 |
| commit | f8f7e0fb22b2e75be55f2f0c13e229e75b0eac07 (patch) | |
| tree | e0c29141e3a872cc35cdb8d12f7381476aea3e70 /drivers/firmware/psci/psci.c | |
| parent | NFSv4.2: Remove ifdef CONFIG_NFSD from NFSv4.2 client SSC code. (diff) | |
| download | kernel-f8f7e0fb22b2e75be55f2f0c13e229e75b0eac07.tar.gz kernel-f8f7e0fb22b2e75be55f2f0c13e229e75b0eac07.zip | |
sunrpc: Fix misplaced barrier in call_decode
Fix a misplaced barrier in call_decode. The struct rpc_rqst is modified
as follows by xprt_complete_rqst:
req->rq_private_buf.len = copied;
/* Ensure all writes are done before we update */
/* req->rq_reply_bytes_recvd */
smp_wmb();
req->rq_reply_bytes_recvd = copied;
And currently read as follows by call_decode:
smp_rmb(); // misplaced
if (!req->rq_reply_bytes_recvd)
goto out;
req->rq_rcv_buf.len = req->rq_private_buf.len;
This patch places the smp_rmb after the if to ensure that
rq_reply_bytes_recvd and rq_private_buf.len are read in order.
Fixes: 9ba828861c56a ("SUNRPC: Don't try to parse incomplete RPC messages")
Signed-off-by: Baptiste Lepers <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Diffstat (limited to 'drivers/firmware/psci/psci.c')
0 files changed, 0 insertions, 0 deletions
