Received: by 10.192.165.156 with SMTP id m28csp1147616imm; Wed, 11 Apr 2018 13:19:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx48GvQyF4rQmwJn1sUDa4PgTylGJefn76IEgaxLD+vlprEQS/GprLMLmmVtLZJgZB+M2gs4a X-Received: by 2002:a17:902:bf03:: with SMTP id bi3-v6mr6462936plb.368.1523477992074; Wed, 11 Apr 2018 13:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523477992; cv=none; d=google.com; s=arc-20160816; b=b4hl6444K3ilsTLfw/3XYD7G84gQZ+/9ZXnegcrRnqYEPPNorf0Qq6D4VYvrFZipOy omJf1lQAddsUBd90KCosOzPUbtmN30iZs3Vb/doT4AntngYRormyaQD32oiEPlMsgOyG vPf3nOZMbKJBJ0vSVcwyjaJeszSE/ykA9v+Gyfs9zMt38mFKe1F1VVEV7MyjoWauF8Zi txhJrMTmrcmrlddQrgOBi1W1OM/ESG2LnUPqhgd4XpW2jud0Pb1VQdQBeRW1euoLrR1W Z55pcibcCfyey0XtvOUD7C5mkkraSLkqFsnDpyuQp1NhyHVz4dUADYaqEqEK4nVHQCZt qMpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+8c7eWO9Vufvk8casUiS7oKGQ0YYaC4bxJX4FB6YylU=; b=QRSyNYRkPq28EjTx9E4hT6Q+xgxDk7sJtj2eduN+LSXDwuu63/B2Te+llT5zX56xtr 9A1mo7o4Y69TcgV5/xjsCIEsRvOQGgxqshVrLe9BL43d2WRkoMaKUP+ATDsWw8HmSE6y q4dEurQaVugbH4rbLG72cOAERPVNg3S0WNm6/dRlAxQna7fO7q2mGwZRWC/ZGjcHRBwd TOKIk5TSJhMrQQtrv/OEB150BX3h7BuUcC+6gdzj9n3B3AsVVdzQVkDhqwp+s6awFu5g RX1BDrvfgFYwzuHQJEh63lOl5Kx+WJgJ8IHUil2/UdBv1EHszGNphXo1gXbkfAeS9lhs hi+w== ARC-Authentication-Results: i=1; mx.google.com; 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 o69si1371157pfi.157.2018.04.11.13.19.15; Wed, 11 Apr 2018 13:19:52 -0700 (PDT) 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; 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 S933298AbeDKSxf (ORCPT + 99 others); Wed, 11 Apr 2018 14:53:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33828 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932401AbeDKSxd (ORCPT ); Wed, 11 Apr 2018 14:53:33 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 62A1DE70; Wed, 11 Apr 2018 18:53:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ram Amrani , Yuval Mintz , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 025/310] qed: Correct doorbell configuration for !4Kb pages Date: Wed, 11 Apr 2018 20:32:44 +0200 Message-Id: <20180411183623.377033623@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ram Amrani [ Upstream commit a82dadbce47395747824971db08a128130786fdc ] When configuring the doorbell DPI address, driver aligns the start address to 4KB [HW-pages] instead of host PAGE_SIZE. As a result, RoCE applications might receive addresses which are unaligned to pages [when PAGE_SIZE > 4KB], which is a security risk. Fixes: 51ff17251c9c ("qed: Add support for RoCE hw init") Signed-off-by: Ram Amrani Signed-off-by: Yuval Mintz Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/qlogic/qed/qed_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -850,7 +850,7 @@ qed_hw_init_pf_doorbell_bar(struct qed_h NULL) + qed_cxt_get_proto_cid_count(p_hwfn, PROTOCOLID_ETH, NULL); - norm_regsize = roundup(QED_PF_DEMS_SIZE * non_pwm_conn, 4096); + norm_regsize = roundup(QED_PF_DEMS_SIZE * non_pwm_conn, PAGE_SIZE); min_addr_reg1 = norm_regsize / 4096; pwm_regsize = db_bar_size - norm_regsize;