From: Dmitry V. Levin Date: Sat, 8 Jul 2017 14:57:44 +0000 (+0000) Subject: net: accept large option length for SO_LINGER X-Git-Tag: v4.19~318 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ccd8867067d4c6109d5aa18c37e85ffbe4a193f;p=strace net: accept large option length for SO_LINGER * net.c (print_linger): Allow len > sizeof(struct linger) to match the kernel behaviour. --- 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;