Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp561244ybh; Wed, 11 Mar 2020 06:30:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtJhAUaCiY0iMjvwRjTDGV9aFSG4hnp0SOb61w7adzVGj3xiVrIjOXCgwKRAm+3KODpkaB0 X-Received: by 2002:a9d:8d0:: with SMTP id 74mr2391848otf.39.1583933433188; Wed, 11 Mar 2020 06:30:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583933433; cv=none; d=google.com; s=arc-20160816; b=ksuhEpT+Cpb20ovgGvQnFN4UL8+Mem0ttyQ/gnPqw9x29MwapzRYjOqci6Mr4yC11J RPDHknBXoRo/U9FuGK5RZ0nWjkdUqWne/O7fkJMUnIp6qLW73WG6L1w3BpB2dJDFPj2H aK/koMdAUcH44njN/NbQShtrFpF+KhjTa7QyGDbYfXnrWYkfxQ46pQQhl4yZYNUGInEI 7HrqNLs1W1wSAPPI7+INk3fVsaPqCNiItbBBiTN+2xsCKVmH+eQdNh5ifTCHaxV91jl1 TtbQmYlELXCWs1cvOap7tLUTjEiBd4i0oS9TX+GmKtDcNcWNOiaJdYooVozjiRpHk/BE YpNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vOEjDiH+g+D60HfQEhMY+4pmmR7oBqYbxPu62AOoIj8=; b=cJPs1qYIgMNHW29hYWTJYqkhIpHgqhuMchqBObd6KOFeXuYyUD1gzbDpZfIFrwFJ4Z QJqZsrYW48rl2ZwAiY/s44oc8H95QjqlH/5PL6zeqwD5MCb9wI86rFXom7GOkMBLDAcC y5UTVIfEV1IJQzJlfcg/3mQJeepHd+ztEbjD5h9/OBsXM8bgEQkSCl3rz9YQaOnGyAhF sRIvN0h07Y9L+xnHrvVCHde7NX4mECiE75RD6cNPbIJjM2yhxrpHmI2MoUlm9Fekyh8b +bHW1LIdLg9WaJo1ob2HJmcowkz65axaMzk3n/oDxbssh7yx8FdsEs4nKaAfpLS0qlRh z7Fg== 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 e25si1186097oth.38.2020.03.11.06.30.19; Wed, 11 Mar 2020 06:30:33 -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 S1729635AbgCKN2r (ORCPT + 99 others); Wed, 11 Mar 2020 09:28:47 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:54330 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729103AbgCKN2r (ORCPT ); Wed, 11 Mar 2020 09:28:47 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id B0E221C0317; Wed, 11 Mar 2020 14:28:45 +0100 (CET) Date: Wed, 11 Mar 2020 14:28:45 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: Pavel Machek , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ard Biesheuvel , Ingo Molnar , linux-efi@vger.kernel.org, Thomas Gleixner Subject: Re: [PATCH 4.19 84/86] efi/x86: Handle by-ref arguments covering multiple pages in mixed mode Message-ID: <20200311132845.GA24349@duo.ucw.cz> References: <20200310124530.808338541@linuxfoundation.org> <20200310124535.409134291@linuxfoundation.org> <20200311130106.GB7285@duo.ucw.cz> <20200311131311.GA3858095@kroah.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <20200311131311.GA3858095@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2020-03-11 14:13:11, Greg Kroah-Hartman wrote: > On Wed, Mar 11, 2020 at 02:01:07PM +0100, Pavel Machek wrote: > > Hi! > >=20 > > > Currently, the mixed mode runtime service wrappers require that all b= y-ref > > > arguments that live in the vmalloc space have a size that is a power = of 2, > > > and are aligned to that same value. While this is a sensible way to > > > construct an object that is guaranteed not to cross a page boundary, = it is > > > overly strict when it comes to checking whether a given object violat= es > > > this requirement, as we can simply take the physical address of the f= irst > > > and the last byte, and verify that they point into the same physical > > > page. > >=20 > > Dunno. If start passing buffers that _sometime_ cross page boundaries, > > we'll get hard to debug failures. Maybe original code is better > > buecause it catches problems earlier? > >=20 > > Furthermore, all existing code should pass aligned, 2^n size buffers, > > so we should not need this in stable? >=20 > For some crazy reason you cut out the reason I applied this patch to the > stable tree. From the changelog text: > Fixes: f6697df36bdf0bf7 ("x86/efi: Prevent mixed mode boot >corruption with CONFIG_VMAP_STACK=3Dy") I did not notice that, but reviewing f669 does not really help. If there is some known code that passes unaligned (but guaranteed not-to-cross-page) buffers here, then yes, but is it? Having not-page-crossing guarantees is kind of hard without alignment. People seem to be adding Fixes: tags even if it is not a bugfix, just as reminder that this has relation to some other commit... Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXmjnjQAKCRAw5/Bqldv6 8r46AJ95Ffup+ry6cLgiiN4zf3R8RLhDEwCglGrn3tZRdjRr2iUn+Xfck7egT7w= =tMOY -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk--