lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 13 Sep 2021 07:41:08 +0200
From:   Christoph Hellwig <hch@....de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Alexander Viro <viro@...iv.linux.org.uk>
Cc:     Jens Axboe <axboe@...nel.dk>, Tejun Heo <tj@...nel.org>,
        linux-block@...r.kernel.org, linux-xfs@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: start switching sysfs attributes to expose the seq_file

Hi all,

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.

Diffstat:
 block/bfq-iosched.c      |   12 +-
 block/blk-integrity.c    |   44 +++++----
 block/blk-mq-sysfs.c     |   64 ++++++--------
 block/blk-sysfs.c        |  209 ++++++++++++++++++++++++++---------------------
 block/blk-throttle.c     |    5 -
 block/blk.h              |    2 
 block/elevator.c         |   42 +++++----
 block/kyber-iosched.c    |    7 -
 block/mq-deadline.c      |    5 -
 fs/sysfs/file.c          |  135 +++++++++++++++++-------------
 fs/sysfs/group.c         |   15 +--
 fs/sysfs/sysfs.h         |    8 +
 fs/xfs/xfs_error.c       |   14 +--
 fs/xfs/xfs_stats.c       |   24 ++---
 fs/xfs/xfs_stats.h       |    2 
 fs/xfs/xfs_sysfs.c       |   96 ++++++++++-----------
 include/linux/elevator.h |    4 
 include/linux/kernfs.h   |   28 ------
 include/linux/seq_file.h |    4 
 include/linux/sysfs.h    |    9 +-
 20 files changed, 376 insertions(+), 353 deletions(-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ