From patchwork Sun Jul 28 13:30:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Andreas K. Huettel" X-Patchwork-Id: 1965719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WX2Vq0J57z1ybY for ; Sun, 28 Jul 2024 23:33:07 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33C07385B50B for ; Sun, 28 Jul 2024 13:33:05 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id A2FBE3858C50 for ; Sun, 28 Jul 2024 13:32:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2FBE3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A2FBE3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722173571; cv=none; b=YqgcNOtbe9zuBKaSfEeolA3zCU45tysfTOVzBVVoqtku6WnzRgdr5vH3D+ySBB8jqXC7lCHykrb7baBXsb5I3y0FADVUlwjryFVPnhOA/fVNzg8/Ten8yAZMm6KovhhP2bisKJQcqerscWxSOQTxDW+ukaHHZsIBhWT24qJ2ojE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722173571; c=relaxed/simple; bh=D0S+zjjCCbRXNxn6X+Ot7agVaL9pBCmapGVOLvedGXI=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=sUDK7ZPsvMjsNlAhSUd303Pdvg7euCEXdIt0OB5NLvWx8kKUq/UJrPmEouyyv7wZljlOrIYdpIu55S6m3xydpOjQKCYYfk22bFuwsr4ePraRxZ9UAJshcRZncgQQuHQwY4F59OWklAcPkuD0gOFV3+ra/EELDA0hibj8F4uMKa8= ARC-Authentication-Results: i=1; server2.sourceware.org From: =?utf-8?q?Andreas_K=2E_H=C3=BCttel?= To: libc-alpha@sourceware.org Cc: sourceware-bugzilla@mkarcher.dialup.fu-berlin.de, adhemerval.zanella@linaro.org Subject: [PATCH] Mitigation for "clone on sparc might fail with -EFAULT for no valid reason" (bz 31394) Date: Sun, 28 Jul 2024 15:30:57 +0200 Message-ID: <20240728133223.885378-1-dilfridge@gentoo.org> X-Mailer: git-send-email 2.44.2 MIME-Version: 1.0 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org From: Michael Karcher Bug: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg62592.html Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31394 See-also: https://lore.kernel.org/sparclinux/62f9be9d-a086-4134-9a9f-5df8822708af@mkarcher.dialup.fu-berlin.de/ Signed-off-by: Michael Karcher --- This is not my code, so it technically needs a SOB from Michael. -Andreas (dilfridge) --- sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 3 +++ sysdeps/unix/sysv/linux/sparc/sparc64/clone.S | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S index 748d25fcfe..c9cf9bb055 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S @@ -28,6 +28,9 @@ .text ENTRY (__clone) save %sp,-96,%sp + save %sp,-96,%sp + flushw + restore cfi_def_cfa_register(%fp) cfi_window_save cfi_register(%o7, %i7) diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S index e5ff2cf1a0..370d51fda2 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/clone.S @@ -32,6 +32,9 @@ ENTRY (__clone) save %sp, -192, %sp + save %sp, -192, %sp + flushw + restore cfi_def_cfa_register(%fp) cfi_window_save cfi_register(%o7, %i7)