From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382572; b=ZtrAfr4KqfFaHENenr/L0isFQQyFeNDGKGKBF0AG2UG8OXa26rXZNys36A1LrAA0wdyW 7el5OyCYqqonkCGTyWnG3UOQHMkBX3qLxdLN3Fk7vcCnj5g8jxyewzNgaPV6rfWWxegEp HmPtPwejbQU9g/u7b2xKhrIaOchmg5FrjZohggP6+lSZcTScpTs0mVTxJp8Jdrum6HY+B qmMV1UYlSRgIicLmz8ke6Buf4QHmxph7XdNXOAsSg3yU/hVWSZe5ZdWKSxK6YnXScaipQ 7UqaeTR4X3e7s4vd+PAuNe0dIrhuZhyF8tjjf70HFzkkL9/GyfVwo7XzUeNx9Gh6q4Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382572; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=6C0/eHtuzH/LfqaPh9SUqRycU3RZjaxPcsrD/BBS9HI=; b=gz6fs18CuB4hksGVMjX847YwwBcMX0Qw70+12laotxBbqddEScwiYIGQuG+4QYmXMZ4K 3B/NHW8M06dml+kGM7VJqaJRSuUqkIZCK0qSS1Ob/q48YuB5sydNIheRwNRZQyVXlajQC p2z16a84/87D9dIby0xLJY/hHEn4XlaaUC0Av74OJEClHKYLx1OMzuZu+mpRGt/SoEOFO zVxkhjlGE3UsTmk5mtEJrvgUmCosKU3feIE7ofeDm89zxIgR2lZJxD21X3h5lEXoF8vD1 cl9H2iwIav5G5OsNDhGGy4QMam5ujgnphPSDM4ti+wogUP2wflhWIeTFGv8Ki/1cHKg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="jNtz9/6f"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6310C606A32C; Fri, 4 Dec 2026 11:09:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=jNtz9/6f Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAFE81F000CE; Fri, 4 Dec 2026 11:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382572; bh=6C0/eHtuzH/LfqaPh9SUqRycU3RZjaxPcsrD/BBS9HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jNtz9/6fskkVLLBuiz7LSkDQ3XS2NmTG4wuER7uwUHZZcORulA4m2ZTE02cAMJvmt 9mfvaIIY6dgiPbNlgGwQ5KyAmfaJQx1rUNCQ3qYZXd/59f/f/3tuvL1+Q6kIKP5auT O2JB3ouW4m8QAfbQbMy3ZiLhvCrIy2DQXpOq7dlE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, spidermana , Marwan Mohamed Zein , Miguel Ojeda Subject: [PATCH 6.18 512/703] rust: iov: fix return lifetime of `copy_from_iter_raw()` Date: Fri, 4 Dec 2026 19:06:51 +0900 Message-ID: <20261204100641.415631472@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Marwan Mohamed Zein commit df71affdd95ea60fa3fb31e666389a53fd3297db upstream. The returned slice is derived from `out`, but lifetime elision ties it to `self` because this is a method. Explicitly bind the return lifetime to `out` so the returned slice cannot outlive its backing buffer. Fixes: 06cb58b310ea ("rust: iov: add iov_iter abstractions for ITER_SOURCE") Cc: stable@vger.kernel.org Reported-by: spidermana Closes: https://github.com/Rust-for-Linux/linux/issues/1265 Signed-off-by: Marwan Mohamed Zein Link: https://patch.msgid.link/20261114132156.49243-1-marawanzein222@gmail.com [ Reworded title. - Miguel ] Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman --- rust/kernel/iov.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/rust/kernel/iov.rs +++ b/rust/kernel/iov.rs @@ -161,7 +161,7 @@ impl<'data> IovIterSource<'data> { /// /// This will never write uninitialized bytes to the provided buffer. #[inline] - pub fn copy_from_iter_raw(&mut self, out: &mut [MaybeUninit]) -> &mut [u8] { + pub fn copy_from_iter_raw<'a>(&mut self, out: &'a mut [MaybeUninit]) -> &'a mut [u8] { let capacity = out.len(); let out = out.as_mut_ptr().cast::();