From nobody Thu Oct 30 05:35:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525371942564119.19773551097205; Thu, 3 May 2018 11:25:42 -0700 (PDT) Received: from localhost ([::1]:58188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEIvD-0006Lo-Qb for importer@patchew.org; Thu, 03 May 2018 14:25:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEIqg-0002Cd-Ay for qemu-devel@nongnu.org; Thu, 03 May 2018 14:20:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEIqd-0008KW-Dw for qemu-devel@nongnu.org; Thu, 03 May 2018 14:20:58 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEIqd-0008KD-6Q for qemu-devel@nongnu.org; Thu, 03 May 2018 14:20:55 -0400 Received: by mail-wm0-x243.google.com with SMTP id x12-v6so4002739wmc.0 for ; Thu, 03 May 2018 11:20:55 -0700 (PDT) Received: from localhost.localdomain ([176.228.154.53]) by smtp.gmail.com with ESMTPSA id w40-v6sm24388801wrc.69.2018.05.03.11.20.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 11:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ojgag965UT8BmFHQ/Il9VOxooSgGEKX3C/EHZjxN2jY=; b=SnULPjzqGzIogHLyGGuHhU6DCW8WGXVRY2tE8BfRsuGRExEeUjT7LJiMn5dEJTcJL1 9p9Gj7aBXK/pqoQq3UOAdKmW1Whi3TmIKpmS3PMkqgPLaya36VJ48e0y3R2MVdyzP1Ws Dm2wyD2fvG3rOsaCjwkuCcgtJpDN0MPfC1J/HyssLHnTKnPy6nSy63oj0cHAGiU2uAny TRyN4BiQmA8HTs3gDc6ehaR9pi3RoxVZCSqWwU2RMEGCVwewXMCRyvuTSwiSG+5B+UfD 5hcwTX/4Zyw3Ss/TRR8m+nqNie6raGGfQiYjfOicWMvxFcCjXaFrfjGB4JUwck61kYkI ak9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ojgag965UT8BmFHQ/Il9VOxooSgGEKX3C/EHZjxN2jY=; b=j54gmOoQxAZPJre4+/6k3MurQtpFHIoF5INa2O1/Dr8M5dI/bZA6Nf35O8I+acCl+P PJQKiLZ9csT+lAZWS9K3Sj4W/ag3+TBv24rNsrk61UvNOfWJMFnR36dMUwSUmpPDzp/K u2Zr2bmKNu96cA1tjRQMMuUwOCBa4Y6GAdBFMkaJWzm445QyUipMcj+zZu/ZHYHvrYtG Jb+5niER3kb0pA3Lsw3ZIbKlE+BxQosaWWmLKIdVjJFptojYZwAsJOjaxYyCyAgHABbe GRbKRH9WqgfTsEQSwA+501V3s4BRq9sVzQ9oDQUbTZ0tOwa9yzOgRQnfoErq0RZB4mIV +JXQ== X-Gm-Message-State: ALQs6tBocMQjg5p6vQGXNDTZJD2AT/w1ZmoowIO7qkv393oh1tb6VI8X j0gWVmrKDi2MHCxr5eGUQN/3aQ== X-Google-Smtp-Source: AB8JxZpkfm7cTzwE1t38lurZ7YhXMW0dUAxOnN2CWXfLY86DDFbp2B7m8QBENjci6isGAu1Q5k8DzA== X-Received: by 10.28.113.81 with SMTP id m78mr15924242wmc.150.1525371653998; Thu, 03 May 2018 11:20:53 -0700 (PDT) From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 3 May 2018 21:21:24 +0300 Message-Id: <20180503182125.20310-8-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180503182125.20310-1-marcel.apfelbaum@gmail.com> References: <20180503182125.20310-1-marcel.apfelbaum@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PULL 7/8] hw/rdma: Fix possible out of bounds access to port GID index X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, yuval.shaia@oracle.com, f4bug@amsat.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Make sure the backend GID index is less then port's gid table length. Signed-off-by: Marcel Apfelbaum Reviewed-by: Yuval Shaia Message-Id: <20180430200223.4119-8-marcel.apfelbaum@gmail.com> --- hw/rdma/rdma_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index 5c7b3d8949..e9ced6f9ef 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -774,7 +774,7 @@ int rdma_backend_init(RdmaBackendDev *backend_dev, goto out_destroy_comm_channel; } =20 - if (backend_dev->backend_gid_idx > port_attr.gid_tbl_len) { + if (backend_dev->backend_gid_idx >=3D port_attr.gid_tbl_len) { error_setg(errp, "Invalid backend_gid_idx, should be less than %d", port_attr.gid_tbl_len); goto out_destroy_comm_channel; --=20 2.14.3