mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <ahmad@a3f.at>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] bthread: disable ASan accounting for fibers on 32-bit sandbox
Date: Mon, 22 Mar 2021 05:38:03 +0100	[thread overview]
Message-ID: <20210322043803.GD23724@pengutronix.de> (raw)
In-Reply-To: <20210319084621.2476100-1-ahmad@a3f.at>

On Fri, Mar 19, 2021 at 09:46:21AM +0100, Ahmad Fatoum wrote:
> For the sandbox architecture, we use __sanitizer_start_switch_fiber
> and __sanitizer_finish_switch_fiber to tell ASan when we switch stacks.
> 
> If we don't, ASan complains that:
> 
>   ==2472828==WARNING: ASan is ignoring requested __asan_handle_no_return:
>     stack top: 0xff9fc000; bottom 0xf3be8000; size: 0x0be14000 (199311360)
>   False positive error reports may follow
>   For details see https://github.com/google/sanitizers/issues/189
> 
> This works on 64-bit sandbox, but 32-bit sandbox currently crashes on
> bthread -v:
> 
> ==2469590==AddressSanitizer CHECK failed: ../../../../../src/libsanitizer/asan/asan_poisoning.cpp:37 "((AddrIsAlignedByGranularity(addr + size))) != (0)" (0x0, 0x0)
>     #0 0xf7a4aa46 in AsanCheckFailed ../../../../../src/libsanitizer/asan/asan_rtl.cpp:73
>     #1 0xf7a6b5cf in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:78
>     #2 0xf7a4489f in __asan::PoisonShadow(unsigned long, unsigned long, unsigned char) ../../../../../src/libsanitizer/asan/asan_poisoning.cpp:37
>     #3 0xf7a4c81b in __asan_handle_no_return ../../../../../src/libsanitizer/asan/asan_rtl.cpp:595
>     #4 0x566a1ce7 in bthread_schedule /home/a3f/dl/barebox-stm32mp/common/bthread.c:178
>     #5 0x566a1d54 in bthread_reschedule /home/a3f/dl/barebox-stm32mp/common/bthread.c:165
>     #6 0x566a1d80 in bthread_trampoline /home/a3f/dl/barebox-stm32mp/common/bthread.c:56
>     #7 0x567f5bfb in coroutine_bootstrap (/home/a3f/dl/build/barebox/sandbox/barebox+0x1bdbfb)
>     #8 0x567f5c4b in coroutine_trampoline (/home/a3f/dl/build/barebox/sandbox/barebox+0x1bdc4b)
>     #9 0xf7f7056f  (linux-gate.so.1+0x56f)
>     #10 0xf7f70558  (linux-gate.so.1+0x558)
>     #11 0x56892fff  (/home/a3f/dl/build/barebox/sandbox/barebox+0x25afff)
> 
> Just disable the special ASan accounting there until this is figured
> out. bthreads still function there, but ASan may yield false positives
> according to the message. This does not affect non-sandbox platforms.
> 
> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>

Applied, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-03-22  4:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19  8:46 Ahmad Fatoum
2021-03-22  4:38 ` Sascha Hauer [this message]

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=20210322043803.GD23724@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox