Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp881503pxk; Thu, 17 Sep 2020 20:13:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWaMDDouIQOiSPYO0qJkE58RjgMl+tVUGIeAa0sZMGknT5/auBqwAfEmb4/EhIPB5qJgbQ X-Received: by 2002:a17:906:719a:: with SMTP id h26mr34569411ejk.336.1600398793304; Thu, 17 Sep 2020 20:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398793; cv=none; d=google.com; s=arc-20160816; b=a6UP6xzXoxOLw+Seut/UbvCJyLYdK6HTAFfviUPaCiFQDUE6hcxqbAxQhZ51JiPqPS wpmvro5k2W/Mxrm1P9ExBNRu0BReso90SmPlb9tdnJq+3pG+fT30bNuAvDFsVP+QFBmj K8aAwq+BgbAiXbmyh3xpQCxs3rgycI+Lz61QvW18LuV9D6c185TqvPvkdNce23M2x0Qp OukK3azMfslSAqKkVq5n9eRLLRkhX5zSHjwwZtVT0uiAqIPwbEm1v6gAZL/ZbaB0jqR1 s5RzpAZcTqKYPyEOuAdcF3iOMHNzXGYMRWYueZtxfckFm9iMLkH+QgpfgqW8x57WkUUt 1/pA== 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=4CFNcWghWLt0h8pqyxF57g4t4CkjjDQ07IZfK+eJl48=; b=mhhHDjQMqATwWML+v9oL9/qHlI49BoMVbXUc2zI+jiTn/zD1vYVza/FYNaTJ/eJjKP uqBMV356KcqqkbLvQaRyJuae50cNDXvHFBfpIvklDX5LtJyHjUmaSwKnixkkXsidpa5F 2V/pmyOnxv6LwboG85P3L+D6ymopBY1C+N0lEdlh1OlKq7mE3UR2r6TnN1dQZf04WqUs UDuQ+Td3tMKAJS2JPjqyCA64XSCZ1t2ePZ2L3NT4PN9GDYX38VbxzPESo/rUKpgykZq0 J3AX5GfLlS+WkksWrd2az0xhR0o1mkoC2D+ZEmo+jcuCvZ5qgchISyRNmLSNxgErpWfJ Quig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="qoBk/1le"; 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 l18si1131294edw.354.2020.09.17.20.12.50; Thu, 17 Sep 2020 20:13:13 -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="qoBk/1le"; 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 S1729224AbgIRDKg (ORCPT + 99 others); Thu, 17 Sep 2020 23:10:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:48434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbgIRCCu (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 7D86F23770; Fri, 18 Sep 2020 02:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394567; bh=/ScECHuMMx+Z6V1XFj2xOe3d/sxOd6b+cZM2xBTfqao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qoBk/1lef7KeHqb8pxz+BLrgkt3GR+OSzNkgDlgn+2mNfi79gwZq4viyK3VfVMNLr 3fLf/0pAA6mWZTycCGjNPPYEGe0G3VulTcwmFn7UVQ1Z0Tp+rfDyW3jns0Ulv5n/7k le29IUCxS9R7n38ITCXlw3TYtZHnuH9cABrWghKs= 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 079/330] vcc_seq_next should increase position index Date: Thu, 17 Sep 2020 21:56:59 -0400 Message-Id: <20200918020110.2063155-79-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 8bf7092021f283944f0c5f4c364853201c45c611 ] 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/atm/proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/atm/proc.c b/net/atm/proc.c index d79221fd4dae2..c318967073139 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c @@ -134,8 +134,7 @@ static void vcc_seq_stop(struct seq_file *seq, void *v) static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos) { v = vcc_walk(seq, 1); - if (v) - (*pos)++; + (*pos)++; return v; } -- 2.25.1