Skip to content

Fix OSS-Fuzz #588264417 - #25717

Closed
ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:fix-oss-fuzz-phi
Closed

ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:fix-oss-fuzz-phi

Conversation

@ndossche

Copy link
Copy Markdown
Member

Ref: https://issues.oss-fuzz.com/issues/588264417

The phi type had a double AND, and the type was derived incorrectly. Since the var_def_info variable may be overwritten with ANY, it incorrectly could match on a MAY_BE_LONG mask.
Instead, the easy approach is to take the type from the inputs.

Ref: https://issues.oss-fuzz.com/issues/588264417

The phi type had a double AND, and the type was derived incorrectly.
Since the `var_def_info` variable may be overwritten with ANY, it
incorrectly could match on a `MAY_BE_LONG` mask.
Instead, the easy approach is to take the type from the inputs.

@jorgsowa jorgsowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks simple and good to me

@jorgsowa

Copy link
Copy Markdown
Contributor

nit: Check jit->ctx.ir_base[phi].type == IR_LONG may be used also in https://github.com/php/php-src/pull/25717/files#diff-5862e18deb17598d45fddc2cec9d59252d28d1d7a141362962429e66585b4101R6864

@ndossche

Copy link
Copy Markdown
Member Author

nit: Check jit->ctx.ir_base[phi].type == IR_LONG may be used also in https://github.com/php/php-src/pull/25717/files#diff-5862e18deb17598d45fddc2cec9d59252d28d1d7a141362962429e66585b4101R6864

What do you mean? For the phi node type check?

@jorgsowa

Copy link
Copy Markdown
Contributor

I am not sure it's visible in the provided link, so I paste screenshot
image

But it's just matter of consistency. May be ignored.

@ndossche

Copy link
Copy Markdown
Member Author

Hm no, when Z_MODE(var_addr) == IS_REG is true, the var_def_info can't be -1/ANY.

@ndossche ndossche closed this in 778f3ff Nov 25, 2026
@jorgsowa

Copy link
Copy Markdown
Contributor

That's true. That's why I mentioned it's just consistency check, if anything changes in the future. Anyways, it's not worth discussion, I shouldn't mentioned it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants