From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89DFAC43466 for ; Fri, 18 Sep 2020 02:23:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5FFCF238E6 for ; Fri, 18 Sep 2020 02:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395793; bh=b4L+peW8joC0wtnlknOzY9zNYkJr1tC/jPAnGMInqXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=N12w6Bih05yTn2mzJvNmZPPvcoxNqLEPDov3+UD8FfKd/lYzYrNruTP8b3pSUbZh6 Xtx7M1xlbZW59fPOS9qm7SfdT4npDiLlQnv/v8pB5mr+7AGVQBVPIk7fERlpv1DwLT anyE01iKAxqU32mP5jb4kdLLeqqNyI1OAfVmI2e8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729771AbgIRCXI (ORCPT ); Thu, 17 Sep 2020 22:23:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:47200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729475AbgIRCQ7 (ORCPT ); Thu, 17 Sep 2020 22:16:59 -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 7F538238A0; Fri, 18 Sep 2020 02:16:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600395419; bh=b4L+peW8joC0wtnlknOzY9zNYkJr1tC/jPAnGMInqXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YehYmOt65JmKnqgckmYV/qG/enRP34L6Uhi6RAvyOk8E9GNNSbd6Bo2ivap2mq+J5 EwoKa+6wdhghpREfGjZM1Zs0dKHt6MZns7k36AE7g9VaJul+g1/9g/rDTFLJqPV3sV gmFeunCP0NlkDG5pvN+TZj1X8xr28D+y+ca2hJss= 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 4.4 13/64] neigh_stat_seq_next() should increase position index Date: Thu, 17 Sep 2020 22:15:52 -0400 Message-Id: <20200918021643.2067895-13-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918021643.2067895-1-sashal@kernel.org> References: <20200918021643.2067895-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 9849f1f4cf4f7..40d33431bc585 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -2798,6 +2798,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