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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F6AAC433F5 for ; Tue, 12 Oct 2021 00:08:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7713F6008E for ; Tue, 12 Oct 2021 00:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236472AbhJLAKB (ORCPT ); Mon, 11 Oct 2021 20:10:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235007AbhJLAIa (ORCPT ); Mon, 11 Oct 2021 20:08:30 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70E7BC061762; Mon, 11 Oct 2021 17:06:29 -0700 (PDT) Message-ID: <20211011223610.645433623@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1633997187; 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: references:references; bh=B1tkVTwLBzXQ1kd/oYzbsyoZ3TVakIxSQFbsR2tD+XI=; b=DRU3FrOhoijfg/uXLgY3S+4aT1sYBLS1OesJ3aT9QARSczsVuAId/+8dyToLgHiaO8EyBn gxWXy34aRoEAKqmxSX3c+KcsdzH6KiwwlUquCxENgoFDHGIcYK9Cp/omnuan1IB+Z3qicR imuItG0/vaVI6Zl/1ZhQSBYOuCkS5lTV+/ZC5aTePbjHyRNEWtmTNed8jW9l8TmmLbllhg 4IESelGZrw0OU5I5beHH8bpQzfDe5rzBhatyUf6u7sNxvYxQRIUgCs355OKD16tjEgPuyg LxYV7TDHdT3JyV45a+wsg2yLSobZqsX31d8Hjfm0vf26u2DiTUptgt+iTNZZxw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1633997187; 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: references:references; bh=B1tkVTwLBzXQ1kd/oYzbsyoZ3TVakIxSQFbsR2tD+XI=; b=Snd0N896VA7Xdp4/T/V0MNqdfAZnstLxbiKrNKP77s0vBGysIj1skuG+NldaW/ZpBtYfZN bli3cooIXxz6iOAg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, "Chang S. Bae" , Dave Hansen , Arjan van de Ven , kvm@vger.kernel.org, Paolo Bonzini Subject: [patch 06/31] x86/fpu: Remove pointless memset in fpu_clone() References: <20211011215813.558681373@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Tue, 12 Oct 2021 02:00:07 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Zeroing the forked task's FPU register 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 register 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 nowhere used and cannot leak anywhere. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/fpu/core.c | 6 ------ 1 file changed, 6 deletions(-) --- 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.