Hide Forgot
socket_wrapper failed to build from source in Fedora rawhide/f36 https://koji.fedoraproject.org/koji/taskinfo?taskID=81986643 For details on the mass rebuild see: https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Please fix socket_wrapper at your earliest convenience and set the bug's status to ASSIGNED when you start fixing it. If the bug remains in NEW state for 8 weeks, socket_wrapper will be orphaned. Before branching of Fedora 37, socket_wrapper will be retired, if it still fails to build. For more details on the FTBFS policy, please visit: https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
Created attachment 1856675 [details] build.log file build.log too big, will only attach last 32768 bytes
Created attachment 1856676 [details] root.log file root.log too big, will only attach last 32768 bytes
Created attachment 1856677 [details] state.log
This is actually a bug in /usr/include/bits/socket.h with -Werror=strict-overflow. The compiler complains about the CMSG_NXTHDR() macro. In file included from /usr/include/sys/socket.h:33, from /builddir/build/BUILD/socket_wrapper-1.3.3/src/socket_wrapper.c:50: In function '__cmsg_nxthdr', inlined from 'test_sendmsg_cmsg' at /builddir/build/BUILD/socket_wrapper-1.3.3/tests/test_swrap_unit.c:73:9: /usr/include/bits/socket.h:322:6: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow] 322 | if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control | ^ The line in test_swrap_unit.c:73 is: 73 »·······cmsg = CMSG_NXTHDR(&msg, cmsg);
We're going to fix this upstream, thanks for the report.
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36.
The following builds were made after this report was opened: glibc-2.35-2.fc37 glibc-2.35.9000-1.fc37 glibc-2.35.9000-10.fc37 glibc-2.35.9000-11.fc37 glibc-2.35.9000-12.fc37 glibc-2.35.9000-13.fc37 glibc-2.35.9000-14.fc37 glibc-2.35.9000-2.fc37 glibc-2.35.9000-3.fc37 glibc-2.35.9000-4.fc37 glibc-2.35.9000-5.fc37 glibc-2.35.9000-6.fc37 glibc-2.35.9000-7.fc37 glibc-2.35.9000-8.fc37 glibc-2.35.9000-9.fc37
Reopening. We should confirm the issues is fixed.
318 __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg 319 + CMSG_ALIGN (__cmsg->cmsg_len)); 320 if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control 321 + __mhdr->msg_controllen) 322 || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) 323 > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) 324 /* No more entries. */ 325 return (struct cmsghdr *) 0; 326 return __cmsg; In practice line 318+319 are all that is needed for this function when interacting with kernel code. The subsequent checks need to be rewritten to do a pointer difference rather than adding and moving the pointer forward possibly beyond the end of the data. You must compute if there is enough space to put the next control message header and rewrite with pointer arithmetic. We need to keep the existing checks because code can depend on them, even if the implementation could be simplified to just return '__cmsg + __cmsg->cms_len' as a simple answer.
I'm still running into this issue with Fedora 36!
In file included from /usr/include/sys/socket.h:33, from /home/asn/workspace/projects/socket_wrapper/src/socket_wrapper.c:50, from /home/asn/workspace/projects/socket_wrapper/tests/test_swrap_unit.c:10: In function ‘__cmsg_nxthdr’, inlined from ‘test_sendmsg_cmsg’ at /home/asn/workspace/projects/socket_wrapper/tests/test_swrap_unit.c:73:9: /usr/include/bits/socket.h:324:6: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow] 324 | if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control | ^
This has been addressed upstream. Can we get a fix for this for Fedora 37?
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle. Changing version to 37.
Hi Andreas, > This has been addressed upstream. Can we get a fix for this for Fedora 37? Yes! We plan to fix this in f37, f26, and f35, starting with rawhide. We recently had a glibc release upstream and were waiting for f37 to branch from rawhide so we can update rawhide again with the latest development branch. This is finally done. The header changes that should fix this in rawhide are in place since yesterday (glibc-2.36.9000-1.fc38). Would you please issue a fresh socket_wrapper build in rawhide? That would be a good confirmation that this issue is closed out in rawhide. Once that goes through, I'll go ahead and backport this to upstream release branches and then into the recent Fedora releases I mentioned above. Thanks! Arjun
I tested this by issuing a scratch build in rawhide for socket_wrapper. Then I backported the fix to the relevant upstream release branches for f37, f36, and f35, and synced the fedora releases to those branches. This should now be fixed in rawhide, f37, f36, and f35.
FEDORA-2022-84e8c5efde has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-84e8c5efde
FEDORA-2022-59a7796ddf has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-59a7796ddf
FEDORA-2022-59a7796ddf has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-59a7796ddf` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-59a7796ddf See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-84e8c5efde has been pushed to the Fedora 36 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-84e8c5efde` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-84e8c5efde See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-781669c384 has been pushed to the Fedora 35 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-781669c384` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-781669c384 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-403dca5e92 has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-403dca5e92` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-403dca5e92 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-27c04744e2 has been pushed to the Fedora 35 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-27c04744e2` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-27c04744e2 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2022-9471e772b5 has been pushed to the Fedora 36 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-9471e772b5` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-9471e772b5 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
I missed the needinfo sorry. I can confirm that the error compiling socket_wrapper is gone!