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

Fix memcheck errors like "Syscall param sendmsg(msg.msg_control) points to uninitialised byte(s)" #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Jul 27, 2024

Hey Simon,

another patch fixing a small memcheck error reported during Pi-hole
testing. The error is caused in send_from() (forward.c) by handing a
partially uninitialized stack variable to sendmsg() when nowild == false.

Full error output (example):

==1052839== Syscall param sendmsg(msg.msg_control) points to
uninitialised byte(s)
==1052839== at 0x4B7199D: __libc_sendmsg (sendmsg.c:28)
==1052839== by 0x4B7199D: sendmsg (sendmsg.c:25)
==1052839== by 0x21EADB: send_from (forward.c:101)
==1052839== by 0x222551: receive_query (forward.c:1988)
==1052839== by 0x20FD6A: check_dns_listeners (dnsmasq.c:1886)
==1052839== by 0x2120EF: main (dnsmasq.c:1278)
==1052839== Location 0x1fff000098is 24bytes inside local var "control_u"
==1052839== declared at forward.c:49, in frame #1of thread 1
==1052839== Uninitialised value was created by a stack allocation
==1052839== at 0x21EA11: send_from (forward.c:38)

Note that the line-numbers are not necessarily 100% accurate. We have
not noticed any abnormal behavior, however, fixing this reported error
is easy enough.

Best,
Dominik

https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2024q3/017654.html

…ts to uninitialised byte(s)"

Signed-off-by: DL6ER <dl6er@dl6er.de>
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.

1 participant