lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190514230158.GA6780@yury-thinkpad>
Date:   Tue, 14 May 2019 16:01:58 -0700
From:   Yury Norov <yury.norov@...il.com>
To:     Cyril Hrubis <chrubis@...e.cz>
Cc:     Yuri Norov <ynorov@...vell.com>, Andreas Schwab <schwab@...e.de>,
        "ltp@...ts.linux.it" <ltp@...ts.linux.it>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        Szabolcs Nagy <szabolcs.nagy@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Heiko Carstens <heiko.carstens@...ibm.com>,
        Philipp Tomsich <philipp.tomsich@...obroma-systems.com>,
        Joseph Myers <joseph@...esourcery.com>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        Steve Ellcey <sellcey@...iumnetworks.com>,
        Prasun Kapoor <Prasun.Kapoor@...iumnetworks.com>,
        Alexander Graf <agraf@...e.de>,
        Bamvor Zhangjian <bamv2005@...il.com>,
        Geert Uytterhoeven <geert@...ux-m68k.org>,
        Dave Martin <Dave.Martin@....com>,
        Adam Borowski <kilobyte@...band.pl>,
        Manuel Montezelo <manuel.montezelo@...il.com>,
        James Hogan <james.hogan@...tec.com>,
        Chris Metcalf <cmetcalf@...lanox.com>,
        Arnd Bergmann <arnd@...db.de>,
        Andrew Pinski <pinskia@...il.com>,
        Lin Yongting <linyongting@...wei.com>,
        Alexey Klimov <klimov.linux@...il.com>,
        Mark Brown <broonie@...nel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        Maxim Kuvyrkov <maxim.kuvyrkov@...aro.org>,
        Florian Weimer <fweimer@...hat.com>,
        "linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
        Nathan_Lynch <Nathan_Lynch@...tor.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Ramana Radhakrishnan <ramana.gcc@...glemail.com>,
        Martin Schwidefsky <schwidefsky@...ibm.com>,
        "David S . Miller" <davem@...emloft.net>,
        Christoph Muellner <christoph.muellner@...obroma-systems.com>
Subject: Re: [LTP] [EXT] Re: [PATCH v9 00/24] ILP32 for ARM64

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@...e.cz

OK, I'll do.

Yury

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ