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

Two bugs may lead to NULL dereference. #15006

Closed
tluio opened this issue Sep 11, 2020 · 8 comments · Fixed by #19611
Closed

Two bugs may lead to NULL dereference. #15006

tluio opened this issue Sep 11, 2020 · 8 comments · Fixed by #19611
Labels
Area: drivers Area: Device drivers Area: USB Area: Universal Serial Bus Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Comments

@tluio
Copy link

tluio commented Sep 11, 2020

  1. sys/pipe/pipe_dynamic.c
    If malloc returns NULL on line 41, the variable m_pipe will be NULL, but the pointer to m_pipe->pipe is returned on line 46.

  2. drivers/usbdev_mock/usbdev_mock.c
    The variable res is checked on line 88 which indicates that it can be NULL, but the pointer to res->ep is returned on line 97.

@tluio tluio changed the title One bug may lead to NULL dereference. Two bugs may lead to NULL dereference. Sep 11, 2020
@tluio
Copy link
Author

tluio commented Sep 11, 2020

In sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c:
It can be inferred that dst can be NULL on line 1216, but it is dereferenced in gnrc_rpl_validation_DAO_ACK on line 1220.
And dst on line 677 seems to be the same.

@fjmolinas fjmolinas added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Sep 11, 2020
@fjmolinas
Copy link
Contributor

@bergzand can you check the one targeting usb?

@fjmolinas
Copy link
Contributor

@cgundogan can you take a look at the rpl issue?

@fjmolinas
Copy link
Contributor

Thanks for the catch @tluio, how did you come across these bugs, did you use some kind of vulnerability scanner?

@tluio
Copy link
Author

tluio commented Sep 11, 2020

Thanks for the catch @tluio, how did you come across these bugs, did you use some kind of vulnerability scanner?

It's my pleasure! Yes, I used a static code analysis tool written by myself.

@wosym
Copy link
Member

wosym commented Sep 15, 2020

@tluio Must be quite an impressive tool, seeing that you've managed to find 3 obscure bugs in RIOT, and some more in Zephyr and some other repos in only a few days time!
Are you planning to opensource this tool? Because I'm curious to see how it works :)

@tluio
Copy link
Author

tluio commented Sep 15, 2020

Thanks for your interest!
Our tool is still under development, so we consider releasing it in the future :)
Any suggestion to our bug report will be helpful to improving our tool.

@Citrullin
Copy link
Contributor

Thanks for your interest!
Our tool is still under development, so we consider releasing it in the future :)
Any suggestion to our bug report will be helpful to improving our tool.

Sounds like a tool you may want to present on an important conference. ;) Blackhat, Chaos Communication Congress or something similar.

@aabadie aabadie added Area: drivers Area: Device drivers Area: USB Area: Universal Serial Bus labels May 20, 2021
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 21, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@bors bors bot closed this as completed in 273f92a May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers Area: USB Area: Universal Serial Bus Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants