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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190329083440.GA12945@amd>
Date:   Fri, 29 Mar 2019 09:34:40 +0100
From:   Pavel Machek <pavel@....cz>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Marek Behun <marek.behun@....cz>, Tejun Heo <tj@...nel.org>,
        linux-kernel@...r.kernel.org,
        Jacek Anaszewski <jacek.anaszewski@...il.com>
Subject: Re: kernfs: can read/write method grow buffer size?

On Fri 2019-03-29 07:22:53, Greg Kroah-Hartman wrote:
> On Fri, Mar 29, 2019 at 04:09:22AM +0100, Marek Behun wrote:
> > Hello Tejun and Greg,
> > 
> > kernfs_fop_open/read/write allocates a buffer for the ->read, ->write,
> > or ->seq_read methods. This buffer is either preallocated or allocated
> > on the spot, with minimum size being PAGE_SIZE, if ->atomic_write_len
> > is not given.
> > 
> > There is a question/problem currently in the led-trigger API, that the
> > PAGE_SIZE buffer can in some specific scenarios be too short.
> 
> And that file is in sysfs?  That's a huge abuse of the sysfs api
> then :(

Yes, that's how we do selection from the list in sysfs, and
led-trigger is not alone there:

pavel@amd:~/cip$ cat /sys/power/state
freeze mem disk
pavel@amd:~/cip$ cat /sys/class/leds/phy0-led/trigger
none bluetooth-power rfkill-any rfkill-none kbd-scrolllock kbd-numlock
kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock
kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock
AC-online BAT0-charging-or-full BAT0-charging BAT0-full
BAT0-charging-blink-full-solid rfkill0 phy0rx phy0tx phy0assoc
phy0radio [phy0tpt] mmc0 timer heartbeat audio-mute audio-micmute
rfkill1 hci0-power rfkill8
pavel@amd:~/cip$

Now problem is that list grew long over time... and it is too late to
change the API now (and alternatives seem worse than present
solution).
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ