From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 130F329BD95 for ; Mon, 16 Mar 2026 14:34:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773671687; cv=none; b=TNYJrPWTdNsPkvkAAaaBdeIvaSgmZKCUsSoyWAcKel6MH8/NWmaXHvcvF8in0iA5yJ0vX33Iu30TkDG3yguk0s20hEWx353Ly/dgszC9W3vJBO6JFzFLZ0rn8u4K2420EpcXU4ygA14IxpJMldH39mZTUGzQmUL44KtoPD2GkVo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773671687; c=relaxed/simple; bh=Y53yzbQoJinOX8C3cNMLHqoPNQzbkbZtg9pTqltGgY0=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=WiELux4Hw3QdI5asv55u1nX1CnUvf/LKxxLOsLuGcs/YQ7c7exSsaEfuo7hL8hrZw9F9GioRt0VTD6p0XpQhlMS0UXBCpBOyp0ao4Bq01AGyzTuXHxC15L1OTtcG4F1cSG3sak89Yw+3Ofjb24mO+EdCUL+gl8yGAnMb33Iyabs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=i24fGx+0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="i24fGx+0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D374C19421; Mon, 16 Mar 2026 14:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773671687; bh=Y53yzbQoJinOX8C3cNMLHqoPNQzbkbZtg9pTqltGgY0=; h=Subject:To:Cc:From:Date:From; b=i24fGx+0OYj1XThW3f3nGdB+/KTZnVKt3aR0Wej1CyBrtvZ24AmcWt6CiK3SlXrbm BZo/Db+THxG7q+mCRNJ/MWitNZXv6aoogftm21Vm0XxlLZetKWvTiP/dpNQ5Pcs+m3 wcbnmObsDV6pIphxnG+fw0TMp1sVuxCE75jX0P2w= Subject: FAILED: patch "[PATCH] rust: pin-init: internal: init: document load-bearing fact of" failed to apply to 6.12-stable tree To: lossin@kernel.org,gary@garyguo.net,ojeda@kernel.org,stable@vger.kernel.org Cc: From: Date: Mon, 16 Mar 2026 15:34:34 +0100 Message-ID: <2026031634-overfull-buffoon-ba5e@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x 580cc37b1de4fcd9997c48d7080e744533f09f36 # git commit -s git send-email --to '' --in-reply-to '2026031634-overfull-buffoon-ba5e@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 580cc37b1de4fcd9997c48d7080e744533f09f36 Mon Sep 17 00:00:00 2001 From: Benno Lossin Date: Mon, 2 Mar 2026 15:04:15 +0100 Subject: [PATCH] rust: pin-init: internal: init: document load-bearing fact of field accessors The functions `[Pin]Init::__[pinned_]init` and `ptr::write` called from the `init!` macro require the passed pointer to be aligned. This fact is ensured by the creation of field accessors to previously initialized fields. Since we missed this very important fact from the beginning [1], document it in the code. Link: https://rust-for-linux.zulipchat.com/#narrow/channel/561532-pin-init/topic/initialized.20field.20accessor.20detection/with/576210658 [1] Fixes: 90e53c5e70a6 ("rust: add pin-init API core") Cc: # 6.6.y, 6.12.y: 42415d163e5d: rust: pin-init: add references to previously initialized fields Cc: # 6.6.y, 6.12.y, 6.18.y, 6.19.y Signed-off-by: Benno Lossin Reviewed-by: Gary Guo Link: https://patch.msgid.link/20260302140424.4097655-2-lossin@kernel.org [ Updated Cc: stable@ tags as discussed. - Miguel ] Signed-off-by: Miguel Ojeda diff --git a/rust/pin-init/internal/src/init.rs b/rust/pin-init/internal/src/init.rs index da53adc44ecf..738f62c8105c 100644 --- a/rust/pin-init/internal/src/init.rs +++ b/rust/pin-init/internal/src/init.rs @@ -251,6 +251,10 @@ fn init_fields( }); // Again span for better diagnostics let write = quote_spanned!(ident.span()=> ::core::ptr::write); + // NOTE: the field accessor ensures that the initialized field is properly aligned. + // Unaligned fields will cause the compiler to emit E0793. We do not support + // unaligned fields since `Init::__init` requires an aligned pointer; the call to + // `ptr::write` below has the same requirement. let accessor = if pinned { let project_ident = format_ident!("__project_{ident}"); quote! { @@ -278,6 +282,10 @@ fn init_fields( InitializerKind::Init { ident, value, .. } => { // Again span for better diagnostics let init = format_ident!("init", span = value.span()); + // NOTE: the field accessor ensures that the initialized field is properly aligned. + // Unaligned fields will cause the compiler to emit E0793. We do not support + // unaligned fields since `Init::__init` requires an aligned pointer; the call to + // `ptr::write` below has the same requirement. let (value_init, accessor) = if pinned { let project_ident = format_ident!("__project_{ident}"); (