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

_ASN_STACK_OVERFLOW_CHECK fails with ASAN #539

Open
AEberleMW opened this issue Feb 20, 2025 · 0 comments
Open

_ASN_STACK_OVERFLOW_CHECK fails with ASAN #539

AEberleMW opened this issue Feb 20, 2025 · 0 comments

Comments

@AEberleMW
Copy link

We are currently running libiec61850 on a ubunu 24.04 x86_64 with kernel 6.11.0, compiled with gcc using ASAN. Our client application is fetching all objects from a server (IedConnection_getLogicalNodeVariables) and then tries to read all data points using IedConnection_readObject.

After successfully reading a bunch of data, IedConnection_readObject returns with IED_ERROR_MALFORMED_MESSAGE resulting from _ASN_STACK_OVERFLOW_CHECK returning -1. While debugging this, I found out, that the OS is changing the stack memory area after certain calls and so the address of asn_codec_ctx_t is very different (> 1 MB) from the address of the pointer. It follows that _ASN_STACK_OVERFLOW_CHECK is not working correctly.

Since there is no possibility to disable _ASN_STACK_OVERFLOW_CHECK without changing the code, I would suggest to make it optional via compile flag or config option. There is already a PR in the orginal asn1c project, which seems to solve the problem: vlm/asn1c#476

Thanks,
Marco

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

1 participant