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

[PW_SID:654784] client: fix crash from unknown properties #90

Closed
wants to merge 6 commits into from

Conversation

IWDTestBot
Copy link
Owner

The dbus proxy code assumes that every interface has a set of
properties registered in a 'proxy_interface_property' structure,
assuming the interface has any properties at all. If the interface
is assumed to have no properties (and no property table) but
actually does, the property table lookup fails but is assumed to
have succeeded and causes a crash.

This caused iwctl to crash after some properties were added to DPP
since the DPP interface previously had no properties.

Now, check that the property table was valid before accessing it. This
should allow properties to be added to new interfaces without crashing
older versions of iwctl.

client/dbus-proxy.c | 3 +++
1 file changed, 3 insertions(+)

IWD uses a few pragmas to ignore warnings which clang does
not support. For -Werror builds these cause build failures
but can be fixed by ignoring unknown warnings and pragmas.
This was using a lambda function as input which runs much too fast
for UML to advance the time. Change this to sleep for 100ms between
each check.

This fixes the random hang in testNetconfig.
The dbus proxy code assumes that every interface has a set of
properties registered in a 'proxy_interface_property' structure,
assuming the interface has any properties at all. If the interface
is assumed to have no properties (and no property table) but
actually does, the property table lookup fails but is assumed to
have succeeded and causes a crash.

This caused iwctl to crash after some properties were added to DPP
since the DPP interface previously had no properties.

Now, check that the property table was valid before accessing it. This
should allow properties to be added to new interfaces without crashing
older versions of iwctl.
The dbus proxy code assumes that every interface has a set of
properties registered in a 'proxy_interface_property' structure,
assuming the interface has any properties at all. If the interface
is assumed to have no properties (and no property table) but
actually does, the property table lookup fails but is assumed to
have succeeded and causes a crash.

This caused iwctl to crash after some properties were added to DPP
since the DPP interface previously had no properties.

Now, check that the property table was valid before accessing it. This
should allow properties to be added to new interfaces without crashing
older versions of iwctl.
@IWDTestBot
Copy link
Owner Author

Fetch PR
Test ID: fetch
Desc: Fetch the PR commits for this CI run
Duration: 3.07 seconds
Result: PASS

Make Distcheck
Test ID: makedistcheck
Desc: Run distcheck to check the distribution
Duration: 68.99 seconds
Result: PASS

Build - Configure
Test ID: build
Desc: Configure the BlueZ source tree
Duration: 11.49 seconds
Result: PASS

Make Check
Test ID: makecheck
Desc: Run 'make check'
Duration: 0.00 seconds
Result: SKIP

Output:

makecheck was skipped

Make Check w/Valgrind
Test ID: makecheckvalgrind
Desc: Run 'make check' with Valgrind
Duration: 19.98 seconds
Result: FAIL

Output:

client/dbus-proxy.c: In function 'proxy_interface_property_tostr':
client/dbus-proxy.c:90:17: error: 'return' with no value, in function returning non-void [-Werror=return-type]
   90 |                 return;
      |                 ^~~~~~
client/dbus-proxy.c:81:20: note: declared here
   81 | static const void *proxy_interface_property_tostr(
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2384: client/dbus-proxy.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1571: all] Error 2

Incremental Build with patches
Test ID: incremental_build
Desc: Incremental build per patch in the series
Duration: 0.44 seconds
Result: PASS

@IWDTestBot
Copy link
Owner Author

Fetch PR
Test ID: fetch
Desc: Fetch the PR commits for this CI run
Duration: 3.69 seconds
Result: PASS

GitLint
Test ID: gitlint
Desc: Run gitlint with rule in .gitlint
Duration: 0.52 seconds
Result: PASS

Make Distcheck
Test ID: makedistcheck
Desc: Run distcheck to check the distribution
Duration: 51.28 seconds
Result: PASS

Build - Configure
Test ID: build
Desc: Configure the BlueZ source tree
Duration: 12.31 seconds
Result: PASS

Make Check
Test ID: makecheck
Desc: Run 'make check'
Duration: 0.00 seconds
Result: SKIP

Output:

makecheck was skipped

Make Check w/Valgrind
Test ID: makecheckvalgrind
Desc: Run 'make check' with Valgrind
Duration: 43.67 seconds
Result: FAIL

Output:

client/dbus-proxy.c: In function ‘proxy_interface_property_tostr’:
client/dbus-proxy.c:90:17: error: ‘return’ with no value, in function returning non-void [-Werror=return-type]
   90 |                 return;
      |                 ^~~~~~
client/dbus-proxy.c:81:20: note: declared here
   81 | static const void *proxy_interface_property_tostr(
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2383: client/dbus-proxy.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1570: all] Error 2

Incremental Build with patches
Test ID: incremental_build
Desc: Incremental build per patch in the series
Duration: 0.37 seconds
Result: PASS

Autotest Runner
Test ID: testrunner
Desc: Runs IWD's autotest framework
Duration: 0.00 seconds
Result: SKIP

Output:

testrunner was skipped

Clang Build
Test ID: clang
Desc: Build IWD using clang compiler
Duration: 47.36 seconds
Result: FAIL

Output:

client/dbus-proxy.c:90:3: error: non-void function 'proxy_interface_property_tostr' should return a value [-Wreturn-type]
                return;
                ^
1 error generated.
make[1]: *** [Makefile:2383: client/dbus-proxy.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1570: all] Error 2

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.

None yet

2 participants