Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3690076ybv; Mon, 10 Feb 2020 04:46:17 -0800 (PST) X-Google-Smtp-Source: APXvYqw1N76u4AHsxj8CVOCSoZpw097LNOqlt2SLn2W/HJ8CaYLXH5E2wtoSP9yls6lh4Dbn4Q4w X-Received: by 2002:a9d:6446:: with SMTP id m6mr887374otl.122.1581338777578; Mon, 10 Feb 2020 04:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581338777; cv=none; d=google.com; s=arc-20160816; b=YHIq3AxS6tWHYzcbX1A4aGtrr2fTWIzgsE61svoCXRn0kXg3WyPW3I75VpSTuwWEGu yrRJO+BZnHQkhGp6KEs/83nkoz9+QQMS84NT9SxBX/P5b42lQuob7JtgRhrUK9tSPmZj YglyIY4hGY35QKHvqOLRCsRN1o6PHAY2f1uuV9FycVPx7QZUxuxjRvJ/JbfLTjx8rB13 CU4WjdiAfByFAkXlomjpn7zFB8EG4IAnqoTT8ZmkwG0YT9Xo77mhVoqVxTjjUSzTbYj6 +5j1WcoAKgkIZpILZQsmPhVcoOnrFJ1597QxnsOjw3ombRnViQAampFtadFlFjrSOI7Y CnmA== 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:dkim-signature; bh=Q925rlQgYjkUAZNSZZQcQib8oHn/mWI/ghWhoeXJxds=; b=Szy0b9IoFA/LlebAV766sz4r8J7isOGP/3SEY0qHHcZ2W0pusVU90v2wsOZrHVfwDG lsu05NDkd+o+6kp85sof0MEx0+xeg2la81qDlTNaap88x2dWFpXOP5OfuWpKntCgrcEX +O9ce0xVw7qmJckOLn4yHzVp0hbKbCWn6a3jm5+GVLpAihmu4nWXaO6mYUK5+uz2A0JZ GUjxojWwFL+Yu6a8uiUT9D6eQpex3Q4/5qGx1LMq2sAYbFIOVkoRIRkpghI4l1rOjPQr I0XcwJ6v+BUqjaUTZUIvMhMMldcFLp4MAswGxMnVrR0ozBZaXpCpvFml5tWnalU/rPwt lwXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="OF/9f8hH"; 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 z206si137485oia.142.2020.02.10.04.46.06; Mon, 10 Feb 2020 04:46:17 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b="OF/9f8hH"; 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 S1730744AbgBJMo6 (ORCPT + 99 others); Mon, 10 Feb 2020 07:44:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:41670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729803AbgBJMkt (ORCPT ); Mon, 10 Feb 2020 07:40:49 -0500 Received: from localhost (unknown [209.37.97.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEB7320661; Mon, 10 Feb 2020 12:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338448; bh=8HSn47iVmVuHK5R6HJ9DPCtyktsjn3EOBpK6AgA2IB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OF/9f8hHWMkCzGo1FfqkPnbjFvqUyzSCyx5GDoqYaJfyK80vNHGJckrgUWnYsR6cI AqM2DqFuLXhAR5hrVOt0b64+g7n0h3DFDCfMWqFnbL/8evvF6El/e3G8jtJlDQ9Aqj zQfHyB/POSY3RxTWtmziXtSuvdN8ewwkBZvLf/Ns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, stable@kernel.org, Vasily Averin , Jan Kara , Theodore Tso Subject: [PATCH 5.5 192/367] jbd2_seq_info_next should increase position index Date: Mon, 10 Feb 2020 04:31:45 -0800 Message-Id: <20200210122442.319188014@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Vasily Averin commit 1a8e9cf40c9a6a2e40b1e924b13ed303aeea4418 upstream. if seq_file .next fuction does not change position index, read after some lseek can generate unexpected output. Script below generates endless output $ q=;while read -r r;do echo "$((++q)) $r";done Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/d13805e5-695e-8ac3-b678-26ca2313629f@virtuozzo.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/jbd2/journal.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -982,6 +982,7 @@ static void *jbd2_seq_info_start(struct static void *jbd2_seq_info_next(struct seq_file *seq, void *v, loff_t *pos) { + (*pos)++; return NULL; }