Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp882400pxk; Thu, 17 Sep 2020 20:14:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBUOQy0+yggsVY4U8IjX0p6R+9URXJHMRHxP2IEWz/ngm1DteRio6ZlZMLSyTkw3edX0YY X-Received: by 2002:a17:906:4088:: with SMTP id u8mr34969550ejj.184.1600398874053; Thu, 17 Sep 2020 20:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398874; cv=none; d=google.com; s=arc-20160816; b=WpHJbQXXfmUsMjkXHoEte49U1yCXwMB7NVMyQs7CP/i23AVg+hM5Z0muMPdymVEodn W65NpymHEtTKVaA64aRjOkOd1oMrTHNYun72FV4GpieoKLWozmzRLhQyybRMinWG2xr/ FYRBYe5k5vsJloxf6kBRwBxj+OiGfcwwedAVjAd2QNYUpwACXVLcFtk2UoVdaoIXB6pN b0AMzb/QjZ71YJX8OZkwTiYXayh/Ad+y2uCkhbE6z5swUqaoUR/rsIke7mMXvVFU8Ic4 iC6OBzvMo6m5uE8JoQEyzKzutdoTCUjbzEopz3AbfeglrkFCSMj8Wot6OqBQfsbXClrN JlDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wo0yGJ9y9OZ7mX6IHcwzVNTiz/4sva7UrGF4N6EtN3o=; b=issF+5syKI2d+MQLUoaxI3gIZnNU6hOCdq/TCzU0ezxw78ndiaqMYGG2H7EIcy+loU hlaEa8ZyO91pSfc+rXSw3n6Qsil0prWY28IIaOWtSHV8DuCukTmfI1+NISWzaX1/kErd PlUDcQcCAJCxLdFUyhDQ2v9NezLPAF1FPfnhhKdwPdjTJDEUlQIfBWru6AGJfeifIwx1 rE056pcX0kxUzQLTsod/HJmZyyyvvzKPiqQ0LCBS3NWgZL33x1zKqSwyXyFQmZ39Ndh0 RDYifrVFDmjvAhwlOhWTlnSeBHj3QAxL/SYlGpvJgagLxlu1GlHYKtYqwEB9wiTBZauQ JDsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wxs+AjZV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si1468455ejr.202.2020.09.17.20.14.11; Thu, 17 Sep 2020 20:14:34 -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=wxs+AjZV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730433AbgIRDKS (ORCPT + 99 others); Thu, 17 Sep 2020 23:10:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:48440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbgIRCCv (ORCPT ); Thu, 17 Sep 2020 22:02:51 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93D98235F9; Fri, 18 Sep 2020 02:02:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394569; bh=RJSaYzSX/RV7AjaJvx5nC23xNMOEsgia/WJY1rxShVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wxs+AjZVQaCcYZ4tH1tasnE+fMiUE/6rE9X7kcM6XYIm97y9XYv5XAe7B0t0uWlKv lYKFdrj/0PDU9T7DfRAHPMl1aDoOPKrxsMPclT2B/vEQWJkQ0HPYH0l8rMPR644Adm B3py75TAjyd8kZKlG5r6vrDOk6tzHOsEPxJM7uCQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vasily Averin , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 081/330] rt_cpu_seq_next should increase position index Date: Thu, 17 Sep 2020 21:57:01 -0400 Message-Id: <20200918020110.2063155-81-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasily Averin [ Upstream commit a3ea86739f1bc7e121d921842f0f4a8ab1af94d9 ] if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. https://bugzilla.kernel.org/show_bug.cgi?id=206283 Signed-off-by: Vasily Averin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/ipv4/route.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/route.c b/net/ipv4/route.c index b3a8d32f7d8df..4360c90b636de 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -271,6 +271,7 @@ static void *rt_cpu_seq_next(struct seq_file *seq, void *v, loff_t *pos) *pos = cpu+1; return &per_cpu(rt_cache_stat, cpu); } + (*pos)++; return NULL; } -- 2.25.1