From: Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Cc: Maxim Kokryashkin <max.kokryashkin@gmail.com>, tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH luajit] Fix overflow check in unpack(). Date: Wed, 7 Sep 2022 14:56:21 +0300 [thread overview] Message-ID: <YxiG5XV02rSPoRKf@root> (raw) In-Reply-To: <1662472034.210882840@f736.i.mail.ru> Hi, Maxim! Thanks for the review! On 06.09.22, Maxim Kokryashkin wrote: > > Hi, Sergey! > Thanks for the patch! > Please consider my comments below: > > >from Sergey Kaplun via Tarantool-patches <tarantool-patches@dev.tarantool.org>: > > > >From: Mike Pall <mike> > > > >Thanks to HybridDog. > > > >When build with optimization compiler may throw away overflow check in > >`unpack()` base library function. > Typo: s/build with optimization/built with optimization, > Also, I think we should mention the specific optimization that causes the mentioned behavior > since it is not mentioned in both the LuaJIT’s issue and the original Lua issue. Fixed. The new commit message is the following: I mention the -fstrict-overflow flag as the crucial one (obviously some more are needed). | Fix overflow check in unpack(). | | Thanks to HybridDog. | | (cherry picked from commit 179cf2eb84fef2b9a524469c3c8cc49363b8fb10) | | When built with -O2 optimization flag (includes -fstrict-overflow) | compiler throws away overflow check in `unpack()` base library function. | | This patch prevents aforementioned error by comparing the unsigned | amount of values to unpack with `LUAI_MAXCSTACK` instead of 0. | | Sergey Kaplun: | * added the description and the test for the problem | | Part of tarantool/tarantool#7230 Branch is force-pushed. > > > >This patch prevents aforementioned error by comparing the unsigned > >amount of values to unpack with `LUAI_MAXCSTACK` instead of 0. > > > >Sergey Kaplun: > >* added the description and the test for the problem > > > >Part of tarantool/tarantool#7230 > >--- > > > >Issue/PR: > >* https://github.com/LuaJIT/LuaJIT/pull/574 > >* https://github.com/tarantool/tarantool/issues/7230 > >Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-574-overflow-unpack-full-ci > >PR: https://github.com/tarantool/tarantool/pull/7596 > > > > src/lib_base.c | 6 ++++-- > > test/tarantool-tests/lj-574-overflow-unpack.test.lua | 12 ++++++++++++ <snipped> > >-- > >2.34.1 > -- > Best regards, > Maxim Kokryashkin -- Best regards, Sergey Kaplun
next prev parent reply other threads:[~2022-09-07 11:59 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-08-23 8:06 Sergey Kaplun via Tarantool-patches 2022-08-23 11:03 ` sergos via Tarantool-patches 2022-08-23 13:38 ` Sergey Kaplun via Tarantool-patches 2022-09-06 13:47 ` Maxim Kokryashkin via Tarantool-patches 2022-09-07 11:56 ` Sergey Kaplun via Tarantool-patches [this message] 2022-09-07 12:00 ` Maxim Kokryashkin via Tarantool-patches 2022-11-11 8:54 ` Igor Munkin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YxiG5XV02rSPoRKf@root \ --to=tarantool-patches@dev.tarantool.org \ --cc=m.kokryashkin@tarantool.org \ --cc=max.kokryashkin@gmail.com \ --cc=skaplun@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH luajit] Fix overflow check in unpack().' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox