/[packages]/updates/8/kernel/current/SOURCES/sfc-extend-the-locking-on-mcdi-seqno.patch
ViewVC logotype

Contents of /updates/8/kernel/current/SOURCES/sfc-extend-the-locking-on-mcdi-seqno.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1795002 - (show annotations) (download)
Wed Mar 16 20:40:50 2022 UTC (2 years, 1 month ago) by tmb
File size: 1479 byte(s)
add current -stable queue
1 From 67d9c2d11508b2523445cc5f65bdbb2c32e52688 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Tue, 1 Mar 2022 23:28:22 +0100
4 Subject: sfc: extend the locking on mcdi->seqno
5
6 From: Niels Dossche <dossche.niels@gmail.com>
7
8 [ Upstream commit f1fb205efb0ccca55626fd4ef38570dd16b44719 ]
9
10 seqno could be read as a stale value outside of the lock. The lock is
11 already acquired to protect the modification of seqno against a possible
12 race condition. Place the reading of this value also inside this locking
13 to protect it against a possible race condition.
14
15 Signed-off-by: Niels Dossche <dossche.niels@gmail.com>
16 Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Sasha Levin <sashal@kernel.org>
19 ---
20 drivers/net/ethernet/sfc/mcdi.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
24 index be6bfd6b7ec7..50baf62b2cbc 100644
25 --- a/drivers/net/ethernet/sfc/mcdi.c
26 +++ b/drivers/net/ethernet/sfc/mcdi.c
27 @@ -163,9 +163,9 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
28 /* Serialise with efx_mcdi_ev_cpl() and efx_mcdi_ev_death() */
29 spin_lock_bh(&mcdi->iface_lock);
30 ++mcdi->seqno;
31 + seqno = mcdi->seqno & SEQ_MASK;
32 spin_unlock_bh(&mcdi->iface_lock);
33
34 - seqno = mcdi->seqno & SEQ_MASK;
35 xflags = 0;
36 if (mcdi->mode == MCDI_MODE_EVENTS)
37 xflags |= MCDI_HEADER_XFLAGS_EVREQ;
38 --
39 2.34.1
40

  ViewVC Help
Powered by ViewVC 1.1.30