Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp299478pxb; Mon, 13 Sep 2021 19:54:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7PyBX2P/Phbo7VbntlI8Nfj0BH49HqLu3vcjp7J7j0ibJI/C5XtMsDICfpFyO/ENUPnZk X-Received: by 2002:a6b:e604:: with SMTP id g4mr11502177ioh.148.1631588054168; Mon, 13 Sep 2021 19:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631588054; cv=none; d=google.com; s=arc-20160816; b=HJrHRNcCwf1s1Mdq69dDeIV/1fmU0wfTrWehgYRcIjNCczOTwRlfTy+cudEsfeSRrY NMEO1Pcnz6f8XtumuVJvIPSYki6qaBIPtG73h10OoqxzMTgxayeZnRwVeMchCQoPfE6j U1h6K5lB5bCdtCbBQSCzfnO5LqxKi4wdrk+VjvQznkqr3P56IIoUraJr6hT5e4Ksfds1 yFxsOefQd8e3eGrJp5h5NDGX5ePrW/nrOGd58sQ9Uq3D6jXYdVitDXi9s83lm05EGWdi e6VjFesbJK+oCldi3YUdb/2v5iqUwq1Pk5a7XQmrz9SDEwwxWhNHJvPBkwU7BOL1/YpA 7nyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=n9QXTYQ7gFuOAX5ceoQmW2i5wwUUt7ZoVGuJ1Q+ByGg=; b=L+0xr92IjtwsnNuaBdOtESWvV1xHYVH/RkWeSKaL5FDZ8hAvNrqsWJVZPrKqVX0jIR irlJTr3fdwPyO5fgo3XYtyTHWTOdTaW1sZwtShXK5Uve4XrME7omZ7+vR4UUL4d7wJhB +GtiVm5/C7n5FXMhNVhWbuHHqullF7k8RO0DnuzYHnCsiCHFJfyqKx+H2RJWpPWsO+ex Y58k52mRx2hbwoQEtLUUjGPh54qoqCOQUewSwCjZnijzZiAQpRORCz+IGhyqW9nk0Xeq Gv1ArPXTkEyIkFY6shBaAce5if1mR4ItMZK2GpTmhBH+X181fqWY15HKWg92+QJwyHfo 02aw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si8664526iod.5.2021.09.13.19.54.02; Mon, 13 Sep 2021 19:54:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237855AbhINCyX (ORCPT + 99 others); Mon, 13 Sep 2021 22:54:23 -0400 Received: from mail-pf1-f170.google.com ([209.85.210.170]:43766 "EHLO mail-pf1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237098AbhINCyW (ORCPT ); Mon, 13 Sep 2021 22:54:22 -0400 Received: by mail-pf1-f170.google.com with SMTP id f65so10756661pfb.10; Mon, 13 Sep 2021 19:53:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=n9QXTYQ7gFuOAX5ceoQmW2i5wwUUt7ZoVGuJ1Q+ByGg=; b=Xu7WPbsrPN/H+b1DejJAqwAADVjtRHXlZNzHN3jFdg2o21KfB3RwROJdeCtCJbXLlB 65edHKblIYVM9SHpma6ysixqv5C2xNhWbnpdzk2xKTwmM8vGdTyDguIi/r/rdVnDoESH nHk4vKq2q9iPgUlYZSEdqlNVQKhzgLr5EJ3hLl5k0Vca6astmsBN/ehG3/X+8C3X18EL zloK1YPTt4IwSokWVD5XUMv6niZR+/mVoBB2DFSEd0IGfHEyiD0BHE52JB/wp5d+qtyG dMlba5viScpxoxQKS8xkMqPJ9R0M7qVN2nYVZnWHUAgh/FOcSLbWG45MEyy/ZFgQ9xAl UT4Q== X-Gm-Message-State: AOAM531or95cbgc9Kb3zRcIlhiP613AfKSCydnBxum4dSE63iaduCJSM uc8cq+hciMVCkGIzZcVoGo4Wwpe4W3M= X-Received: by 2002:aa7:9e4b:0:b0:43d:fb1d:39cb with SMTP id z11-20020aa79e4b000000b0043dfb1d39cbmr1736166pfq.69.1631587985821; Mon, 13 Sep 2021 19:53:05 -0700 (PDT) Received: from ?IPV6:2601:647:4000:d7:e47e:ab85:4d9e:deba? ([2601:647:4000:d7:e47e:ab85:4d9e:deba]) by smtp.gmail.com with ESMTPSA id o22sm8168010pji.18.2021.09.13.19.53.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 19:53:04 -0700 (PDT) Message-ID: <2bd7d03e-c2d0-0cb5-76fc-f5601324a18d@acm.org> Date: Mon, 13 Sep 2021 19:53:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: start switching sysfs attributes to expose the seq_file Content-Language: en-US To: Greg Kroah-Hartman Cc: Christoph Hellwig , "Rafael J. Wysocki" , Alexander Viro , Jens Axboe , Tejun Heo , linux-block@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210913054121.616001-1-hch@lst.de> <21413ac5-f934-efe2-25ee-115c4dcc86a5@acm.org> From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/21 09:46, Greg Kroah-Hartman wrote: > On Mon, Sep 13, 2021 at 09:39:56AM -0700, Bart Van Assche wrote: >> On 9/12/21 10:41 PM, Christoph Hellwig wrote: >>> Al pointed out multiple times that seq_get_buf is highly dangerous as >>> it opens up the tight seq_file abstractions to buffer overflows. The >>> last such caller now is sysfs. >>> >>> This series allows attributes to implement a seq_show method and switch >>> the block and XFS code as users that I'm most familiar with to use >>> seq_files directly after a few preparatory cleanups. With this series >>> "leaf" users of sysfs_ops can be converted one at at a time, after that >>> we can move the seq_get_buf into the multiplexers (e.g. kobj, device, >>> class attributes) and remove the show method in sysfs_ops and repeat the >>> process until all attributes are converted. This will probably take a >>> fair amount of time. >> >> Hi Christoph, >> >> Thanks for having done this work. In case you would need it, some time ago >> I posted the following sysfs patch but did not receive any feedback: >> "[PATCH] kernfs: Improve lockdep annotation for files which implement mmap" >> (https://lore.kernel.org/linux-kernel/20191004161124.111376-1-bvanassche@acm.org/). >> > > That was from back in 2019, sorry I must have missed it. > > Care to rebase and resend it if it is still needed? Hi Greg, I think that patch is still relevant. It removes some ugly code from sysfs. I will rebase, retest and resend it. Thanks, Bart.