Skip to content

Conversation

SoniEx2
Copy link
Collaborator

@SoniEx2 SoniEx2 commented May 3, 2024

Chasing https://crbug.com/oss-fuzz/51561

Let's see if this breaks anything...

The issue only triggers if both conditions are true:

  • Multi-memory is enabled
  • Alignment (masked) is between 32 and 63

@SoniEx2 SoniEx2 force-pushed the fix-undefined-shifts branch 2 times, most recently from 41931ae to a517995 Compare May 4, 2024 00:03
@SoniEx2
Copy link
Collaborator Author

SoniEx2 commented May 4, 2024

cc @keithw because oss-fuzz

Copy link
Member

@keithw keithw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this!

@SoniEx2 SoniEx2 force-pushed the fix-undefined-shifts branch from a517995 to 1a566e6 Compare May 8, 2024 17:21
@SoniEx2 SoniEx2 requested a review from keithw May 8, 2024 19:25
@SoniEx2 SoniEx2 force-pushed the fix-undefined-shifts branch from 72582c2 to 0386a27 Compare August 9, 2024 01:56
@SoniEx2
Copy link
Collaborator Author

SoniEx2 commented Aug 9, 2024

ping @keithw @sbc100 (tests have also been upstreamed, tho wabt is currently a bit out of date on spec tests)

@keithw
Copy link
Member

keithw commented Aug 9, 2024

Thanks, and thanks for the ping. Do you think it would be better to consolidate the three ReadAlignment, TakeHasMemidx, and CheckAlignment functions into a single ReadAlignment(Address* align_log2, bool* has_memidx, const char* desc); that just does everything? That seems safer than requiring the caller to remember to call CheckAlignment each time (if ReadAlignment just always does it).

@keithw
Copy link
Member

keithw commented Aug 9, 2024

E.g. keithw/wabt@b09d4e0

@SoniEx2
Copy link
Collaborator Author

SoniEx2 commented Aug 9, 2024

we figured having the check in the same function is what caused the issue in the first place. further, different contexts may give different meanings to the alignment flags, so we would be against calling it "has memidx" in that case.

would you have another way to enforce that CheckAlignment is called?

@SoniEx2
Copy link
Collaborator Author

SoniEx2 commented Aug 9, 2024

how about this?

@keithw
Copy link
Member

keithw commented Aug 9, 2024

Let's just go back to the way you had it and call it done.

@SoniEx2
Copy link
Collaborator Author

SoniEx2 commented Aug 9, 2024

oh ;-; okay

@SoniEx2 SoniEx2 force-pushed the fix-undefined-shifts branch from 46434e5 to 0386a27 Compare August 9, 2024 22:15
@keithw keithw enabled auto-merge (squash) August 9, 2024 22:20
@keithw keithw merged commit 63fefe3 into WebAssembly:main Aug 9, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants