summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/socket_netdevice.cc
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-08-09 22:33:40 -0700
committergVisor bot <gvisor-bot@google.com>2019-08-09 22:34:54 -0700
commitaf90e68623c729d0e3b06a1e838c5584d2d8b7c2 (patch)
tree7e575a45207e23b8958be013158e566d89ebf9ea /test/syscalls/linux/socket_netdevice.cc
parentf2762e8c60b0a83f976c9eedd4a8c08e32cb6856 (diff)
netlink: return an error in nlmsgerr
Now if a process sends an unsupported netlink requests, an error is returned from the send system call. The linux kernel works differently in this case. It returns errors in the nlmsgerr netlink message. Reported-by: syzbot+571d99510c6f935202da@syzkaller.appspotmail.com PiperOrigin-RevId: 262690453
Diffstat (limited to 'test/syscalls/linux/socket_netdevice.cc')
-rw-r--r--test/syscalls/linux/socket_netdevice.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/syscalls/linux/socket_netdevice.cc b/test/syscalls/linux/socket_netdevice.cc
index 6a5fa8965..765f8e0e4 100644
--- a/test/syscalls/linux/socket_netdevice.cc
+++ b/test/syscalls/linux/socket_netdevice.cc
@@ -89,7 +89,8 @@ TEST(NetdeviceTest, Netmask) {
// (i.e. netmask) for the loopback device.
int prefixlen = -1;
ASSERT_NO_ERRNO(NetlinkRequestResponse(
- fd, &req, sizeof(req), [&](const struct nlmsghdr *hdr) {
+ fd, &req, sizeof(req),
+ [&](const struct nlmsghdr *hdr) {
EXPECT_THAT(hdr->nlmsg_type, AnyOf(Eq(RTM_NEWADDR), Eq(NLMSG_DONE)));
EXPECT_TRUE((hdr->nlmsg_flags & NLM_F_MULTI) == NLM_F_MULTI)
@@ -111,7 +112,8 @@ TEST(NetdeviceTest, Netmask) {
ifaddrmsg->ifa_family == AF_INET) {
prefixlen = ifaddrmsg->ifa_prefixlen;
}
- }));
+ },
+ false));
ASSERT_GE(prefixlen, 0);