Bug 16852 - recvmmsg clobbers const argument
Summary: recvmmsg clobbers const argument
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 2.21
Assignee: Not yet assigned to anyone
Depends on:
Reported: 2014-04-18 01:01 UTC by Rich Felker
Modified: 2016-04-11 08:52 UTC (History)
3 users (show)

See Also:
Last reconfirmed:
fweimer: security-


Note You need to log in before you can comment on or make changes to this bug.
Description Rich Felker 2014-04-18 01:01:47 UTC
In sysdeps/unix/sysv/linux/recvmmsg.c, the const struct timespec *tmo argument is passed directly to the Linux syscall recvmmsg which overwrites the pointed-to struct with the remaining time. If this behavior is desired, the argument needs to be changed to be a pointer-to-non-const, but the policy elsewhere (in other analogous interfaces) seems to be to suppress the kernel behavior by using a temp copy of the timeout to pass to the kernel.
Comment 1 Florian Weimer 2015-02-18 14:43:10 UTC
Shouldn't the prototype be changed instead because the interface is specific to Linux?
Comment 2 Rich Felker 2015-02-18 18:54:00 UTC
This issue was discussed somewhere else -- I don't recall exactly but it was probably the man pages list or something kernel-related -- and the feeling was that the const in glibc is wrong since this is a Linux-specific interface. I'm okay with removing const and updating documentation to reflect Linux behavior if that's what you prefer. That's what we did in musl.
Comment 3 NODA, Kai 2016-04-10 14:46:01 UTC
Already fixed in 20e5a5f aka glibc-2.21~541