Hi! > > > recvfrom01: fix test for invalid message flags > > > > Agreed. We have seen in past, that this (.flags = ~MSG_CMSG_COMPAT) > > leads to undefined behavior. > > It appears the difference comes from LTP: > > https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/utils/msg_common.h > > The flags has 0 value when compiled with -m32, so we never make it pass > this check: > if (flags & MSG_CMSG_COMPAT) > return -EINVAL; > > but the kernel definition is rather based on config option: > #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
Tricky. But looking into the unix_dgram_sendmsg() which should be the one that gets called in the particular case, the code realy just checks for the MSG_OOB, just like the the recvmsg() case. ...... err = -EOPNOTSUPP; if (msg->msg_flags&MSG_OOB) goto out; ...... So I guess that we should be safe with changing the test the same way as we did with recvmsg(). > sendmsg01 seems to be the only place where this flag is used. That is because it has been removed from the recvmsg01.c by the fix mentioned in this thread. However the header in question stayed included there... -- Cyril Hrubis chru...@suse.cz ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list