Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp667811ybg; Mon, 1 Jun 2020 11:12:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVf8jl0edD70QC4GzWTF5arBT0bsJS7CR4BIh3XK2Wwq6qsQgl+w+SsjckRdtT6m3qYcWZ X-Received: by 2002:a50:e007:: with SMTP id e7mr2863064edl.232.1591035131880; Mon, 01 Jun 2020 11:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591035131; cv=none; d=google.com; s=arc-20160816; b=KATs5jdLylVViYDdFdL1NeITyCE1tNKc36vqA38cdwo/GgFneplf49wRHSmJZEP9gE KxF+AZz0aTBbJKtMHIkzw5zgg10IJwKjYWjhyaxT4apVtNRWVPW6pX8nuw1+WPQ+dzRw adSkS3P5AH64B+2lAXt6uyv7hlEVKHcVnQbW/4D0Um8tO61izikyy7U7OIg0bC24bF1F q/YZyqN9qZng2VQ4J/DQVNcdOcTvqG0EP7YzuD+HMyKKSfzqF1TYoWCSz2dKd5wTvh8/ gNwgLRED7z8RdrB3pGN0W9TvpSLutTLEFF9+TB+u8XBLC+8yifMKq1nz2lL7YHJvzTl/ bZNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fbH0p4QNtQiaJS1/fgWCQNRaVb1xeH5bzSMpZ6grzAU=; b=ragqvBaOjv5RcqHa/NXmbLXlRnQRnGZqlMWFu4QLCPFWzfjglMkNgzzax/LjVFOQS0 0z9paablckYoOvg9xc/0iPX/qIO/LNzAjJAgn1veQ4typP9MPsh6YK3xc8V8XEwLQZMo u7+YCOF7sMynwGkyKG+qJyrIh5joIvH+8PSSy+2HIMr6mI/X2945QHMP621WYOX5eHZG UzqQDo5ggk2xhH825P9kJjHz9LN2Wn5mlVqrwLQnJau74djZYpCXq2et7eEfndj2APzh wA9aJIKae1xCB0RuSTMcqVOF1ydAxc8KTrHrNzoqA0scvsposD2PpqYufXvZHWWjZqHM Lgaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RkB4jEWe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc4si133186ejb.369.2020.06.01.11.11.48; Mon, 01 Jun 2020 11:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RkB4jEWe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730745AbgFASI3 (ORCPT + 99 others); Mon, 1 Jun 2020 14:08:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:54608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730742AbgFASI2 (ORCPT ); Mon, 1 Jun 2020 14:08:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 AD7122068D; Mon, 1 Jun 2020 18:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034908; bh=rarwAHqrjgn7Om4YPhznCvWP4IzKyrx4sWUE+jY6K7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RkB4jEWeSg/PR5uA5N2DXVcQqx+1PjS5N6New1ijvVyEWv7Uer5cZRDMb7KeyJC1p c9d1Ad6oTD0i1jd4cSA8GRdDsQO76Bp2/WVqujKHF6aULteTbVIiPHvIrP4wp537DF I6QTIk3rORK8u0s52w1UAIkjZotZaX4w2vyzq/QI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, ASSOGBA Emery , David Ahern , "David S. Miller" Subject: [PATCH 5.4 016/142] nexthop: Fix attribute checking for groups Date: Mon, 1 Jun 2020 19:52:54 +0200 Message-Id: <20200601174039.581323711@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174037.904070960@linuxfoundation.org> References: <20200601174037.904070960@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Ahern [ Upstream commit 84be69b869a5a496a6cfde9b3c29509207a1f1fa ] For nexthop groups, attributes after NHA_GROUP_TYPE are invalid, but nh_check_attr_group starts checking at NHA_GROUP. The group type defaults to multipath and the NHA_GROUP_TYPE is currently optional so this has slipped through so far. Fix the attribute checking to handle support of new group types. Fixes: 430a049190de ("nexthop: Add support for nexthop groups") Signed-off-by: ASSOGBA Emery Signed-off-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/nexthop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -435,7 +435,7 @@ static int nh_check_attr_group(struct ne if (!valid_group_nh(nh, len, extack)) return -EINVAL; } - for (i = NHA_GROUP + 1; i < __NHA_MAX; ++i) { + for (i = NHA_GROUP_TYPE + 1; i < __NHA_MAX; ++i) { if (!tb[i]) continue;