From patchwork Fri Feb 5 00:36:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 12069061 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=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 7D7A9C433DB for ; Fri, 5 Feb 2021 00:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3452D64F3F for ; Fri, 5 Feb 2021 00:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232160AbhBEAr1 (ORCPT ); Thu, 4 Feb 2021 19:47:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:37936 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232132AbhBEArZ (ORCPT ); Thu, 4 Feb 2021 19:47:25 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 376E8B06A; Fri, 5 Feb 2021 00:46:43 +0000 (UTC) From: NeilBrown To: Andrew Morton , Alexander Viro , Jonathan Corbet Date: Fri, 05 Feb 2021 11:36:30 +1100 Subject: [PATCH 0/3] Fix some seq_file users that were recently broken Cc: Xin Long , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Ingo Molnar , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Vlad Yasevich , Neil Horman , Marcelo Ricardo Leitner , "David S. Miller" , linux-sctp@vger.kernel.org, netdev@vger.kernel.org Message-ID: <161248518659.21478.2484341937387294998.stgit@noble1> User-Agent: StGit/0.23 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org A recent change to seq_file broke some users which were using seq_file in a non-"standard" way ... though the "standard" isn't documented, so they can be excused. The result is a possible leak - of memory in one case, of references to a 'transport' in the other. These three patches: 1/ document and explain the problem 2/ fix the problem user in x86 3/ fix the problem user in net/sctp I suspect the patches should each go through the relevant subsystems, but I'm including akpm as the original went through him. Thanks, NeilBrown --- NeilBrown (3): seq_file: document how per-entry resources are managed. x86: fix seq_file iteration for pat/memtype.c net: fix iteration for sctp transport seq_files Documentation/filesystems/seq_file.rst | 6 ++++++ arch/x86/mm/pat/memtype.c | 4 ++-- net/sctp/proc.c | 16 ++++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) -- Signature