Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp25728107rwd; Sun, 2 Jul 2023 23:37:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlF2B/qQB3PfUoktjpRNa4LDLyGAmUHjHILwkfQDAQau3ZPppvzH797mFFdIpuovqMqMFgaE X-Received: by 2002:a17:90a:db87:b0:262:ecd3:990c with SMTP id h7-20020a17090adb8700b00262ecd3990cmr10587034pjv.47.1688366242255; Sun, 02 Jul 2023 23:37:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688366242; cv=none; d=google.com; s=arc-20160816; b=C86edFqzEeKufmgxC3quYXTYTHtpDWs3UtWnGSuUWpQEagoSUKcXShfsPiMWq0yB/O nOkpu8w8aBMB8YaKG/Z0fIPvs61RGwX6RO3cGqD+YQRXP5BCvCx2Te4CZR7OIc/5manq HOT5C0klYc5j9LOCfO5yGegU0LSnrmBT/oh+fiKU8nwfO1bNezWIwKVl0LdpNjbp9UBz zS/3NWIxQ1Z5Eebd/i1Mm9upToo5Agm05Q490iJikl5o5XfTIJH7BT3mBqhf5vyjTh0i NlC9jvKXqJYvmWh2N62bQDBGkx4MhvoyyOfQXRKnJu2GRp/JWheyhsiQLyOcCwKFMT/h vJSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=njL/pkqD0wFEARNotrOahHhu0shD1jmNUKbDzIRDOno=; fh=DS1cWq5qwukNvTWk96eSiYmw6s1uNRWcj2XUOuuG4Rg=; b=Pj4CvcU6MpgY0vn4xxfS3OpESUeJZ38M9BMJvhtJRdaJdiauo8xx0qjUy7zpaa5flf EHa+qwIGU9V7sxMWbxWa2u+CZ5QAYihD5R7gcsi+y/poki+mPqWtOzpWQkpvPSZ4wfE3 /mx/Hi+y2OOXBuI2U51YcfF+ui2HUFEo0fx9e9azjMg0aA2hbmAtjR3OQg/Qa1IJiWEb uoP2OP9iEwBLgKapSb2jhf0Ka4jQlKuwLAozL7t6Z8RBUnK/vTVYGUxRLASTbPuxWAbH 697n1XkX41ZgggomAwwwCr8tbuRBQLv1r2Asc37D3JNxiQbwOIccnAbJWSWEdCO4Lzbf 9G2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=GDb4pp8v; 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 v2-20020a17090ad58200b00263c7cadb62si1552057pju.38.2023.07.02.23.37.08; Sun, 02 Jul 2023 23:37:22 -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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=GDb4pp8v; 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 S229923AbjGCGUq (ORCPT + 99 others); Mon, 3 Jul 2023 02:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230205AbjGCGUj (ORCPT ); Mon, 3 Jul 2023 02:20:39 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D68DCE for ; Sun, 2 Jul 2023 23:20:37 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-992dcae74e0so336219966b.3 for ; Sun, 02 Jul 2023 23:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1688365236; x=1690957236; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=njL/pkqD0wFEARNotrOahHhu0shD1jmNUKbDzIRDOno=; b=GDb4pp8vMEFb/sigNCKrU9awqE8pQKtWwQD9Q9WC1hjo1uRuQdZ+uZFV1oP2qvM5Qg NGzkrLL1HA+7OJHatNPOm4MAmVyCFb6Rn+kKjOtuSCpnU/LPcfj8gam/geYK86izhaTN 0UZMaoiW33zh87RmbeH8Uobo3ZQPfJkfUmLMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688365236; x=1690957236; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=njL/pkqD0wFEARNotrOahHhu0shD1jmNUKbDzIRDOno=; b=l00jLX4rB7EV5Lcm7IGaOzFgVA2gQqi1dWMFi8bdYuvfmjt3V4AehbckTMOsf+lB0I V64bNRDVV0Q9MQ8qGxPYQDa0N0ja++cJKoW84CLYN8Bugp83gIezUF+/Jz4PeQL9p7ZB 14JKsixHKb+UBROzOJeYMhkv7sJRqMFeU5buM9rnqb+5fNj/hQnWJSoJp9XSMACM2fsl +O200cA8vYQivEkm7m4jHST7KgnWRTEu926NirikvoUS6jHv/Lrn/herO01SnIuoDokX XuwgMPQguFaY5GYcJnZtyOYcDY3npAjKJjIXKl4Cv/9/P8LTOlJriE6oX6KijuPJEb/k XUPg== X-Gm-Message-State: ABy/qLYgWrRxkb4prrwT+SrQaV3wv+B4GHcTlIIOkpkZQcoWhy954gw6 ZMYedr1vS17VQzp7KA3rG4Qi9xHyA/HcKjVEXU7uCxXF X-Received: by 2002:a17:907:9850:b0:993:3556:b7ed with SMTP id jj16-20020a170907985000b009933556b7edmr3413204ejc.6.1688365235651; Sun, 02 Jul 2023 23:20:35 -0700 (PDT) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com. [209.85.208.53]) by smtp.gmail.com with ESMTPSA id a12-20020a1709064a4c00b009932337747esm2907142ejv.86.2023.07.02.23.20.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Jul 2023 23:20:34 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-51d80d81d6eso4730866a12.1 for ; Sun, 02 Jul 2023 23:20:34 -0700 (PDT) X-Received: by 2002:aa7:c50a:0:b0:51d:b75e:30ee with SMTP id o10-20020aa7c50a000000b0051db75e30eemr6196854edq.40.1688365234031; Sun, 02 Jul 2023 23:20:34 -0700 (PDT) MIME-Version: 1.0 References: <20230629184151.888604958@linuxfoundation.org> <2023063001-overlying-browse-de1a@gregkh> <0b2aefa4-7407-4936-6604-dedfb1614483@gmx.de> <5fd98a09-4792-1433-752d-029ae3545168@gmx.de> <9b35a19d-800c-f9f9-6b45-cf2038ef235f@roeck-us.net> <2a2387bf-f589-6856-3583-d3d848a17d34@roeck-us.net> In-Reply-To: From: Linus Torvalds Date: Sun, 2 Jul 2023 23:20:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 6.4 00/28] 6.4.1-rc1 review - hppa argument list too long To: Guenter Roeck Cc: Helge Deller , stable@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-parisc , Greg Kroah-Hartman , John David Anglin Content-Type: multipart/mixed; boundary="0000000000000716a505ff8f2a26" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 --0000000000000716a505ff8f2a26 Content-Type: text/plain; charset="UTF-8" On Sun, 2 Jul 2023 at 22:33, Guenter Roeck wrote: > > Here you are: > > [ 31.188688] stack expand failed: ffeff000-fff00000 (ffefeff2) Ahhah! I think the problem is actually ridiculously simple. The thing is, the parisc stack expands upwards. That's obvious. I've mentioned it several times in just this thread as being the thing that makes parisc special. But it's *so* obvious that I didn't even think about what it really implies. And part of all the changes was this part in expand_downwards(): if (!(vma->vm_flags & VM_GROWSDOWN)) return -EFAULT; and that will *always* fail on parisc, because - as said multiple times - the parisc stack expands upwards. It doesn't have VM_GROWSDOWN set. What a dum-dum I am. And I did it that way because the *normal* stack expansion obviously wants it that way and putting the check there not only made sense, but simplified other code. But fs/execve.c is special - and only special for parisc - in that it really wants to expand a normally upwards-growing stack downwards unconditionally. Anyway, I think that new check in expand_downwards() is the right thing to do, and the real fix here is to simply make vm_flags reflect reality. Because during execve, that stack that will _eventually_ grow upwards, does in fact grow downwards. Let's make it reflect that. We already do magical extra setup for the stack flags during setup (VM_STACK_INCOMPLETE_SETUP), so extending that logic to contain VM_GROWSDOWN seems sane and the right thing to do. IOW, I think a patch like the attached will fix the problem for real. It needs a good commit log and maybe a code comment or two, but before I bother to do that, let's verify that yes, it does actually fix things. In the meantime, I will actually go to bed, but I'm pretty sure this is it. Linus --0000000000000716a505ff8f2a26 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_ljmh1mnt0 IGluY2x1ZGUvbGludXgvbW0uaCB8IDQgKysrLQogMSBmaWxlIGNoYW5nZWQsIDMgaW5zZXJ0aW9u cygrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL2luY2x1ZGUvbGludXgvbW0uaCBiL2lu Y2x1ZGUvbGludXgvbW0uaAppbmRleCA3NGYxYmU3NDNiYTIuLjJkZDczZTR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