Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp534838ybl; Sat, 18 Jan 2020 05:42:30 -0800 (PST) X-Google-Smtp-Source: APXvYqwGHancJopGWox89b9bwDP6P9h/Psmwpl8NUV/FAu2ifMcPt5NPW9iaR2PIS+ybZfdLuYNW X-Received: by 2002:a9d:6505:: with SMTP id i5mr9242687otl.121.1579354949631; Sat, 18 Jan 2020 05:42:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579354949; cv=none; d=google.com; s=arc-20160816; b=M1pVYHLczRmsdafYYGOpA1p+lu0KBeAmtvcBmt7oaFwCyuYtqf0JXPGkhXFKyQrlXp t4iEmm+u3OPaAgNqv79aStpUMB51D1kgWPEiUaPjMugFBHNiK1vElZxZgJ4kWVu/uFoH LIcMPkm2K6sn1phQi5+MF8FW4UZ7uEBW1KbOK3EXIx7D5K8TGVCBZux1xC7nlBQJ3lon jhLkPCu4oV0/5q/R7/vEfj6lxL+mUILF7TWbw83PBmUgUkY4/zAOr5L4tkxtZCzS9kuB B0gXVcl5wYOZawll4HAJkUt5pT9IhNYvQNiW4SfK1EtE4/qhsO2/XcDJOOHIbauQufBP UbPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wFe6n4FQHA1VOWCd6CGPk+kxacT5cKq8IuN+p1i7TQU=; b=DpJjIyX9WU4MolczBbuoTf6KgtbW4UqDbph6c+zQxjXIibr+DyDtWLBpkoZlzfov/A LLotfmTKhkQmRmjL92VAZg3/az6LbTSFiqYKsMxWeI8IwV3KFyOKPHMgA4wkaXjIJ50/ /FTYbT0GytDRjbW8zFMFNRmgr8H/JfdSB71h1gmhWpOJboQ+3hXUL/a4Epov62jR6gfU FvrIrvnBbcPY1byiO7eBScaPpCeUGguLrFWWgZm8MC68BcNcr+yunBT5zJmOJAIe7CqO yWQgYgVvSEeljWUwUWhoGC1K0LDSDc4CkxHLN5kCW2itoam35IiNbEnXViiI+O7wb1DD HtdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nFG8dNHB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m67si14798866oib.117.2020.01.18.05.42.17; Sat, 18 Jan 2020 05:42:29 -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=@linaro.org header.s=google header.b=nFG8dNHB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728783AbgARNlW (ORCPT + 99 others); Sat, 18 Jan 2020 08:41:22 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46278 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbgARNlV (ORCPT ); Sat, 18 Jan 2020 08:41:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id z7so25191745wrl.13 for ; Sat, 18 Jan 2020 05:41:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wFe6n4FQHA1VOWCd6CGPk+kxacT5cKq8IuN+p1i7TQU=; b=nFG8dNHBdZVhq3lvwz+Ep/QRxaLzhWkpPsocSLSZtiWyPnHgy4DxZAO/r0wabt48hY m+c0Pk3kfEXm2iSHTYvTojcKPmm4P37by8jfTxv3lNUZWF8NnX+67zdHqd4YflzbSdoW n8Af3utWqYpeR/zY9UIDnxiQfKZffkduDaswsivVMbqUiwMcAdwo1qGaLeoA/tGLbhcQ WpR04wcFwqexpVNpBcaVmmd7agjQ1ldiELpyoFazZIm2KVzyOjXyHDvLg5ARcwweBo9t ed8v6jByNQhZWYR9xaof4u4stupgr1Uj0ySvV9MsNp5ukKo1dra3itOyaqMtH4hBFked uL6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wFe6n4FQHA1VOWCd6CGPk+kxacT5cKq8IuN+p1i7TQU=; b=Drs1q2WlGPX8H4V1DBVirRchBihBTi3LIsBx+UWCzH0obS3cO0XJef2ZBxs0HXwo9D Rp2tR8+4Cmekh+xD+5axWDRmDcCln0Uxlei1QSOCFy19CMf1V3p8b37oWfKbOiPISsot Dnnpjy0dz6ahNDlIVfonwqwiMxs5e97S9tTWruHMm0ipsoQnzOv4XkwgZtjMW5WZdNnm /3rpbMPb/FfxdMSV212xWSI07ZZnDJdXvVi5RgYitXMA/+5QuJoGpQs9/pfgTLgEkC38 mn30LT1KRosgZf8d+eOpFNaFtgIoVB6ITrw33jK1SdR92owt6CjXxQufciVbOCJNs4dd 9gbA== X-Gm-Message-State: APjAAAUHiwjzCzrxFFH5quGjzdMikBmQo5ubd+3C1m52DTJ1G90n8yTh JdncxBQF7bzSu9jyW8bWL9uI9nZuRUQg6DpV9HpP7g== X-Received: by 2002:adf:fe86:: with SMTP id l6mr8723881wrr.252.1579354880364; Sat, 18 Jan 2020 05:41:20 -0800 (PST) MIME-Version: 1.0 References: <934E6F23-96FE-4C59-9387-9ABA2959DBBB@lca.pw> In-Reply-To: From: Ard Biesheuvel Date: Sat, 18 Jan 2020 14:41:09 +0100 Message-ID: Subject: Re: [PATCH -next] x86/efi_64: fix a user-memory-access in runtime To: Dmitry Vyukov Cc: Qian Cai , Ard Biesheuvel , Ingo Molnar , kasan-dev , linux-efi , Linux Kernel Mailing List 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 On Sat, 18 Jan 2020 at 14:37, Dmitry Vyukov wrote: > > On Sat, Jan 18, 2020 at 2:35 PM Ard Biesheuvel > wrote: > > > > On Jan 18, 2020, at 3:00 AM, Ard Biesheuvel wrote: > > > > > > > > Can't we just use READ_ONCE_NOCHECK() instead? > > > > > > My understanding is that KASAN actually want to make sure there is a no dereference of user memory because it has security implications. Does that make no sense here? > > > > Not really. This code runs extremely early in the boot, with a > > temporary 1:1 memory mapping installed so that the EFI firmware can > > transition into virtually remapped mode. > > > > Furthermore, the same issue exists for mixed mode, so we'll need to > > fix that as well. I'll spin a patch and credit you as the reporter. > > If this code runs extremely early and uses even completely different > mapping, it may make sense to disable KASAN instrumentation of this > file in Makefile. The routine in question runs extremely early, but the other code in the file may be called at any time, so this is probably not the right choice in this case.