From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4C784570F2 for ; Fri, 21 Aug 2026 09:07:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787303278; cv=none; b=PDWsp3x6Dd1wWRasAopng8c5blKKVYj25k8Xt6zhGh2pIrWsUf4/OkDlYozf5pgr6nrKNDYuBl4RnYvrSI2eRkUmcSCAVtSUsOUGTJa1qwNzPK2Nkc2K10kmvgsAHmInpy3O/ovOf/YCe/uZVU/vW0Atk3SWE7d9PrenEeYhWY0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787303278; c=relaxed/simple; bh=e0wJxp+obZN/+ipA11whTBCXbUKTDQt5DctZSAoKu3w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BAAy0gjh2jyZe2RrCT9yFwV0Yjz+LqY1D4lxBF70fobPvd1Rh+K27FG84A6eUaifOWdyg0ODERbZUMVMe+4jF228o3JUlfhBNLY+/8Ze7+CPbuPx41YoPCZl5soRIFPFgIsdGI4V91+5qeeh9C5Xj8ejQLuoYq87DkIuBrpZPzQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=mpDp45a1; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="mpDp45a1" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pP7OF3g+I1Fua8fTdCdxW7xSB7hoTS6Ri3je+CWyIoc=; b=mpDp45a1eIGOqNk1FzKRZ5t7YE aW2Pp3jX59u174QjSZbFT1F88TZP75mVwWDmHhzFDOH+qeDtGWOn04JXvO253eklZ3IXCf65WSJr4 xBJt1eTHOc2zkklQSkYpsuIfs/GwG1fzwou11JFreBTs9kmOpv7PvVnX0NBiTYITp9RBXV2ozIkuK zuiBvGl7tFJ5NMaw0e9Tqn09w7FNjU0z6ftdQTWE8kuHvs7CtF00ES/M5Of6lbxIP4ODvPjedBjZT ijft6t1qA5e0K1KBLR8UCuX+TXILMio/oazSRp3hu7wwwQdGEW6TC/KikpWGl0XNVFbV9BcwVFXti PboI8AYg==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wxLDx-00BEH4-0d; Fri, 21 Aug 2026 09:07:41 +0000 Date: Fri, 21 Aug 2026 02:07:37 -0700 From: Breno Leitao To: Yichong Chen Cc: a.hindborg@kernel.org, pantelis.antoniou@konsulko.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] configfs: avoid committing failed binary attribute writes Message-ID: References: <20260821073341.2006955-1-chenyichong@uniontech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260821073341.2006955-1-chenyichong@uniontech.com> X-Debian-User: leitao 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 Reviewed-by: Breno Leitao