Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp881206pxk; Thu, 17 Sep 2020 20:12:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMxQxNiLuGISmSGOpsSyHane/wTMved5Tolr8Vy3gtZ6spFA1f5IvuT81pPlzdGxiJrigb X-Received: by 2002:a17:906:7248:: with SMTP id n8mr33451469ejk.160.1600398774847; Thu, 17 Sep 2020 20:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398774; cv=none; d=google.com; s=arc-20160816; b=Tfa7VGGzoaebw09vaHCW3vqhW5xwJw9p5yQ1XWKufGixQmAXOUAn/HYJlpROYxSmjy xm4nyR9zHCvC/5CIGYKJLAhGQ5NHIknjiShIXMe/A993y9np0I9uCsMNKyBWVtJ0S4Oc EMCACgbJg91cBQz1ZwJ1bz7FulQL/zQ8ymjffnBfFvaxgV6FUj220NV371C6BGYkwyko se/SpeSGeBHlndVRi5OAxwZ1l15Gs9vVJKYGUs8hzpwRmdupMTUBBSZj9z694Iv8T14D 5Nmcha01z+/F8SHxjZoJp87TBoG6ibkmuNPxIyBYs1DEgvtXvQjiii2IxArtQEBjcPcF oPxw== 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=V0ev7p5UdJiA6tAm30lFJ+giC8jYqQZTFNQIvOfC+Lk=; b=0o3FMXa2B7wdAL/MsqzUhbfXZNjKB5Doroz1AuYfYIrk1uket6cVzWwQKyktgOeb00 G9OYYYIa73P3JeC3yvSrHilbNcRh/dX0S3ABPX9rYOZ7gPfdaw3WKPPIoD12Q3JGs+xQ XA2YK3tkD4R4s8f6xI+zInVgoc/S+yue+SSpMkLY2Xx5dYymX120jvsKaYG2xJleFOLv OAQBv5NBOK2YHyocbuax6LBldJQ7KyOmwYDIRWs0OktBkaQz6eiOrw2NV1soMFGnyjZV MsVKbcS0G7pYu+dbbtmxISn/6bGmrh5FLVl8Y4ng/E8oURWxwiiwmiPVF5+2dXMMdoLG eo7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="DQH6Hjd/"; 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 v15si1158113edw.67.2020.09.17.20.12.31; Thu, 17 Sep 2020 20:12:54 -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="DQH6Hjd/"; 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 S1730709AbgIRDKo (ORCPT + 99 others); Thu, 17 Sep 2020 23:10:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:48436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbgIRCCu (ORCPT ); Thu, 17 Sep 2020 22:02:50 -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 8A8F323772; Fri, 18 Sep 2020 02:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394568; bh=Z4tig6aruIz6mfjORxDavK1YfVzLhAsu1xNUQFQhaos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DQH6Hjd/3KQKHuyXxvxn47Gp8dX9rbCdepLKlQ2Pax02+ifyWHrCOa0b0gyZvn5+e /jA6paJMAC+hzVOt5BgN7hVtdaktQ4TxamiFEPTXhyVcdBm1vlbuWifrzoAaLhHumR jahsdbsUOAYJrUBI9cRPoSgzK4WzUM9vKJsIu8ZU= 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 080/330] neigh_stat_seq_next() should increase position index Date: Thu, 17 Sep 2020 21:57:00 -0400 Message-Id: <20200918020110.2063155-80-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 1e3f9f073c47bee7c23e77316b07bc12338c5bba ] 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/core/neighbour.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 7b40d12f0c229..04953e5f25302 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -3290,6 +3290,7 @@ static void *neigh_stat_seq_next(struct seq_file *seq, void *v, loff_t *pos) *pos = cpu+1; return per_cpu_ptr(tbl->stats, cpu); } + (*pos)++; return NULL; } -- 2.25.1