Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp3131109rdb; Tue, 29 Aug 2023 06:25:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFf+yAfZijyA99FDZ0Z7VcJJfj8JMiw5E+023HENXVsnMqhiE8DPxJfcExSiGkcP/f2u85w X-Received: by 2002:ac2:4c4f:0:b0:4fe:62f:35eb with SMTP id o15-20020ac24c4f000000b004fe062f35ebmr24252400lfk.20.1693315532130; Tue, 29 Aug 2023 06:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693315532; cv=none; d=google.com; s=arc-20160816; b=CtnNIwFIWY6uXq+oLivFzKalIiQRKrz6vLcWUnNyoL78EsQHVDaxidyuPaniLeZNgz 2ANsDtvBWN2+cyHmq4LAB+J8R2m5mGsnKyr6cPx4nZ2GT//qd+W/n9eoQ9bZiv5GRD1S 8rke24BufYrROLUMiz5x3E9dFwklMTUhO8szlVSEXs6MoUL2ebKPozEa+vVByaqMrBSx XcTRCd8wHOBeVwt+YXCWT8G8bwjTpSVtNB6zs3IHcCb6rs9+uymBs+82dFk5Q11IsZXU CYPJAGwvz7gBK9k/C3B0MkaUL4sjvI/645nttRwjQU38JwHpOWN9vwB1L2XHceMbpmid HvrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mM4/w8JHw5USwBcrLku7afoosTl2p8WPIS8Wg9mtF2g=; fh=GCPit5nIu1LQkfps2AItEG/PPCIRw8gmwlVZoZOlIGA=; b=LtF8Sgj9IJzS303VKAsgrUNvIkne2h/4TUxn6+svrqVD1ZuRsacLUZuKxhwexUAsp9 baTeChh7zbBh0wEwhmIVEyPFqkQkC8twmmFoeWID/5Oq4ib1YNmczFqHvj6I9DpPkwCU pjsDswRzND2doOLUq7FvT78PwpH/FVkzdkAVjGgN24bhSprJjq0IeW7gxCQO9Nn8P4Fs yXmV2RjEyAVK7UbbWx0YqW7oeIdzAsyMCsRLiIz0gNSmc4RzQMUXrgPfvnfIod0yZ1rj XVVxkAYiNN7Zh5dzGSiRy7oEy7DUU5FOwSQYZV6XtYzIbgEHg3WwbdN9Kh/AV/U7y6fY ULRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o5-20020aa7c505000000b00525ce34f70fsi6216252edq.275.2023.08.29.06.24.58; Tue, 29 Aug 2023 06:25:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235382AbjH2MZO (ORCPT + 99 others); Tue, 29 Aug 2023 08:25:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235509AbjH2MZE (ORCPT ); Tue, 29 Aug 2023 08:25:04 -0400 Received: from 1wt.eu (ded1.1wt.eu [163.172.96.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B0BBDCD2 for ; Tue, 29 Aug 2023 05:24:47 -0700 (PDT) Received: (from willy@localhost) by mail.home.local (8.17.1/8.17.1/Submit) id 37TCORUW015361; Tue, 29 Aug 2023 14:24:27 +0200 Date: Tue, 29 Aug 2023 14:24:27 +0200 From: Willy Tarreau To: Ammar Faizi 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 29, 2023 at 07:17:10PM +0700, Ammar Faizi wrote: > 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. OK thanks! > 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. No worries, we all know that -rc1 gets more exposure than individual branches and raises bugs like this one. Cheers, Willy