Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp237471pxb; Fri, 3 Sep 2021 00:42:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBc2jOOO8lKqJCW36mq4jB/+rxwtRt+T+bhIQISCBkd0NXOSThO/1ikxSYf1hCBkXO52it X-Received: by 2002:a02:294b:: with SMTP id p72mr1619952jap.0.1630654941654; Fri, 03 Sep 2021 00:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630654941; cv=none; d=google.com; s=arc-20160816; b=Z18fSf+DQKN0JAItGoWvhy4LZbqSZkxaYYeA5sQ9pYIQ3i2GS14JMtWyA50aybqyU9 2doX6XS3U/1FnYLxWMPR1+t+L5SUhKKjuroycqtNWptYzYK6e4XpTj/vD40/VH8TOY5/ QvEdwEvxhn/GQ+T7okMHdUWvfqnPVA/7+oFeCY+SuGLdFFHPX0aLqidhWt7GCjpny4cC 0H0IZzMvU9Xn8SsPrw1+TnWdNxuvnDKveJNZdbHaWrFXp0dIeZHv5ZvF78BOI+ZqCYvq VrccHMv40/TUzzazINOhrb0ORdFB3Mnyu1HbpWOXWH1bjjvCiv/Wtcjx0xuHs/1xTuSG uoMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nXpHDCr8cLHm+6UV873Vrc2L1Ua41P2WoKc+tjvXO4Q=; b=TOZLZQRtiOH5A2CfkmxAnBmg3c2WdsxWoALa7sBY0cImx3aTwnvPMVDhFCdNMNn6bf zGlZJMepWccGuq0wMmNL0V3Hu5rSHiRvEKjB1OpBx1SlA7aX1P02dH7i9wQkzNS+XBBb /dfP36vLbAEXxibB7aoEhs8wno0T4tlUYr/tQ7VVye8StIQL5gYA8dysRcALeAWtlAP3 +Vgtey/+IKBdT1abvuThiyygkNh3M3D8JIwbqvNRyEMFWJySuMm23TAm1AW4zQDq41J3 edtGVuQkyquwQfhw2i580VhbiOp+YUyTDzhUsu0qdEOiJwwzV5ol9C77WwcVCdL+x/iZ 8mRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 13si5322567jan.43.2021.09.03.00.42.10; Fri, 03 Sep 2021 00:42:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347411AbhICGvi (ORCPT + 99 others); Fri, 3 Sep 2021 02:51:38 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:55948 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347344AbhICGvh (ORCPT ); Fri, 3 Sep 2021 02:51:37 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id BE5AE1C0B7F; Fri, 3 Sep 2021 08:50:36 +0200 (CEST) Date: Fri, 3 Sep 2021 08:50:35 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Gerd Rausch , Santosh Shilimkar , Jakub Kicinski , Sasha Levin Subject: Re: [PATCH 4.9 12/16] net/rds: dma_map_sg is entitled to merge entries Message-ID: <20210903065035.GA11871@amd> References: <20210901122248.920548099@linuxfoundation.org> <20210901122249.305212889@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <20210901122249.305212889@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > [ Upstream commit fb4b1373dcab086d0619c29310f0466a0b2ceb8a ] >=20 > Function "dma_map_sg" is entitled to merge adjacent entries > and return a value smaller than what was passed as "nents". >=20 > Subsequently "ib_map_mr_sg" needs to work with this value ("sg_dma_len") > rather than the original "nents" parameter ("sg_len"). >=20 > This old RDS bug was exposed and reliably causes kernel panics > (using RDMA operations "rds-stress -D") on x86_64 starting with: > commit c588072bba6b ("iommu/vt-d: Convert intel iommu driver to the iommu= ops") >=20 > Simply put: Linux 5.11 and later. I see this queued for 4.19 and 5.10 where "iommu/vt-d: Convert intel iommu driver to the iommu ops" is not present. It may be okay for older kernels, too, but I wanted to double-check. Best regards, Pavel > +++ b/net/rds/ib_frmr.c > @@ -112,9 +112,9 @@ static int rds_ib_post_reg_frmr(struct rds_ib_mr *ibm= r) > cpu_relax(); > } > =20 > - ret =3D ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_len, > + ret =3D ib_map_mr_sg_zbva(frmr->mr, ibmr->sg, ibmr->sg_dma_len, > &off, PAGE_SIZE); > - if (unlikely(ret !=3D ibmr->sg_len)) > + if (unlikely(ret !=3D ibmr->sg_dma_len)) > return ret < 0 ? ret : -EINVAL; > =20 > /* Perform a WR for the fast_reg_mr. Each individual page --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --YiEDa0DAkWCtVeE4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmExxbsACgkQMOfwapXb+vIokACfWIp9qI4rPFIGtWVW2efztgjx 5mgAn3I6yh7BljGER3XX9UJQgWCG3aKb =7bBt -----END PGP SIGNATURE----- --YiEDa0DAkWCtVeE4--