From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE7DC33CB1 for ; Sat, 18 Jan 2020 13:37:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB5BE24696 for ; Sat, 18 Jan 2020 13:37:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="EY3A6DSL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729091AbgARNha (ORCPT ); Sat, 18 Jan 2020 08:37:30 -0500 Received: from mail-qv1-f66.google.com ([209.85.219.66]:44612 "EHLO mail-qv1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727162AbgARNh3 (ORCPT ); Sat, 18 Jan 2020 08:37:29 -0500 Received: by mail-qv1-f66.google.com with SMTP id n8so11983188qvg.11 for ; Sat, 18 Jan 2020 05:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VF7Ybre9nicDdkbJ8YLCx9ZGXACXxQfpsesRhP5xc4k=; b=EY3A6DSLTKp1/kz1PrlGIeXEHIfZ+oH6MwVnlkr7xQTR3QolUfLzcrf937teMuKRrb zujAJVMsdgkbQFnO7cdoFfEDSmlT6jfMb9+hqE49E2xj6fg4AzURPCHdn/fCXSbXhwEJ yTxjNPWuM83IaBXYefWXukRwVW8We1HyswaRf+1gQ6WUlu+ntdM8jfDaSvHUA5QTaXe9 ZSbr9yOKCstPniXl7afwYigPQOdWs3y8vaqUVQeu7emu2B+C/jljkfi9d2e9Bv/JVoBz s7xJnj4qdvZpwBrajm/Kd4AIsI8+9J48hr/ks/cqpU7LVTZ9YjpJ/sv0HCRQpfN3OnmO o3JA== 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=VF7Ybre9nicDdkbJ8YLCx9ZGXACXxQfpsesRhP5xc4k=; b=GG/uBXneBleBQjh1wQcL6JsX3Zf12TJ96vdJxg+3LjYBUy3OYqq/FONDxXYakGpXUz Hx+421bhq3/eYgRhRXOC6QPRF9twu0+reqpia6Zwghegdup4XAnzvz8lfbmDQ1gezw/X 2YnDy1lX+dzeBHTcdYzGMUsWLyN2oiY4r4FtSSouEmYyhipg/2gwwgFVVTrJV6Blky+S MmEHNpUUJcIpp4/ag0SPe9y8MACKGP0u8DirxkfgEw4u7A7L6kL2cwIE1nsB22To1eUL CzV+/nu1UTA2NHfzLTMKomhaf6B5+S+M/g8BFQ19lxo5Q2jtsBgPCwTeh4n+igZzwTNL J/Ag== X-Gm-Message-State: APjAAAU3bV4M+4qXfDb9TBcsIk49FAs+kPza9jHdtqPRobLcCKgj2iW9 C6YcEUVPtA7BmMF/6sOgbZYsYegfoYTdH9ZyxujbFA== X-Google-Smtp-Source: APXvYqwYblXYgB6+GHPK1LDSZMKjsXLHY5pS/MY8CjPumGXuzkIwxuXY7SK9oa8eOhjw5iioY3V40KhDw4njeWh5CLo= X-Received: by 2002:a05:6214:1103:: with SMTP id e3mr12426686qvs.159.1579354648459; Sat, 18 Jan 2020 05:37:28 -0800 (PST) MIME-Version: 1.0 References: <934E6F23-96FE-4C59-9387-9ABA2959DBBB@lca.pw> In-Reply-To: From: Dmitry Vyukov Date: Sat, 18 Jan 2020 14:37:17 +0100 Message-ID: Subject: Re: [PATCH -next] x86/efi_64: fix a user-memory-access in runtime To: Ard Biesheuvel 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, 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.