lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241216162735.2047544-2-brianvv@google.com>
Date: Mon, 16 Dec 2024 16:27:33 +0000
From: Brian Vazquez <brianvv@...gle.com>
To: Brian Vazquez <brianvv.kernel@...il.com>, Tony Nguyen <anthony.l.nguyen@...el.com>, 
	Przemek Kitszel <przemyslaw.kitszel@...el.com>, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	intel-wired-lan@...ts.osuosl.org
Cc: David Decotigny <decot@...gle.com>, Vivek Kumar <vivekmr@...gle.com>, 
	Anjali Singhai <anjali.singhai@...el.com>, Sridhar Samudrala <sridhar.samudrala@...el.com>, 
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org, 
	emil.s.tantilov@...el.com, Manoj Vishwanathan <manojvishy@...gle.com>, 
	Brian Vazquez <brianvv@...gle.com>, Jacob Keller <jacob.e.keller@...el.com>, 
	Pavan Kumar Linga <pavan.kumar.linga@...el.com>
Subject: [iwl-next PATCH v4 1/3] idpf: Acquire the lock before accessing the xn->salt

From: Manoj Vishwanathan <manojvishy@...gle.com>

The transaction salt was being accessed before acquiring the
idpf_vc_xn_lock when idpf has to forward the virtchnl reply.

Fixes: 34c21fa894a1 ("idpf: implement virtchnl transaction manager")
Signed-off-by: Manoj Vishwanathan <manojvishy@...gle.com>
Signed-off-by: David Decotigny <decot@...gle.com>
Signed-off-by: Brian Vazquez <brianvv@...gle.com>
Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>
Reviewed-by: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index d46c95f91b0d..13274544f7f4 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -612,14 +612,15 @@ idpf_vc_xn_forward_reply(struct idpf_adapter *adapter,
 		return -EINVAL;
 	}
 	xn = &adapter->vcxn_mngr->ring[xn_idx];
+	idpf_vc_xn_lock(xn);
 	salt = FIELD_GET(IDPF_VC_XN_SALT_M, msg_info);
 	if (xn->salt != salt) {
 		dev_err_ratelimited(&adapter->pdev->dev, "Transaction salt does not match (%02x != %02x)\n",
 				    xn->salt, salt);
+		idpf_vc_xn_unlock(xn);
 		return -EINVAL;
 	}
 
-	idpf_vc_xn_lock(xn);
 	switch (xn->state) {
 	case IDPF_VC_XN_WAITING:
 		/* success */
-- 
2.47.1.613.gc27f4b7a9f-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ