From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97F2F19F115 for ; Thu, 20 Aug 2026 03:02:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787194945; cv=none; b=QCKL0kMQhNRSzkOqzuB6Qi6ZT038kAB1wb+uSWmtrMxagZnYHZPIHOvHn0gz+pyokDsVPJcj6Vq0TV/LZKFE8pPDm5kekmRd6tOZqNTDxUsi1gxU6oTtPV6k7jVHm2QH+SHLj56rFMxLJwhCTaHbq+XeFlNxL/o4D61jO2owytg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787194945; c=relaxed/simple; bh=jtU1r6A90XigBLCvEoH4ZYlmCbeaJmrqAnimb2p3vj0=; h=From:To:Cc:Subject:In-Reply-To:Date:Message-ID:References: MIME-version:Content-type; b=m9urdJ3uTx1m6bg2q7cGOEKB1jYI/+m/mptxZ/l7pIfn+bZikAcdoP9EBlaAmCF4KV9pOhjCtAb9RhIWaTxZ8h08XAUs9r0vAp1Wx1O6X1F8lP1EANkZSYCFjTP2s5ldxDlye/p5lQ65dsPODFiBbelFt8KPd3+ifoz+kNBMkO4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VtjPugQf; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VtjPugQf" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-7ee125ec926so1445645a34.2 for ; Wed, 19 Aug 2026 20:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787194942; x=1787799742; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=b7Lcuraq/4CMmDj86N4LuGkDilC6+Z6Q+xTsr6qjIXM=; b=VtjPugQf3D8Z6LuyNt7NtSXEQKbgAVDf6Y+JnMwq6f31JPVCahGgH13HXtLwqgNcfz b3oKdxDv9XdgzmxzHnVNJwKKBIn/0G7vhr9TqfcARH0SN3ee1LwwhzNU32g4KoNVH0Cv Hm/0gAtvzwO1Nb9mEAB9VJcqcQxEvLqfyeTUI4fSiqg1QbCXEHHZro4GAUewim7gUqqi v6OgYwMPjJsvZMmHS6r8Wc2J0uMEqqh3d7FVztNfe1s/yjzXRa2qKjvIa3EWYBVAXtz+ e4QCNDqqroYma14L11yYADcqz/OZ0ZN10qxvLrgduNZGwTVqe20VzB9ViD1hrKc8nUYp vIyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787194942; x=1787799742; h=content-transfer-encoding:content-type:mime-version:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=b7Lcuraq/4CMmDj86N4LuGkDilC6+Z6Q+xTsr6qjIXM=; b=Jg6V+ny1EHUDn+R3TT751OsL0tOpbQffyBjQ0HTFIDnfh00/OpchRpjVTMfJsoZQzq CgVpZgCitnoOKh35IU2LowQIjy9xVzBTq301tNkQljBeOfksUW7eXy/GW/jBW2ashfIw i7FWRBUfsd1mCaa55N2RKdESXqOyA0Z1XVwZ9+9t01P7K3K29SHrnNFVLdh0PBwQUQXf 2OoRz4CrQBUegmNKus6TxKuoVyU6n5itsrLK1ldZNXQY+ddxw0DUh3jPtnxzzfI+RfGf 3+k+7Qo56+I7QhaD8HN5nBXFWNg3mim/6TkfxLweSgdqpmHvWRW+iur3XOwgdc2HsYi+ mHXQ== X-Gm-Message-State: AOJu0YyQhyd2cQdcdnChemzn8fyQ8CQTX+sjNqdqaIdvshHarqlgzRDu BLjn6skk0z7RTP59fI3o769he/kVrXc51ZS0LuGjB41lu4FiscsoVLts X-Gm-Gg: AR+sD13NEUpoeCEHL/RiM068iX1vFZ8C0pGYivTEP7v/ggRLE9Cts6z4ZKJO4PkQVVa ssft/kSdW784RxZaHtUvZxJ36S4+ZbmwHgILDyRi+S9kTdzN45LnJmSNcKvfkTpiyvwAA5KUfac Z4KEcfF+WIvcFRlQBK74hJKMdBKYZnlW1uBjr+G+t7qFnszMPShA4R6Jf+B+z4OXtGgyT3CV/Dt VDmLX13p7yJY5yEwhmRSn7pdlT8vazNkMIXiIS4nfjGubfElsHcqiZOlRfMvjjdZUkVBkJL/DkP N9kwMzhloja7PMu/mRTI3Wzyi9ZmVWkylGUBHQJVWTA9feWQDIES3HLIITjKJhipwpZ8guvkXEW LrqzsHcim0cww9PuCArf5wROiR2yjc1Qiu6eNnWjGaqnqMHII7vgtPTT2tLRuYe5V8IA1WikeW1 fVpvVEkt6gB5zG3ehNnSbCSEFRTA0lhHqRorgpfgW0u9AUUnTcqgnQu0/Mx2xOPZDZq3UQN7PkJ tlHPLqgMmtvcuM7Pq7upvkAckO2onEBKhi3Mmm7pH6A X-Received: by 2002:a05:6820:217:b0:6ae:42c7:ef83 with SMTP id 006d021491bc7-6b13bdbf028mr9701164eaf.0.1787194942378; Wed, 19 Aug 2026 20:02:22 -0700 (PDT) Received: from pve-server ([49.205.216.49]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bef77be3sm11302733eec.10.2026.08.19.20.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 20:02:21 -0700 (PDT) From: Ritesh Harjani (IBM) To: "Christophe Leroy (CS GROUP)" , Venkat Rao Bagalkote , Madhavan Srinivasan , Ritesh Harjani , linuxppc-dev , ajd@linux.ibm.com Cc: LKML , Christian Brauner , "linux-mm@kvack.org" Subject: Re: [BUG] powerpc: userspace processes crash in ld64.so.2 when running recent linux-next kernels In-Reply-To: Date: Thu, 20 Aug 2026 08:13:22 +0530 Message-ID: References: <75419f88-eab9-444b-bf97-28a9765819ad@linux.ibm.com> <627c5c2f-a0b3-4fba-811f-7b4ed4c74dbb@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit "Christophe Leroy (CS GROUP)" writes: > Le 11/08/2026 à 06:23, Venkat Rao Bagalkote a écrit : >> >> As part of debugging and suggested by Maddy, I reverted the following >> commit: >> >>   263e5159e00a ("powerpc: Fix exit_flags field placement in pt_regs for >> ptrace") >> >> and rebuilt/booted linux-next with only that change reverted. >> >> After booting the reverted kernel, I rebuilt the latest upstream kernel >> using the same userspace and toolchain. The build completed >> successfully and I did not observe any of the ld64.so.2 userspace >> segfaults that were previously seen during kernel compilation. >> >> Kernel used for testing: >> >>   7.2.0-rc5-next-20260731-00001-g79d9c1ce90a9 >> >> Top of tree: >> >>   commit 79d9c1ce90a9873422ca4d6d0124a1d1c10a098c >>   Revert "powerpc: Fix exit_flags field placement in pt_regs for ptrace" >> >> The upstream kernel build completed successfully: >> >>   INSTALL /lib/modules/7.2.0-rc7/kernel/net/openvswitch/vport-gre.ko >>   DEPMOD  /lib/modules/7.2.0-rc7 >>   INSTALL /boot >> >> Based on this testing, reverting commit 263e5159e00a appears to >> eliminate the random userspace crashes observed during kernel builds, >> suggesting that the issue may be related to that change. > > But commit 263e5159e00a fixes commit d7a6797e0bc1 ("powerpc: add > exit_flags field in pt_regs"), by reverting commit 263e5159e00a you > re-introduce other bugs. > > It's a bit difficult to see what commit 263e5159e00a is doing exactly, > most of it is a revert of commit d7a6797e0bc1 but it does something > instead. Need to see what remains with both commits applied. > Looking at the diff - I had shared a diff internally with Venkat. Thought of doing the same here too. This seems to be holding up for him in his internal testing. I haven't fully gone through this path yet to send an official patch - but hopefully will do that soon! syscall_exit_prepare() record _TIF_RESTOREALL value in exit_result, but if for some reason (e.g. like an interrupt pending), if we go via syscall_exit_restart(), then we are returning ret from here and loosing the _TIF_RESTOREALL value which was captured earlier. So instead I believe we should return regs->exit_result from here. I see that we were returning exit_result prior to the culprit patch. diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c index 5b88bf72786c..bf167a41a820 100644 --- a/arch/powerpc/kernel/interrupt.c +++ b/arch/powerpc/kernel/interrupt.c @@ -175,7 +175,13 @@ notrace unsigned long syscall_exit_restart(unsigned long r3, struct pt_regs *reg current_thread_info()->exit_flags &= ~_TIF_RESTOREALL; regs->exit_result |= ret; - return ret; + return regs->exit_result; } #endif -ritesh