diff options
author | Andrei Vagin <avagin@google.com> | 2020-10-15 23:13:40 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-10-15 23:15:48 -0700 |
commit | c002fc36f9bbf0fe3ed8b7712c72376f8f8190c1 (patch) | |
tree | 3bc4869c076c0e9e12e7e6b2c6b078db77a6c4e7 /test/syscalls/linux/socket_netlink_util.cc | |
parent | fc40ead6856603b85c978e9120c66721cdbfc87b (diff) |
sockets: ignore io.EOF from view.ReadAt
Reported-by: syzbot+5466463b7604c2902875@syzkaller.appspotmail.com
PiperOrigin-RevId: 337451896
Diffstat (limited to 'test/syscalls/linux/socket_netlink_util.cc')
-rw-r--r-- | test/syscalls/linux/socket_netlink_util.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/syscalls/linux/socket_netlink_util.cc b/test/syscalls/linux/socket_netlink_util.cc index 952eecfe8..bdebea321 100644 --- a/test/syscalls/linux/socket_netlink_util.cc +++ b/test/syscalls/linux/socket_netlink_util.cc @@ -67,10 +67,21 @@ PosixError NetlinkRequestResponse( RETURN_ERROR_IF_SYSCALL_FAIL(RetryEINTR(sendmsg)(fd.get(), &msg, 0)); + return NetlinkResponse(fd, fn, expect_nlmsgerr); +} + +PosixError NetlinkResponse( + const FileDescriptor& fd, + const std::function<void(const struct nlmsghdr* hdr)>& fn, + bool expect_nlmsgerr) { constexpr size_t kBufferSize = 4096; std::vector<char> buf(kBufferSize); + struct iovec iov = {}; iov.iov_base = buf.data(); iov.iov_len = buf.size(); + struct msghdr msg = {}; + msg.msg_iov = &iov; + msg.msg_iovlen = 1; // If NLM_F_MULTI is set, response is a series of messages that ends with a // NLMSG_DONE message. |