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: <20250616054504.1644770-2-alok.a.tiwari@oracle.com>
Date: Sun, 15 Jun 2025 22:45:01 -0700
From: Alok Tiwari <alok.a.tiwari@...cle.com>
To: pabeni@...hat.com, kuba@...nel.org, jeroendb@...gle.com,
        hramamurthy@...gle.com, andrew+netdev@...n.ch, davem@...emloft.net,
        edumazet@...gle.com, netdev@...r.kernel.org, almasrymina@...gle.com,
        bcf@...gle.com
Cc: alok.a.tiwari@...cle.com, linux-kernel@...r.kernel.org,
        ziweixiao@...gle.com, joshwash@...gle.com, willemb@...gle.com,
        pkaligineedi@...gle.com
Subject: [PATCH 2/2] gve: Return error for unknown admin queue command

In gve_adminq_issue_cmd(), return -EINVAL instead of 0 when an unknown
admin queue command opcode is encountered.

This prevents the function from silently succeeding on invalid input
and prevents undefined behavior by ensuring the function fails gracefully
when an unrecognized opcode is provided.

These changes improve error handling.

Signed-off-by: Alok Tiwari <alok.a.tiwari@...cle.com>
---
 drivers/net/ethernet/google/gve/gve_adminq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/google/gve/gve_adminq.c b/drivers/net/ethernet/google/gve/gve_adminq.c
index e93e564f3e65..a7b21cea27da 100644
--- a/drivers/net/ethernet/google/gve/gve_adminq.c
+++ b/drivers/net/ethernet/google/gve/gve_adminq.c
@@ -564,6 +564,7 @@ static int gve_adminq_issue_cmd(struct gve_priv *priv,
 		break;
 	default:
 		dev_err(&priv->pdev->dev, "unknown AQ command opcode %d\n", opcode);
+		return -EINVAL;
 	}
 
 	return 0;
-- 
2.47.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ