From 463811e9681188813264f572aca230273ccd1375 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 13 Aug 2019 20:44:08 +0200 Subject: src: mnl: fix setting rcvbuffer size Kernel expects socklen_t (int). Using size_t causes kernel to read upper 0-bits. This caused tests/shell/testcases/transactions/0049huge_0 to fail on s390x -- it uses 'echo' mode and will quickly overrun the tiny buffer size set due to this bug. Fixes: 89c82c261bb5 ("mnl: estimate receiver buffer size") Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- src/mnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mnl.c b/src/mnl.c index f24d2ce0..97a2e076 100644 --- a/src/mnl.c +++ b/src/mnl.c @@ -240,7 +240,7 @@ static void mnl_set_sndbuffer(const struct mnl_socket *nl, static unsigned int nlsndbufsiz; -static int mnl_set_rcvbuffer(const struct mnl_socket *nl, size_t bufsiz) +static int mnl_set_rcvbuffer(const struct mnl_socket *nl, socklen_t bufsiz) { socklen_t len = sizeof(nlsndbufsiz); int ret; -- cgit v1.2.3