Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2346727imm; Mon, 28 May 2018 06:28:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpIcyjM61kQQn+DVT0Kztpq6Zk56KOsUG84wDSh9wyhIpKd5elpuAGiGJd+xRQZgZxsmnol X-Received: by 2002:a17:902:5409:: with SMTP id d9-v6mr13459330pli.1.1527514124519; Mon, 28 May 2018 06:28:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527514124; cv=none; d=google.com; s=arc-20160816; b=CWpFNAAk01weL5rSBuYYGxkmScWlNaiK1XUjxF2iP9fn4TnHGj5QvzlEXqQNwbbUIO aCWSUQvg+i9D0Z7LB00V4P8p9W+3txVapLZELQUIX+DaqK/QPAF5aakG/h+ST0E/OLHn AN1acAN2uTVNwCTrcW76Vc4EmtzmKXq9HspYG1+HaZPYnZ2Yeq/zg6Z1aD/T2lFj0Clh CB3RxXUfZlNSHJy+gYVldmPyvjRy1xs94+qQgndGVm9WduBG6trSeeeRhDpUfL8QOzU2 MUU7bsr/EJZIoLvdEWZwLYS1+0PQ0YTgH/+FMp9u7qGkPuBZ4HquABc5I8JC9x910tqo lTjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=ANYRIk8oEIzkQQnrTitQYnD47MOusiJbCU7zfNCqQkg=; b=Ysa6d9IB84Kd4H6WC17JKbb7k6gKBAcAIfCllWxYBD6Vvt2bVmNeP8zRvt4vUMRxit uqLWnrlfMWbn4ivCC+IgySB7oO5ip/Kv7DpJ4erXLwoBMS0U8ilfuzHhwXj6MTXHzIV1 LfymzbethFyPxBRybrnTCRJa9rlNRT8Op+vmLemrnHWVKQMQFKijR0O9mbzqjQI8ZpLj yQ30GRpR2+zb3VaOOKFBQeYl9i5Q0XmsJTYtfrnxGfr9OaVtxMFqfSm2RY1JqNoct9wW YksOZOLj9s2x9xl1Wdyw+5BHfIG6QIYGxtPXB4gscgcRGR1baipJmAg5HKZwgFiYBfem /PTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJiwyHqM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si30253796plb.77.2018.05.28.06.28.29; Mon, 28 May 2018 06:28:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJiwyHqM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034316AbeE1Kry (ORCPT + 99 others); Mon, 28 May 2018 06:47:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:37790 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034279AbeE1Kro (ORCPT ); Mon, 28 May 2018 06:47:44 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44806204EE; Mon, 28 May 2018 10:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504463; bh=+9/vxwj0HxRS/KLcitLiSRinAUKCPx9TvYs2Et07Dqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJiwyHqMLLGMz+9feVA64Fhjs6gKGgZhH9bqXY0VrcyRSLr81hKYvLi0LUfEvs53z iVblRy254CSbqb12YxgHXIONGMn0xUL55iuqWn8t8+tJHocQKurErh2jkglCIc9Enk xcZiOrqZejn9JW4aqwev97I9B7tIZvaRu7Rtwdwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sven Eckelmann , Simon Wunderlich , Sasha Levin Subject: [PATCH 4.14 148/496] batman-adv: Ignore invalid batadv_v_gw during netlink send Date: Mon, 28 May 2018 11:58:53 +0200 Message-Id: <20180528100326.137060246@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann [ Upstream commit 011c935fceae5252619ef730baa610c655281dda ] The function batadv_v_gw_dump stops the processing loop when batadv_v_gw_dump_entry returns a non-0 return code. This should only happen when the buffer is full. Otherwise, an empty message may be returned by batadv_gw_dump. This empty message will then stop the netlink dumping of gateway entries. At worst, not a single entry is returned to userspace even when plenty of possible gateways exist. Fixes: b71bb6f924fe ("batman-adv: add B.A.T.M.A.N. V bat_gw_dump implementations") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/bat_v.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -930,7 +930,7 @@ static int batadv_v_gw_dump_entry(struct struct batadv_neigh_ifinfo *router_ifinfo = NULL; struct batadv_neigh_node *router; struct batadv_gw_node *curr_gw; - int ret = -EINVAL; + int ret = 0; void *hdr; router = batadv_orig_router_get(gw_node->orig_node, BATADV_IF_DEFAULT);