]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Correct doorbell configuration for !4Kb pages
authorRam Amrani <Ram.Amrani@cavium.com>
Tue, 9 May 2017 12:07:50 +0000 (15:07 +0300)
committerChuck Anderson <chuck.anderson@oracle.com>
Tue, 19 Sep 2017 05:32:06 +0000 (22:32 -0700)
Orabug: 26783820

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 <Ram.Amrani@cavium.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ Upstream commit a82dadbce47395747824971db08a128130786fdc ]
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
drivers/net/ethernet/qlogic/qed/qed_dev.c

index de0d67ad54debfa348ecc66db727713d59e44018..f76af06e61d1c8b0f2c3a81c1ccf399ddd3de5e0 100644 (file)
@@ -1345,7 +1345,7 @@ qed_hw_init_pf_doorbell_bar(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt)
                                                   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;