Skip to content
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

A possible case to hang the compiler #64

Closed
Escapingbug opened this issue Dec 11, 2021 · 3 comments
Closed

A possible case to hang the compiler #64

Escapingbug opened this issue Dec 11, 2021 · 3 comments
Assignees

Comments

@Escapingbug
Copy link

/dts-v1/;

/ {
    clocks = <&ref &ref>;

    ref: poc {
        phandle = <1>;
        #clock-cells = <0xffffffff>;
    };
};

During checks, in function check_property_phandle_args, the 0xffffffff value could trigger an integer overflow which will keep us in the loop forever.

@dgibson dgibson self-assigned this Dec 29, 2021
@dgibson
Copy link
Owner

dgibson commented Dec 29, 2021

Thanks for the report. Sorry it's taken me so long to look at it. Certainly looks like a bug, I've made an automated test case and I'm investigating now.

dgibson added a commit that referenced this issue Dec 29, 2021
If the corresponding '#xxx-cells' value is much too large, an integer
overflow can prevent the checks in check_property_phandle_args() from
correctly determining that the checked property is too short for the
given cells value.  This leads to an infinite loops.

This patch fixes the bug, and adds a testcase for it.  Further
information in #64

Reported-by: Anciety <anciety@pku.edu.cn>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
@dgibson
Copy link
Owner

dgibson commented Dec 29, 2021

Ok, I've applied a fix, it would be great if you can check it.

@dgibson
Copy link
Owner

dgibson commented Feb 2, 2023

Closing, since there's been no response.

@dgibson dgibson closed this as completed Feb 2, 2023
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

No branches or pull requests

2 participants