Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6898836yba; Tue, 14 May 2019 16:06:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9AHMMRJTRKwV0wV0Ag4GVe/tOIiy51TAifPs+oHUUuOafwglLvVjXDMgo5mzwWRkKp8bO X-Received: by 2002:a63:b1d:: with SMTP id 29mr40601618pgl.103.1557875208256; Tue, 14 May 2019 16:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557875208; cv=none; d=google.com; s=arc-20160816; b=MqExif7HkRr9TcHdALaEAFOw/Ld3jevOnWJPBtB7RerpmtPdz0JQvaBPuKw25nTjqd S+H2QYRBAftfrvE4vGElP8+dThG9aACGzhqn7N9yjqoDwWq93jfrWiObUvPisn337cvb tEd8Bpk0vAX+3UgethB3RYWRRoPXp0SmSBU6UEMdM7xniIos68qJ+uLJl9m05WztTPkU 1hYtHB1e8gKtR5JMLw5ooAOgAF04R/Cml12T9BcdSS1g87sP3AyDQCanblYIbiu+Z9rX F4CWgQhT4LWJu+VgC1LULPtSCQanI8CwxeLrcZzkqWByPHvf9zvFPDSB7EujGOFTHbG7 gbdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4xuOhafijhTBKjPcHvwICr8fCf3XDF6k7moLbg3FXwg=; b=cnST1J9Y7wZ9lcb95VP0NuVI5S3kdVDfFTy2YRSPk4DMwk3XFtS8CvOHQHPr7Cpuf2 5+IGrtZWYbbjygddR4HqUoFBvEIo9T53tuBM8vPyjuYJLAzJxgDqz3nW8eQ4jkOVJP7U etxaiqYMFxf/DUToXhnsg1Kbiruqu3/DNi3uji4mRGZgE4rVwsPaYN3udjexN+5vpk2K cA/EZbjGNB9ZQrkxiRlzUQbOcYJWoTbwxhzNYMcBnbHm2PvqwkEEPkAh0PthNmHs/C+o vMkV6TguKoD3nhXkfwZ/v67YYGxSl+IGrwGCQRqM3HU6mf0D40xaI5Ob9PnINEOX11SH Royw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f+iki57S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si181080pgs.86.2019.05.14.16.06.09; Tue, 14 May 2019 16:06:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f+iki57S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfENXDL (ORCPT + 99 others); Tue, 14 May 2019 19:03:11 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44188 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbfENXDL (ORCPT ); Tue, 14 May 2019 19:03:11 -0400 Received: by mail-pl1-f193.google.com with SMTP id c5so311702pll.11; Tue, 14 May 2019 16:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4xuOhafijhTBKjPcHvwICr8fCf3XDF6k7moLbg3FXwg=; b=f+iki57StuAV+FkmK28LEJUx6eRLXHSLyK478LBU5ugMCQKEKAZdX23XdU0hTop3GI xGJewyrbS+bCN0qDv8n7PLgw3R8cXpE0K/wG2jRzQacmvbhYfW7oSLUF0VZeH68ddsoC qCNTE4tz3BD6ag5z4FRz+GrqR1A+UYG9qKbww7xnZsjPhVhqd+6O8objP/SAgY/BQF1Q ivbwlEgshLeExC9RVBfCEAUIXWs05qZfaYgSJfxqkwNiFZ85iJBc25BjSEsCaj8LJ185 thGVy5+SA6YMXpJunfpxoxvi7Ld/QsAGJr58tOGd2mFNOsejpsJWS0s/mxLb0Izfo4iT 76Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4xuOhafijhTBKjPcHvwICr8fCf3XDF6k7moLbg3FXwg=; b=b8VSCG2DEf4t8R2wEAGIfJSF4EQUNBIH/JgRKqv/Zl+I3t0bsd1Ya851h1lsGwITOn Zf7cVmYtFfAW6yMeBSxi/OyThJrZeKcLCezpph7gLzIkFfNYMqqyXcCl8tzNej+B8Dyr 3tRGNHLd2+ajuccWRvjRsP7HEwf34iintT6MuYSPYz/DZghkb+/7z4N1+C8WLKAqyrLZ C2xkpSn17MmmtmQ19DPyfQG4O1pVcFdzeKGuHYDElLsdUnz+K1GG59q0B5z7g1ntDCKy 2o9o1ZRF3yjuZUdyYk38/UtiXzQBbQejO+BxE5Bp9lqB32C+s/iLfgZ0J3UTKIub3sB5 lBsA== X-Gm-Message-State: APjAAAUOI13e5i5A8NB8cULdC95vGU44RKSmuHR3avVhONfM9q1m8EPI YY12xSbzROj9HEBWavnflak= X-Received: by 2002:a17:902:5983:: with SMTP id p3mr38930332pli.224.1557874990361; Tue, 14 May 2019 16:03:10 -0700 (PDT) Received: from localhost ([2601:640:5:a19f:19d3:11c4:475e:3daa]) by smtp.gmail.com with ESMTPSA id l65sm238391pfb.7.2019.05.14.16.03.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 16:03:09 -0700 (PDT) Date: Tue, 14 May 2019 16:01:58 -0700 From: Yury Norov To: Cyril Hrubis Cc: Yuri Norov , Andreas Schwab , "ltp@lists.linux.it" , "linux-doc@vger.kernel.org" , Szabolcs Nagy , Catalin Marinas , Heiko Carstens , Philipp Tomsich , Joseph Myers , "linux-arch@vger.kernel.org" , Steve Ellcey , Prasun Kapoor , Alexander Graf , Bamvor Zhangjian , Geert Uytterhoeven , Dave Martin , Adam Borowski , Manuel Montezelo , James Hogan , Chris Metcalf , Arnd Bergmann , Andrew Pinski , Lin Yongting , Alexey Klimov , Mark Brown , "linux-arm-kernel@lists.infradead.org" , Maxim Kuvyrkov , Florian Weimer , "linux-api@vger.kernel.org" , Nathan_Lynch , "linux-kernel@vger.kernel.org" , Ramana Radhakrishnan , Martin Schwidefsky , "David S . Miller" , Christoph Muellner Subject: Re: [LTP] [EXT] Re: [PATCH v9 00/24] ILP32 for ARM64 Message-ID: <20190514230158.GA6780@yury-thinkpad> References: <20180516081910.10067-1-ynorov@caviumnetworks.com> <20190508225900.GA14091@yury-thinkpad> <20190514104311.GA24708@rei> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190514104311.GA24708@rei> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2019 at 12:43:11PM +0200, Cyril Hrubis wrote: > Hi! > > > There is a problem with the stack size accounting during execve when > > > there is no stack limit: > > > > > > $ ulimit -s > > > 8192 > > > $ ./hello.ilp32 > > > Hello World! > > > $ ulimit -s unlimited > > > $ ./hello.ilp32 > > > Segmentation fault > > > $ strace ./hello.ilp32 > > > execve("./hello.ilp32", ["./hello.ilp32"], 0xfffff10548f0 /* 77 vars */) = -1 ENOMEM (Cannot allocate memory) > > > +++ killed by SIGSEGV +++ > > > Segmentation fault (core dumped) > > > > > > Andreas. > > > > Thanks Andreas, I will take a look. Do we have such test in LTP? So the problem was in not converting new compat-sensitive code: diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 5bdf357169d8..c509f83fa506 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -63,7 +63,7 @@ TASK_SIZE_32 : TASK_SIZE_64) #define TASK_SIZE_OF(tsk) (is_compat_thread(tsk) ? \ TASK_SIZE_32 : TASK_SIZE_64) -#define DEFAULT_MAP_WINDOW (test_thread_flag(TIF_32BIT) ? \ +#define DEFAULT_MAP_WINDOW (is_compat_task() ? \ TASK_SIZE_32 : DEFAULT_MAP_WINDOW_64) #else #define TASK_SIZE TASK_SIZE_64 The fix is incorporated in ilp32-5.1.1: https://github.com/norov/linux/tree/ilp32-5.1.1 > We do have a test that we can run a binary with very small stack size > i.e. 512kB but there does not seem to be anything that would catch this > specific problem. > > Can you please open an issue and describe how to reproduce the problem > at our github tracker: > > https://github.com/linux-test-project/ltp/issues > > Then we can create testcase based on that reproducer later on. > > -- > Cyril Hrubis > chrubis@suse.cz OK, I'll do. Yury