[PATCH v3] sockaddr.3type: POSIX Issue 8 will solve strict-aliasing issues with these types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Link: <https://austingroupbugs.net/view.php?id=1641>
Reported-by: Bastien Roucariès <rouca@xxxxxxxxxx>
Reported-by: Alejandro Colomar <alx@xxxxxxxxxx>
Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>
Cc: glibc <libc-alpha@xxxxxxxxxxxxxx>
Cc: GCC <gcc@xxxxxxxxxxx>
Cc: Stefan Puiu <stefan.puiu@xxxxxxxxx>
Cc: Igor Sysoev <igor@xxxxxxxxx>
Cc: Rich Felker <dalias@xxxxxxxx>
Cc: Andrew Clayton <andrew@xxxxxxxxxxxxxxxxxx>
Cc: Richard Biener <richard.guenther@xxxxxxxxx>
Cc: Zack Weinberg <zack@xxxxxxxxxxxx>
Cc: Florian Weimer <fweimer@xxxxxxxxxx>
Cc: Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
Cc: Jakub Jelinek <jakub@xxxxxxxxxx>
Cc: Sam James <sam@xxxxxxxxxx>
Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx>
---

Hi Eric,

I took your informal review as a "Reviewed-by".  Please confirm.
I've also modified the small wording thingy you suggested.

I'll float this patch in the list in case anyone has comments, and
will push some time this weekend (depending on many variables).

Cheers,
Alex

 man3type/sockaddr.3type | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3type/sockaddr.3type b/man3type/sockaddr.3type
index 2fdf56c59..cf8d601f5 100644
--- a/man3type/sockaddr.3type
+++ b/man3type/sockaddr.3type
@@ -117,6 +117,14 @@ .SH HISTORY
 was invented by POSIX.
 See also
 .BR accept (2).
+.PP
+These structures were invented before modern ISO C strict-aliasing rules.
+If aliasing rules are applied strictly,
+these structures would be extremely difficult to use
+without invoking Undefined Behavior.
+POSIX Issue 8 will fix this by requiring that implementations
+make sure that these structures
+can be safely used as they were designed.
 .SH NOTES
 .I socklen_t
 is also defined in
-- 
2.40.0




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux