From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6626AC3065B for ; Mon, 3 Jul 2023 20:40:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2C2128003A; Mon, 3 Jul 2023 16:40:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DDC3B280030; Mon, 3 Jul 2023 16:40:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA38B28003A; Mon, 3 Jul 2023 16:40:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B337E280030 for ; Mon, 3 Jul 2023 16:40:19 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7888D160603 for ; Mon, 3 Jul 2023 20:40:19 +0000 (UTC) X-FDA: 80971468158.24.7D4E11D Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 714878001D for ; Mon, 3 Jul 2023 20:40:17 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="d/FwSPsR"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf30.hostedemail.com: domain of mpatocka@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mpatocka@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688416817; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qEyfUvIleE/DMwxJ9dU5lavWxgzOCjVd+5vXxKWRfUM=; b=P4DqM+/mQOI9F9knGcNa2ZhvmHxWB+lXpw4wKEdJ+SFvbu1H+FSBSyo7VH4rqi9uBp/Ebx LSr6ZByqxVD5PeUQUqH3htwEdWzfbi6HPW/yNWU3P1/PjJN43n8mf/YkFU4pQfJgi2B6Ep UPHwDmDlRv90rTw97kcwKhm4ke1+hWU= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="d/FwSPsR"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf30.hostedemail.com: domain of mpatocka@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mpatocka@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688416817; a=rsa-sha256; cv=none; b=v/tzhpbx4KlNCyzLXb8/CkFESD/cVN+UqSkrhpKL6joaZHSL7d7xSP8DlxLkr2uBh74fb3 /STR/tgZJ3CrmdbKaYxMYkZYLodm6h0+57qavhPBkk9gmaPFic8HkcZqYwI6A7F65jnNJD ZrA2KMajaQhx1g/fby0tiPaFHSr0Ik4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688416816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=qEyfUvIleE/DMwxJ9dU5lavWxgzOCjVd+5vXxKWRfUM=; b=d/FwSPsRvG0nxuZWcWx+SlDcXvnoXG+b6srwHSEl6N7i1umFzVHKhkzdPJ165Lqrv2Drd6 a7gz6EHkKJO07ciInFiq2ge6vPk+9HgJPxcqR/jXME47CttW5sNJK52emG2/4xQXzcoDsh C2oL8rGCYRn9yY9KqExBZ0yRS39ISXI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-262-_xYCz6DdNyukg9a3-lbWZw-1; Mon, 03 Jul 2023 16:40:11 -0400 X-MC-Unique: _xYCz6DdNyukg9a3-lbWZw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF7D71C07240; Mon, 3 Jul 2023 20:40:10 +0000 (UTC) Received: from file1-rdu.file-001.prod.rdu2.dc.redhat.com (unknown [10.11.5.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C2E140C2063; Mon, 3 Jul 2023 20:40:10 +0000 (UTC) Received: by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix, from userid 12668) id 7B5273096A40; Mon, 3 Jul 2023 20:40:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by file1-rdu.file-001.prod.rdu2.dc.redhat.com (Postfix) with ESMTP id 77AB43F7CF; Mon, 3 Jul 2023 22:40:10 +0200 (CEST) Date: Mon, 3 Jul 2023 22:40:10 +0200 (CEST) From: Mikulas Patocka To: Linus Torvalds cc: Vegard Nossum , John Paul Adrian Glaubitz , Frank Scheiner , "James E.J. Bottomley" , Helge Deller , John David Anglin , Andrew Morton , linux-parisc@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] parisc: fix inability to allocate stack pages on exec In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Rspam-User: X-Stat-Signature: yupx81kmhiooykgj5dyfx6p6w97at4jp X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 714878001D X-HE-Tag: 1688416817-572836 X-HE-Meta: U2FsdGVkX1/f3gGs1Q6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WlLh8+ioOlveyLeBEkn0rQEAukDE3v84QT5XlZN2dpfaidBPQvjlK4ub1iITtyyQNBd89n0+8jT0OkXyBOFuLjj5+hvRwqSdwMTHfp9/Zw5gdcofz8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, 3 Jul 2023, Linus Torvalds wrote: > On Mon, 3 Jul 2023 at 12:59, Mikulas Patocka wrote: > > > > The patch 8d7071af8907 ("mm: always expand the stack with the mmap write > > lock held") breaks PA-RISC. > > > > The breakage happens if we attempt to pass more arguments to execve than > > what fits into the initial stack page - we get -E2BIG in such a case. > > > > The reason for the breakage is that the commit 8d7071af8907 adds the test > > "if (!(vma->vm_flags & VM_GROWSDOWN)) return -EFAULT;" to the function > > expand_downwards. > > Heh. See > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f66066bc5136f25e36a2daff4896c768f18c211e > > which fixes this differently (and, I think, much better). > > Just removing the VM_GROWSDOWN test will actually break some of the other users. > > Notably the new and improved expand_stack() function that now handles > all the complicated *cough*ia64*cough* cases automatically, which > allowed unifying the page fault handling code around this area. > > Linus Yes - I confirm that this fixes it. (please, also send this patch to Greg, so that it will be included in 6.4.2) Mikulas