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

[BUG] Null Pointer Dereference in chip-im-responder #36923

Open
BoB13-Matter opened this issue Dec 20, 2024 · 1 comment
Open

[BUG] Null Pointer Dereference in chip-im-responder #36923

BoB13-Matter opened this issue Dec 20, 2024 · 1 comment
Assignees
Labels
bug Something isn't working needs triage

Comments

@BoB13-Matter
Copy link
Contributor

Reproduction steps

  1. Open Terminal 1 and start the chip-im-responder:

    $ ./chip-im-responder
  2. Open Terminal 2 and start the chip-im-initiator with its own IPv6 address ::1:

    $ ./chip-im-initiator ::1
  3. Observe the output in chip-im-responder and check sanitizer logs for a null pointer dereference.
    chip-im-responder log.txt

Description

  • While running the chip-im-responder and sending a command using chip-im-initiator, the function InteractionModelEngine::CheckCommandExistence() calls GetDataModelProvider(), which directly returns a nullptr when mDataModelProvider is uninitialized or unset. This leads to a null pointer dereference at InteractionModelEngine.cpp:1789.

  • Previously, a null-check for mDataModelProvider existed in InteractionModelEngine::GetDataModelProvider() (refer to InteractionModelEngine.cpp:1858). However, this check appears to have been removed in a recent change, potentially causing this regression.

    DataModel::Provider * InteractionModelEngine::GetDataModelProvider() const
    {
    [-] if (mDataModelProvider == nullptr)
    [-] {
            // These should be called within the CHIP processing loop.
            assertChipStackLockedByCurrentThread();
    [-]     SetDataModelProvider(CodegenDataModelProviderInstance());
    [-] }
        return mDataModelProvider;
    }

Bug prevalence

always

GitHub hash of the SDK that was being used

29c6fd8

Platform

core

Platform Version(s)

all versions

Anything else?

No response

@andy31415
Copy link
Contributor

#35749 disabled this test in CI because the im-responder assumes it can just override a subset of methods without having a consistent data model (so making it work is non-trivial)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
Development

No branches or pull requests

3 participants