From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED, URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1693311437; bh=r9JIMuVHYUbz9HrY38YzZxT2+1q5zZRjOatl2kuFGb4=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=UaK8zYUsG5PVrvtFPqK+5GzwGRIvsQH5rzpr756S/luk5m5Sh3wAQslRGkoCLytTx WjFJZHvUpv2W5lNRfyiBF0cEvD6e07uMe7KIjXRlEW6vJOdU0o3sBNubmZTFAB7/QN vC6GADLbC3ZuE7a4tTe8pZx+OGw8zF56It6Wqs9Rbe8D+6fcQWAEXlofj02KzVseGU FP4GUhOzi8UqVods3WXi26pf4wkA5a73HtZG8uUzGmG4Ce8lVLuXUzIUJMG0IhSGOi ZoE94Hhv47NEl1qIn8qG0yMGvcwTsWupu3YpFSjGWtoQ5eAOZ5Hz3W4c3cYSgUGAUi 34vVFjxK5RZow== Received: from biznet-home.integral.gnuweeb.org (unknown [182.253.126.208]) by gnuweeb.org (Postfix) with ESMTPSA id E417424B216; Tue, 29 Aug 2023 19:17:14 +0700 (WIB) Date: Tue, 29 Aug 2023 19:17:10 +0700 From: Ammar Faizi To: Willy Tarreau Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Zhangjin Wu , Nicholas Rosenberg , Michael William Jonathan , GNU/Weeb Mailing List , Linux Kernel Mailing List Subject: Re: [PATCH v2 1/1] tools/nolibc: i386: Fix a stack misalign bug on _start Message-ID: References: <20230828070240.1691921-1-ammarfaizi2@gnuweeb.org> <20230828070240.1691921-2-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bpl: hUx9VaHkTWcLO7S8CQCslj6OzqBx2hfLChRz45nPESx5VSB/xuJQVOKOB1zSXE3yc9ntP27bV1M1 List-Id: On Tue, Aug 29, 2023 at 08:21:47AM +0200, Willy Tarreau wrote: > Indeed, good catch! However if we want to do it cleany (i.e not punch a > 16 to 28 byes hole in the stack), we should do this instead: > > add $12, %esp /* the stack must be aligned to 16 ... */ > and $-16, %esp /* ... bytes after eax is pushed and ... */ > sub $12, %esp /* ... before the call. */ > > This will only add 0 to 12 bytes depending on the existing alignment. > > What do you think ? Good point. I'll send a v3 revision tomorrow. I just saw that Linus has pulled the PR from Shuah that contains this bug. IOW, I missed this fix for the 6.6 merge window. Let's see if it can go to 6.6-rc2. Or maybe sooner than that. -- Ammar Faizi