Skip to content

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

Closed
DL6ER wants to merge 1 commit into
masterfrom
fix/sendmsg_unititalized
Closed

Fix memcheck errors like "Syscall param sendmsg(msg.msg_control) points to uninitialised byte(s)"#17
DL6ER wants to merge 1 commit into
masterfrom
fix/sendmsg_unititalized

Conversation

@DL6ER
Copy link
Copy Markdown
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>
@DL6ER
Copy link
Copy Markdown
Member Author

DL6ER commented Dec 6, 2024

Merged in slightly modified form

@DL6ER DL6ER closed this Dec 6, 2024
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