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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 DF17CC00307 for ; Fri, 6 Sep 2019 15:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B1CEE20842 for ; Fri, 6 Sep 2019 15:44:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="GOMgzAf/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405782AbfIFPoX (ORCPT ); Fri, 6 Sep 2019 11:44:23 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:38844 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbfIFPoX (ORCPT ); Fri, 6 Sep 2019 11:44:23 -0400 Received: by mail-ed1-f67.google.com with SMTP id a23so4464458edv.5 for ; Fri, 06 Sep 2019 08:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UXzffckHlrDd2GxMkcUegpxPLxQbezYI5SKZXnOnJzk=; b=GOMgzAf/lkF5c2eKwXgjCw9a3KXnWR5APRE7h0mk6NdXu79AGiO8sODfHid9N6Xl5h M/C8KT/SLLU5H1Aqg4nwEKOuTu5OkbyrUQJTErU8uVcm673iUBJEH32XMXPStUacK9QI xCMSuQrJe1j8CHQBTWz9PB+Jomp1+g+QD9Tkd9KMYHmJWFzG5xyCzw8xyfNgbLXZwkrs 5FlS9o5FS4p8okYBPzuG2ITgzJGemxFxUkm3aSbDG/x0MDmUmazIm6dOMXX9j66GMFk+ 3cLHZkaYpm/muQI+jLdcObCu1m/ydijbn1wGNoRDjuAv/Fx5CRGdTNnFLVIVNVPLSSN2 qWrA== 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=UXzffckHlrDd2GxMkcUegpxPLxQbezYI5SKZXnOnJzk=; b=V8svtINDMGmdJhTKUfaEJt2Q33E2aEzijyMPGH7g/jR/XHYPgYan3kfZ/OqJjC8B2O cH60bD/E6J88kboNK2vXtI89m6uapzpXU/JYv6erZVGe4PiLJVge9zoXB8bJWbBHs3i5 tmQfLlQJTuxV0pIgIF0/m6pg97ivmU6VEfhwki2CjiFnBcNmPqP3gl+T5yujSQZSjE5Y h/QWfORGFqDneuoqus39kp1eRw9s+6QGaV0W+u4YmVklLgssnaxxXm4NJoy6caK+De5g T16CjtTtnxCa2Rfcet/04+M/dTcDi+H9uKpTpQ3HNXAVYqtl0arp2AilVasl6LqPh/GB Feng== X-Gm-Message-State: APjAAAUOc5BUnlZxwRQUYjpQpOZHDBCW/SCoikcWntX82n6fR+hVdOUt XXkTHElY3dwlS0NtjFF9G+oTuxMHg8ApoXJK8gp+qw== X-Google-Smtp-Source: APXvYqwplMA0AW8lXkCWQuG9K8cCsGpwcuOwcj3r1h53xYTkZkNhYGGnMNAxboAR+e2euONipoiDRfZvyN8jJZQFWsM= X-Received: by 2002:a17:906:f04:: with SMTP id z4mr8127839eji.209.1567784661783; Fri, 06 Sep 2019 08:44:21 -0700 (PDT) MIME-Version: 1.0 References: <20190821183204.23576-1-pasha.tatashin@soleen.com> <20190821183204.23576-6-pasha.tatashin@soleen.com> In-Reply-To: From: Pavel Tatashin Date: Fri, 6 Sep 2019 11:44:10 -0400 Message-ID: Subject: Re: [PATCH v3 05/17] arm64, hibernate: check pgd table allocation To: James Morse Cc: James Morris , Sasha Levin , "Eric W. Biederman" , kexec mailing list , LKML , Jonathan Corbet , Catalin Marinas , will@kernel.org, Linux ARM , Marc Zyngier , Vladimir Murzin , Matthias Brugger , Bhupesh Sharma , linux-mm , Mark Rutland 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 Fri, Sep 6, 2019 at 11:17 AM James Morse wrote: > > Hi Pavel, > > On 21/08/2019 19:31, Pavel Tatashin wrote: > > There is a bug in create_safe_exec_page(), when page table is allocated > > it is not checked that table is allocated successfully: > > > > But it is dereferenced in: pgd_none(READ_ONCE(*pgdp)). > > If there is a bug, it shouldn't be fixed part way through a series. This makes it > difficult to backport the fix. > > Please split this out as an independent patch with a 'Fixes:' tag for the commit that > introduced the bug. > > > > Another issue, > > So this patch does two things? That is rarely a good idea. Again, this makes it difficult > to backport the fix. > > > > is that phys_to_ttbr() uses an offset in page table instead > > of pgd directly. > > If you were going to reuse this, that would be a bug. But because the only page that is > being mapped, is mapped to PAGE_SIZE, all the top bits will be 0. The offset calls are > boiler-plate. It doesn't look intentional, but its harmless. Yes, it is harmless otherwise the code would not work. But it is confusing to read, and looks broken. I will separate this change as two patches as you suggested. Thank you, Pasha