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=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 CD846C433E6 for ; Tue, 23 Mar 2021 17:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4304619C7 for ; Tue, 23 Mar 2021 17:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbhCWRGk (ORCPT ); Tue, 23 Mar 2021 13:06:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39159 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbhCWRGZ (ORCPT ); Tue, 23 Mar 2021 13:06:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616519184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fjHx4YqqWT4jRpiy21F/4VchU5onhpYM5ZCEE4eX3QA=; b=NZPQ/moMw131oh6GfgyD0XFofmVelNmmizhyH6nP2YccW1Th36ZUvsv7XubYLouy3Rp+8N 2Rxi/p3geW3cJtNRi8FwZtf2/Gi9125t7x/VvzXHgZUJzPqY+J+nyhlRsHDa+Raen3Rh0Y UU3tO0BmjgSKqW03CtXtelqq9o21Nqc= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-371-aPYmHkMtNKqDclpJkyQdJw-1; Tue, 23 Mar 2021 13:06:22 -0400 X-MC-Unique: aPYmHkMtNKqDclpJkyQdJw-1 Received: by mail-wr1-f70.google.com with SMTP id h21so1363912wrc.19 for ; Tue, 23 Mar 2021 10:06:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fjHx4YqqWT4jRpiy21F/4VchU5onhpYM5ZCEE4eX3QA=; b=IzRa2wJuM/Jx35WH0GM9nYqi8x+qB7FrVJwIBfmCq8U+k43ZdibLw37spjaW0Ptdsd Y9jT1p58xec0ZKr77bk82/mXhWWB+KKTmXtELm7CZEoLxMAsV3/48Esf6Y6bzw5FWiwz 5da5Y5bXovoI1h0uyT1VdzD5N1WqNeSN6COyeYXfdqlRBVzCuS1X5Z9GY2k7YKT2401w TWsgfyNjUOcagJpv2xKzcXu9U3obJV7qBOqhxklM8L1bfNJdhvCNnqEijejky9E1Yq/M K9YE6/qkDtUgmPP/uGikQn4tnzWcWolxa2msMv8a0Y7b0lyUVcOH1jJIWqk/bvqPnEt7 Ob5A== X-Gm-Message-State: AOAM532DcKUIGzTKKYQ8L6m8jAwy1Fz/g/nPpO+g6ZG6vUk9rZqENadY iaQ+ijSRxi3wymNapzk8dz+jX8Xs0iX+BwRuhIQS9qHTR4uA3A0ZtwJw6iFeCmDoCZ1goNkf9hW QoLtJM8aNKRqlm2FMG79hZWnf X-Received: by 2002:a05:600c:4410:: with SMTP id u16mr4229750wmn.174.1616519181650; Tue, 23 Mar 2021 10:06:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyotb4LNeNf75U1fuOq54/VPcBZtHl/Lh33p5sPHaEyqCaTmUbKH7AZxpPK8zNuZdZ8ptethg== X-Received: by 2002:a05:600c:4410:: with SMTP id u16mr4229733wmn.174.1616519181478; Tue, 23 Mar 2021 10:06:21 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u2sm24717945wrp.12.2021.03.23.10.06.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Mar 2021 10:06:20 -0700 (PDT) Subject: Re: [PATCH v3 03/25] x86/sgx: Wipe out EREMOVE from sgx_free_epc_page() To: Sean Christopherson Cc: Borislav Petkov , Kai Huang , kvm@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, jarkko@kernel.org, luto@kernel.org, dave.hansen@intel.com, rick.p.edgecombe@intel.com, haitao.huang@intel.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com References: <20210322191540.GH6481@zn.tnic> <20210322210645.GI6481@zn.tnic> <20210323110643.f29e214ebe8ec7a4a3d0bc2e@intel.com> <20210322223726.GJ6481@zn.tnic> <20210323121643.e06403a1bc7819bab7c15d95@intel.com> <20210323160604.GB4729@zn.tnic> <41dd6e78-5fe4-259e-cd0b-209de452a760@redhat.com> From: Paolo Bonzini Message-ID: <5d5eacef-b43b-529f-1425-0ec27b60e6ad@redhat.com> Date: Tue, 23 Mar 2021 18:06:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/03/21 18:02, Sean Christopherson wrote: >> That's important, but it's even more important *to developers* that the >> commit message spells out why this would be a kernel bug more often than >> not. I for one do not understand it, and I suspect I'm not alone. >> >> Maybe (optimistically) once we see that explanation we decide that the >> documentation is not important. Sean, Kai, can you explain it? > > Thought of a good analogy that can be used for the changelog and/or docs: > > This is effectively a kernel use-after-free of EPC, and due to the way SGX works, > the bug is detected at freeing. Rather than add the page back to the pool of > available EPC, the kernel intentionally leaks the page to avoid additional > errors in the future. > > Does that help? Very much, and for me this also settles the question of documentation. Borislav or Kai, can you add it to the commit message? Paolo