From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta1.formilux.org (mta1.formilux.org [51.159.59.229]) (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 3482A305675 for ; Fri, 3 Jul 2026 17:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=51.159.59.229 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783100713; cv=none; b=U6IljIHqbiXSm+8sNUrCQf4LBXwtdaOqgfAKaZuBK/daJVIs88wrHxO+vD/P36jg4K7pf457FX/mAMaKkJ0Aq40Z46uMVVOA9qzBQbsEsZq5kPgNXWa5VEvZxarOfJ4Nu0VZD9C1RVrnB/CK5iE3h+WX7/UuIKjZbnYL9GiGzZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783100713; c=relaxed/simple; bh=kg54IkOM0yvZQZLQtT1/plJLbt9JybIUL/i3WrEAKF0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kxRQxeqt2W3sqrIQm2p+AokurzMKgaDVn1k7dazZqEp3yKZV1UamvARvpZlAKmQE3BqZ95x2+J9iQXqrr32GHkIYsdDNE4v8Tiage3UAquTzlj+GqH2J0kw7a2GKEo+48VZzyb8pYu6r9icVRKx+0LGbzXASmGAUjhwEqL60+Eg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu; spf=pass smtp.mailfrom=1wt.eu; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b=uPJC+7hx; arc=none smtp.client-ip=51.159.59.229 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=1wt.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=1wt.eu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=1wt.eu header.i=@1wt.eu header.b="uPJC+7hx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1wt.eu; s=mail; t=1783100709; bh=IwB1X0z1DCKoVJkSD6FXgVvXbPuyt6q25vHaDjOpAZI=; h=From:Message-ID:From; b=uPJC+7hxzwa6qMOhhJVfmNphIvTzLC70lFDc2g/cFv0jVPKlszPNW1t1A1fyhxaPm p6194ourokTcPUxNKFJmdWw6DHMO/ionGJkojFekWPS8xlEAFw/LQuFWTPU5abwtGz LFeMtb/zJ+6OJUxWJlqfBlPCLt8W0e2R2hYjPFeU= Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by mta1.formilux.org (Postfix) with ESMTP id 613FFC0E12; Fri, 03 Jul 2026 19:45:09 +0200 (CEST) Date: Fri, 3 Jul 2026 19:45:09 +0200 From: Willy Tarreau To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: linux-kernel@vger.kernel.org, Daniel Palmer Subject: Re: [PATCH] tools/nolibc: mark arg1 operand in __nolibc_syscall0() as write-only Message-ID: References: <20260703-nolibc-sparc-asm-v1-1-c7fe73e2e777@weissschuh.net> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Jul 03, 2026 at 07:41:58PM +0200, Willy Tarreau wrote: > Hi Thomas! > > On Fri, Jul 03, 2026 at 07:30:16PM +0200, Thomas Weißschuh wrote: > > __nolibc_syscall0() does not set the arg1 variable before passing it to > > the asm block. This uninitialized variable read is undefined behavior. > > Clang can miscompile this. > > Interesting. I don't know how we ended up like this, most likely just > due to reusing the same code blocks for the different variants. I'm > noting that m68k is affected as well then. I'm CCing Daniel for a > double-check. Hmmm no I'm wrong, sorry Daniel for the noise, on m68k _num is initialized before being passed to the asm statement so "+r" is fine there. Willy