Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1521411pxb; Wed, 20 Oct 2021 06:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw47/xIc4I4sSSts+yde9Lwl1GxireB06aTYmuSTboLZD7tHHl8MTA6bHYel7bRY87ZmHNv X-Received: by 2002:a17:90b:4f90:: with SMTP id qe16mr101435pjb.137.1634737671739; Wed, 20 Oct 2021 06:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634737671; cv=none; d=google.com; s=arc-20160816; b=JI58O8n9aCNWb81m+dpxNHQV7Ot5WixCU8EUC28hnm0dG6nGWqUaFggaHWQwrZNnZk bacs5Ot/9r8Zgik8fm73v1q8NkERMFRpUM5sAjvFyR7Tmj//XWUPGZHJHESoyBOSoHlb 0uW21Fw8fEQIko+Qnb7oLr+8eP23Qtk7iQJHYBoI+FYWoKbRMEK2OfVtVKtZ/EWJsSvk +4O3/M3Kr2YVPR3DPEWisifUdDpQjgMZcuCKYCLMaXUa3TsX3CWIRjfeidLZXFCRzfZV LfRySludz0IaFn433BZQkp2BIP2jOrPc6WApaqrq9Htd0cIyARhsLBGR/a2KoMvtGQtQ L+ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=LQcz641ODK++EIhBMzSeRggo5AqXnf2CAZe1Q8ihmCs=; b=mgKE79TRMjZWUf4nlYmxRKc7WJ1FSexBlLxz2VIs55vXIy71QnwdlXmUy6X736tmLX 2Umz+lYfPZV2DNj12s0ndCZP9JYymSkevDFMQam62ShZeoPwYUNJTx+3SWhWH/QHfJoy Qm/cPkzucphLfi4c2ut/JPjk2SdX5bpKDRkL5RDiUyr8+UQwvyfLjLVmOlGjDiHkyuBY dmvfgqi8EmqyW+mUxzGG9n/c13t8p5IaJZToMZeJ1p903APJfJsPUCmbvnWs8zdDEpoe NerFG3MCCNXiZZRQw6oJ1LeGYb2aYNdZPokdGtbjHocPPnR+grWbv3jEr+aoxlRjo67I MwbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=a9HZgPXP; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ugrOQc3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f126si2669338pgc.540.2021.10.20.06.47.38; Wed, 20 Oct 2021 06:47:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=a9HZgPXP; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ugrOQc3T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbhJTNsY (ORCPT + 99 others); Wed, 20 Oct 2021 09:48:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230365AbhJTNr1 (ORCPT ); Wed, 20 Oct 2021 09:47:27 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C9B9C061772; Wed, 20 Oct 2021 06:44:45 -0700 (PDT) Date: Wed, 20 Oct 2021 13:44:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634737483; h=from:from:sender:sender:reply-to: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=LQcz641ODK++EIhBMzSeRggo5AqXnf2CAZe1Q8ihmCs=; b=a9HZgPXPDkBDDd6qNVGNP3dqHGTa3Lzj0QyRi0PB8yp5k1m4ZHB6rmpEcf1mk8slAvUsGO jBNID3sd8w26sXt9o7Fj/ni++3yYKYfr7T90/ydrI308MjeidarlzCbA8okJefNu5hbZqc NILMPWfs8Gio5ZYMf2jbGT6d+H6b51POKHoTFiY56RESzKkRqffV2vwyY6j1Rb+YnYZliv SIsdVbhIEIZN3AAb4rQTcB/AZjkKZtiBxJFYf9EQkKbh8cDYRZvgil4rSq34JUDvEjXY8M nRm7ErCbuFJ/X72K1EH3dg6JnEIDCOlImcc4EQzugonZVO7vJ1qXHZ9LfmO9UA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634737483; h=from:from:sender:sender:reply-to: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=LQcz641ODK++EIhBMzSeRggo5AqXnf2CAZe1Q8ihmCs=; b=ugrOQc3TgK5vD8piFbFKvKPkWAFkpE7wveclhwlr4bYhBTsTnnPd265Td5Lr0NvFucXJoX mZ8u1sLB+CXOXhCA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fpu] x86/fpu: Remove pointless memset in fpu_clone() Cc: Thomas Gleixner , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20211015011538.722854569@linutronix.de> References: <20211015011538.722854569@linutronix.de> MIME-Version: 1.0 Message-ID: <163473748299.25758.1764135013570035920.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/fpu branch of tip: Commit-ID: 01f9f62d3ae75077a54a11d2777082f1e58e2d9f Gitweb: https://git.kernel.org/tip/01f9f62d3ae75077a54a11d2777082f1e58e2d9f Author: Thomas Gleixner AuthorDate: Fri, 15 Oct 2021 03:16:02 +02:00 Committer: Borislav Petkov CommitterDate: Wed, 20 Oct 2021 15:27:26 +02:00 x86/fpu: Remove pointless memset in fpu_clone() Zeroing the forked task's FPU registers buffer to avoid leaking init optimized stale data into the clone is a pointless exercise for the case where the current task has TIF_NEED_FPU_LOAD set. In that case, the FPU registers state is copied from current's FPU register buffer which can contain stale init optimized data as well. The alledged information leak is non-existant because this stale init optimized data is used nowhere and cannot leak anywhere. Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211015011538.722854569@linutronix.de --- arch/x86/kernel/fpu/core.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c index 7ada7bd..191269e 100644 --- a/arch/x86/kernel/fpu/core.c +++ b/arch/x86/kernel/fpu/core.c @@ -260,12 +260,6 @@ int fpu_clone(struct task_struct *dst) return 0; /* - * Don't let 'init optimized' areas of the XSAVE area - * leak into the child task: - */ - memset(&dst_fpu->state.xsave, 0, fpu_kernel_xstate_size); - - /* * If the FPU registers are not owned by current just memcpy() the * state. Otherwise save the FPU registers directly into the * child's FPU context, without any memory-to-memory copying.