From: yuan linyu <cug...@163.com> Date: Thu, 29 Dec 2016 20:39:32 +0800
> From: yuan linyu <linyu.y...@alcatel-sbell.com.cn> > > 1. put_cmsg{_compat}() may copy data to user when buffer free space less than > control message header alignment size. > 2. scm_detach_fds{_compat}() may calc wrong fdmax if control message header > have greater alignment size. > > Signed-off-by: yuan linyu <linyu.y...@alcatel-sbell.com.cn> But can this actually happen, in practice? Take, for example, COMPAT_CMSG_DATA(). It aligns "struct compat_cmsghdr" to a multiple of a u32. I cannot think of any possibly way that, on any architecture whatsoever: CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)) evaludates to any value other than, exactly: sizeof(struct compat_cmsghdr) If you can come up with a case where this does happen in practice, I will continue to consider this patch. Otherwise, we should make the assumptions that exist explicit and get rid of all of the code that does that funny alignment upon the cmsghdr structure. Thanks.