Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1769640imm; Thu, 27 Sep 2018 02:08:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV61n+LZBQHXskcGcAn3PW338hwAWkE32p+yknWvhGieqhmr1OmmdkqX4MqesaZQo7FaX9dmo X-Received: by 2002:a62:d884:: with SMTP id e126-v6mr10363472pfg.150.1538039335624; Thu, 27 Sep 2018 02:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039335; cv=none; d=google.com; s=arc-20160816; b=sRbQPqd4ouMyAwyYbepXk1v55ikupAerf70UEXcuXpdbr/U7tnxzQMcnAcsdqXr75T ANi02ciabp9RGHH0l20TFvd9f9Pqin5nrSpqVsveJDaenUICEU/wtWkS32Tx8J4Rhoax 1eu0Irz2Sbo6IvpltDLIvCMuoa3xgtf5FGeFV6joaLsaZGnoz0nH51EUFDGWGT7HGq0q UP2F9qZBZc66R3wS8CsmDvwIZY/huilM0BuKeUxBPjeCIamLDx9Mshvejgo8sFi70zWa Mxmb0PaBuxRzRnd4tZb+GaVpT5aJDjT03oNfsEjtrltJLnJUzx5DMq0TIt6FAMny/Fh5 0o7w== 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; bh=+X8+kChSgZbRJxcjzXzw9lfd97zthFiGj5HRVefj7jg=; b=egRDkd1UHHRn4ffAfhqmuWjKrmLXIcrYqLStojSMNeOQHCFXZWTt1KoV5KktKJNwTG VqtqgEm3Aqrh1yM1Lv4pKUFEHjhH72oEsASSPrLb9I1ptyJLcRMsBiaNhaA80gq4jl+I Y48TePlfdIH/t4oIzCK8P4/Hmut7ZzvcYoKmCZmrghNBU3EN3fl3paZtYsZh8y2Sl5Kc CgPVOnbS7NvB/JV1n/8jiJ85fqjSJ8RjfYAGenpbJs8bkOlB3BvIsrTq5FLAqcyR1t1l 4U+0KK6rgdD5D++GEmPnGhLRgLCuK2mKhYBH5gV45sJXAuI0tZibn2l0XLWLu+IHnx3O BaoA== ARC-Authentication-Results: i=1; mx.google.com; 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 n12-v6si1509840pgl.136.2018.09.27.02.08.40; Thu, 27 Sep 2018 02:08:55 -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; 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 S1727741AbeI0PZT (ORCPT + 99 others); Thu, 27 Sep 2018 11:25:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54912 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeI0PZS (ORCPT ); Thu, 27 Sep 2018 11:25:18 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9655810A4; Thu, 27 Sep 2018 09:08:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Ahern , Wei Wang , Peter Oskolkov , "David S. Miller" Subject: [PATCH 4.18 20/88] net/ipv6: do not copy dst flags on rt init Date: Thu, 27 Sep 2018 11:03:01 +0200 Message-Id: <20180927090302.935471146@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Peter Oskolkov [ Upstream commit 30bfd93062814d6767e452a8f5ddcd97f7e38c7e ] DST_NOCOUNT in dst_entry::flags tracks whether the entry counts toward route cache size (net->ipv6.sysctl.ip6_rt_max_size). If the flag is NOT set, dst_ops::pcpuc_entries counter is incremented in dist_init() and decremented in dst_destroy(). This flag is tied to allocation/deallocation of dst_entry and should not be copied from another dst/route. Otherwise it can happen that dst_ops::pcpuc_entries counter grows until no new routes can be allocated because the counter reached ip6_rt_max_size due to DST_NOCOUNT not set and thus no counter decrements on gc-ed routes. Fixes: 3b6761d18bc1 ("net/ipv6: Move dst flags to booleans in fib entries") Cc: David Ahern Acked-by: Wei Wang Signed-off-by: Peter Oskolkov Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/route.c | 2 -- 1 file changed, 2 deletions(-) --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -946,8 +946,6 @@ static void ip6_rt_init_dst_reject(struc static void ip6_rt_init_dst(struct rt6_info *rt, struct fib6_info *ort) { - rt->dst.flags |= fib6_info_dst_flags(ort); - if (ort->fib6_flags & RTF_REJECT) { ip6_rt_init_dst_reject(rt, ort); return;