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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Apr 2021 08:32:21 +0200
From:   Christoph Hellwig <>
To:     Kees Cook <>
Cc:     Greg Kroah-Hartman <>,
        Christoph Hellwig <>,
        Nathan Chancellor <>,
        Arnd Bergmann <>, Tejun Heo <>,
        Alexander Viro <>,
        "Rafael J. Wysocki" <>,
        Shuah Khan <>,
        Nathan Chancellor <>,
        Nick Desaulniers <>,
        Andrew Morton <>,
        Kefeng Wang <>,
        "Matthew Wilcox (Oracle)" <>,,,,, Michal Hocko <>,
        Alexey Dobriyan <>,
        Lee Duncan <>, Chris Leech <>,
        Adam Nichols <>,
Subject: Re: [PATCH v4 3/3] sysfs: Unconditionally use vmalloc for buffer

On Thu, Apr 01, 2021 at 03:13:20PM -0700, Kees Cook wrote:
> The sysfs interface to seq_file continues to be rather fragile
> (seq_get_buf() should not be used outside of seq_file), as seen with
> some recent exploits[1]. Move the seq_file buffer to the vmap area
> (while retaining the accounting flag), since it has guard pages that will
> catch and stop linear overflows. This seems justified given that sysfs's
> use of seq_file almost always already uses PAGE_SIZE allocations, has
> normally short-lived allocations, and is not normally on a performance
> critical path.

This looks completely weird to me.  In the end sysfs uses nothing
of the seq_file infrastructure, so why do we even pretend to use it?
Just switch sysfs_file_kfops_ro and sysfs_file_kfops_rw from using
->seq_show to ->read and do the vmalloc there instead of pretending
this is a seq_file.

> Once seq_get_buf() has been removed (and all sysfs callbacks using
> seq_file directly), this change can also be removed.

And with sysfs out of the way I think kiling off the other few users
should be pretty easy as well.

Powered by blists - more mailing lists