Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp579439rdb; Thu, 18 Jan 2024 12:03:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFXptwLjB/Hj+xZf79btrLHP8bOkaxVJogd3Ktm0pYH3wvPjRGZL3KG9Xoq8g38zWjXbVhH X-Received: by 2002:a17:902:82cb:b0:1d4:c4db:fd0c with SMTP id u11-20020a17090282cb00b001d4c4dbfd0cmr1267041plz.28.1705608219829; Thu, 18 Jan 2024 12:03:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705608219; cv=pass; d=google.com; s=arc-20160816; b=rAJG+QaEVZBg4oTxt5p7p/Ye22wpCVZSXyI32TQQopzb2yzaXyV8GjoHi0lZSjMCQv QH3Etk24xSs45ZjkTJA1cRtCLLMfuami8+Ag+3Hr54klK/5BNL47yu1+WDRWdg85p+Ng 0m4lkNRJhS8WRp9cYE62tMFHSzdi27KrmL+R3PwntGkpXSNooAGZnI6c7+Ls/dg6znBO p5gfs/p0wUPM4sS5FDrp3/tUwLspnFj9erYuiOMVHG/W8Y7sLFDJxslcjdZt1UYgi0gs tfjgX8r435OxaR3sKXGTe8aFAFDkycPfW3pC14eb6Tiwx/JAk2U5bMuZ6ppXVY/tja+X AB3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=6HGMe/CfTJUGDM7yuEH/5jnstGrLape2b5UIKODPCsA=; fh=xHGPeKhl28l7EqnfSF00XkmqMsyrZBVHhcbUdcmquAY=; b=XIBNX+i+1A0Da7BZ76CZsl6i1BUWR9NslX/ET7KeJTSX4FtVMRxp1UrAvZwEzV34uC S9CWR9A4IuoOl3/WFDIw8iCm3PeMumKBlVvfy2rXo3jsrZCEwUFsKuyZ4TwkgrzxjXiD 6fNHAq/vWcDwIF8KICC3np5vGYNkdTdw4gdu+irE58K1ZUePfN2h8U86/66Yb+gFVi68 XHA9ZPvQbVjyjv2s0HFXzIeaa5CoeJdIjL98fbH+TEbiRMANtPbWzEumfdTIl5jCccsh bhAL+dhPprKq8DkB9sJazDun9TZbARDsqUy9G6v1bozsq7uu7khb1cHUJ7w4kbQKsiES E96g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oS2696lf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-30542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k9-20020a170902694900b001d6ec26ea80si1855019plt.442.2024.01.18.12.03.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 12:03:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oS2696lf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-30542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 864B4B25A3E for ; Thu, 18 Jan 2024 19:57:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 464732E641; Thu, 18 Jan 2024 19:54:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oS2696lf"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Rwkb7Rkt" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33CFA2E40C for ; Thu, 18 Jan 2024 19:54:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705607687; cv=none; b=WdoqJ1ZXqucgrrUdn9yCSgJydkcsTNN7njmVCXKNwiWdlbUt5htgsp8EJKAehnsawpz5KxpqtNmT2QV0BGIJn0euPd/wMduvzO85aKzJsJGRo5tjH7WrbkISerplvjLA10Bnt86lZlno9FS9F/8HMkVQp5EQ7QgoChch7u7hkWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705607687; c=relaxed/simple; bh=o2RBJWUk5u6Z+cVADfGN1CMe6R98eLGX8cv9D9sxVLA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=NNTbh+3s5obdQd/dMOeIuxJRomredDqisSlF8orzYGGyN58S1cJuLoJ3+k9HoUcoJ/LXIRZApSNhvB6YWx9/OGz4MIxzuj6ubYRJEH4eERnYYrW+BNfMBK/vXmC2AWDFgRnaVGC9k6VjIDF/S28Dc+abNS3M+4e2LeMqoi6Du8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=oS2696lf; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Rwkb7Rkt; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705607684; 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: in-reply-to:in-reply-to:references:references; bh=6HGMe/CfTJUGDM7yuEH/5jnstGrLape2b5UIKODPCsA=; b=oS2696lfos7HlRbjOOt/lU5YACb4ptBkSdZD7Qg3Eag9LdXVMXL5QJ9YopoVqzpBNmqftP jY2IaiJlUjTzhNwJ+I/zcRYAGdpdojMnElvnNLmFe6FFgEDlicM8j6Qp8WQyRHZQOlNU6f ylQoq9Ej9xhr3rVp5gadSPnzjvEI1Rz5lZGtjbEZlI0Lkgp2c+Il8/vV1Ne4Hkv8tWxUj+ EsEzbbxU8U1iQtfpDbHnuTUGzwkFEbqzHN1U6UdqL9l9uLZc+0YNaJJ9Fn9ifincIOu4QQ CMcJ716IRDTsCrgeekB7SCSVN1MJEzpMZJiAtY8fK9q+Ca91xXngDguNf+Sq2A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705607684; 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: in-reply-to:in-reply-to:references:references; bh=6HGMe/CfTJUGDM7yuEH/5jnstGrLape2b5UIKODPCsA=; b=Rwkb7RktpERo6eUhVLq2oXVHo+ZKnjP2E7Mx19dgY1THHk8Pox6t/t4Dp4EEWCKhX40GTJ ygL8VUNGPnUaGSCQ== To: Dave Hansen , Andrei Vagin Cc: Andrei Vagin , Ingo Molnar , Borislav Petkov , Dave Hansen , LKML , x86@kernel.org, "H. Peter Anvin" Subject: Re: [PATCH] x86/fpu: verify xstate buffer size according with requested features In-Reply-To: <54bcb902-0fab-4a53-8b8e-85b6e4484b03@intel.com> References: <20240116234901.3238852-1-avagin@google.com> <30cd0be4-705f-4d63-bdad-fc57301e7eda@intel.com> <54bcb902-0fab-4a53-8b8e-85b6e4484b03@intel.com> Date: Thu, 18 Jan 2024 20:54:43 +0100 Message-ID: <87cytyfmd8.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Thu, Jan 18 2024 at 10:27, Dave Hansen wrote: > If we have nice, reliable fault handling and then decide that we've got > XRSTOR's running amok reading random memory all over the place that need > a nicer error message, then we can add that code to predict the future. > If our "predict the future" code goes wrong, then we lose an error > message -- not a big deal. After staring more at it, it's arguable to pass fpstate->user_size to fault_in_readable() and ignore fx_sw->xstate_size completely. That's a guaranteed to be reliable size which prevents endless loops because arguably that's the maximum size which can be touched by XRSTOR, no? Thanks, tglx