Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp459350ybl; Tue, 28 Jan 2020 06:18:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyYmNT4KtYU3WAmqHqLqqLsfnbh6CCppLr17loLztt7zmYee+C0GrCCqkbXji/yfl+8es5B X-Received: by 2002:a9d:12a8:: with SMTP id g37mr16801644otg.261.1580221113309; Tue, 28 Jan 2020 06:18:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221113; cv=none; d=google.com; s=arc-20160816; b=LKVPzgIIKAAQODfbPWruqZmeBN+1jCuEOqFndFasTn+ffsu/xWTPALLjtT3k6YzaFW w14VUIkVSYn6hFznwq3raUpkVkRM4h9WOBP5kE3ZSTjrrpG/hET1ofaeKzpWaa/UHJvj J9TQL2T/5Dzf4LRse1bn2n3qks4wHokd/F6VYt1K9/uXICTGoYonlz1PRqhDHZ506nGL FzaqY/gvT7tNXnObu7v8e6B8b17H2TXmGlMbYU+Dl0u/H9AC3ibN3HzgreeN1rteV7WL SUczYlQ+50CBrHgSaH4HhO4rObnu406bOKSsJ9OsfvTg5rtR3fSAE/s6Tnqe5+L68fwt Slyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+zi6ty2u3rbApGIWuR2QEo69ZAnNvd9Y8YhOuNhCb/A=; b=nT9sMpUvaH9MADGHPp84miTfvrmLw6SL4v+bybzgzYzA2td6YcFD+5tTS7TFfrKyGM ED25GJAACN1KZu7MsBLwES6H4BEN93uPFlMic7QOdxj8gT1lgesVlvsC6yWe1PjiCfTF dy53NObMhV3EiVDplhYXjcx8u4SB64MnCK3KP32mqDriilE6O2xi4F1s0rh417+xZ5Gs Va2Ri6e3f2KRfSQ1OnYLOCYPvI/S9yQDEl/fSoDagDiib92HEMPggSx3SjiEAIMl7h6m vqB8Ye5zXeUvLBqSgMNti2bpntP9+gz9rCO+O4MpSL5SZU+i+W5CifCE847miisSyNZK ziYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="OES/TBK/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t19si7432426oth.312.2020.01.28.06.18.20; Tue, 28 Jan 2020 06:18:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="OES/TBK/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730276AbgA1OQS (ORCPT + 99 others); Tue, 28 Jan 2020 09:16:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:39530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729729AbgA1OQQ (ORCPT ); Tue, 28 Jan 2020 09:16:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1A70B2468E; Tue, 28 Jan 2020 14:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220975; bh=ylsa5bZAYxBolvsZP5TgVEiu9DpTh5ZbjvhYTu1St6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OES/TBK/lpG7F4KozlJwV76VBKuU3Yd81F2d3rwX9GkmBJ0VsgX0WwZIiHUNSH2RF g0iJOggSl5W0OFm1RyFktFYB3R9p2KGOvhM30po+44AZVA0GGLP4tryuyj0unWReIu 1i9iHPlS+GXOscGwTg0QQCKvlUdfV1GUyLFmyDEQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gal Pressman , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.9 039/271] RDMA/ocrdma: Fix out of bounds index check in query pkey Date: Tue, 28 Jan 2020 15:03:08 +0100 Message-Id: <20200128135855.577795756@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gal Pressman [ Upstream commit b188940796c7be31c1b8c25a9a0e0842c2e7a49e ] The pkey table size is one element, index should be tested for > 0 instead of > 1. Fixes: fe2caefcdf58 ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter") Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 6af44f8db3d54..4d28bd8eff01c 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -55,7 +55,7 @@ int ocrdma_query_pkey(struct ib_device *ibdev, u8 port, u16 index, u16 *pkey) { - if (index > 1) + if (index > 0) return -EINVAL; *pkey = 0xffff; -- 2.20.1