From 2ccd8867067d4c6109d5aa18c37e85ffbe4a193f Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 8 Jul 2017 14:57:44 +0000 Subject: [PATCH] net: accept large option length for SO_LINGER * net.c (print_linger): Allow len > sizeof(struct linger) to match the kernel behaviour. --- net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net.c b/net.c index 273edda0..5e20abc6 100644 --- a/net.c +++ b/net.c @@ -489,11 +489,12 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level, } static void -print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +print_linger(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned int len) { struct linger linger; - if (len != sizeof(linger) || + if (len < sizeof(linger) || umove(tcp, addr, &linger) < 0) { printaddr(addr); return; -- 2.50.1