-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
heap-buffer-overflow in PHP preg_replace on Mac M1 in Linux #302
Comments
that looks just like #86 which I thought was fixed and released already; can you make sure the vendored php you are using includes the fix? FWIW sanitizer might be also confused but the fact that vector operations operate outside their buffers since they obviously have to load aligned chunks of memory with a pointer somewhere in the middle. |
Did you mean to link a different issue? As far as I can tell, the stacks look quite different. Even if you meant that issue, the bundled pcre version is 10.42 for the version of PHP I am building, so it should include whatever fix you are referring to as it's the latest released version, yes? |
correct, updated my link; apologies for the confusion. still, my comment about ASAN stands; AFAIK this is just a buffer over read (affecting aarch64 regardless of OS), which is no reason to crash, as it is expected. FWIW, all architectures that have SIMD operations enabled (x86, s390x and next release also LoongArch) do the same buffer over reads but since they are done by generated sljit code it is not something that ASAN can "detect". |
I'll try the patch later. As far as ASAN is concerned, it can't tell "on purpose" types of ones apart from mistakes, so it makes sense it would complain. |
I had some travel, and I'm back now. I expect to try this out next week. |
I was able to double-check this today: no warnings, all tests pass 👍🏻 |
I have struggled to create a simple reproducer for this, but I do have a Dockerfile below. Here is the sanitizer output:
Here is an example backtrace of what PHP was doing:
My toolchain was built with this docker image:
Inside the container, run:
The parallelism of
-j2
is required because it takes a different path downrun-tests.php
.The text was updated successfully, but these errors were encountered: