Re: [PATCH] configfs: avoid committing failed binary attribute writes

Breno Leitao <[email protected]>
Newsgroups gmane.linux.kernel
Message-ID <[email protected]>
On Fri, Aug 21, 2026 at 03:33:41PM +0800, Yichong Chen wrote:
> Configfs binary attributes buffer write data and submit the final buffer
> on release.  The write path sets write_in_progress before it knows
> whether the current write can be accepted.
> 
> If the first write fails before any data is copied, for example because
> the write exceeds cb_max_size or the buffer allocation fails, release still
> treats the file as having a pending binary write and calls the attribute
> write callback with the current buffer state.  For ACPI configfs, an
> oversized first write to the aml attribute can therefore fail with -EFBIG
> and then oops on close when acpi_table_aml_write() is called with a NULL
> buffer.
> 
> Only mark the binary attribute as having a write in progress after data
> has actually been copied into the buffer.
> 
> Fixes: 03607ace807b ("configfs: implement binary attributes")
> Signed-off-by: Yichong Chen <[email protected]>

Reviewed-by: Breno Leitao <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.