Message ID | 20150212173218.GC25491@e104818-lin.cambridge.arm.com |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
From: Catalin Marinas <catalin.marinas@arm.com> Date: Thu, 12 Feb 2015 17:32:18 +0000 > On Thu, Feb 12, 2015 at 04:41:24PM +0000, David Miller wrote: >> Setting MSG_* bits that aren't supported by the protocol in any way >> gives undefined semantics. You may get an error, it may be silently >> ignored, etc. > > From the sendmsg(2) man page, if some bit in the flags is inappropriate > for the socket type, it should return -EOPNOTSUPP. But I can't tell > whether it refers only to bits which are defined (for other socket > types) or just any bit. The test itself checks for -EOPNOTSUPP but it > gets -EINVAL instead, hence the failure being reported. Thanks for thinking about this a bit more. Yes, -EINVAL is probably not the thing we should return in this situation. >> I'm not applying this, sorry. > > What I'm after is consistency between the native 32-bit kernel and the > compat layer on 64-bit. On the former, bit 31 is silently ignored, on > the latter it reports -EINVAL. > > We could as well do something like below but we end up with unnecessary > flags check on 32-bit. The question is whether such change would be > considered a 32-bit user ABI breakage. Ok, after some further consideration I like your original patch. If 32-bit ignores the value, 64-bit should too. So just mask it out. Please resubmit your original patch, I'll apply it, thanks! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/socket.h b/include/linux/socket.h index 6e49a14365dc..0b283397ca0a 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -272,11 +272,7 @@ struct ucred { #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exec for file descriptor received through SCM_RIGHTS */ -#if defined(CONFIG_COMPAT) #define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ -#else -#define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */ -#endif /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */