<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/rust, branch v6.5.13</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.5.13</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.5.13'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-11-08T13:09:04+00:00</updated>
<entry>
<title>rust: types: make `Opaque` be `!Unpin`</title>
<updated>2023-11-08T13:09:04+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>benno.lossin@proton.me</email>
</author>
<published>2023-06-30T15:03:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a58f5fabcab0c3e15b59462637b123d4edc851c7'/>
<id>urn:sha1:a58f5fabcab0c3e15b59462637b123d4edc851c7</id>
<content type='text'>
[ Upstream commit 0b4e3b6f6b79b1add04008a6ceaaf661107e8902 ]

Adds a `PhantomPinned` field to `Opaque&lt;T&gt;`. This removes the last Rust
guarantee: the assumption that the type `T` can be freely moved. This is
not the case for many types from the C side (e.g. if they contain a
`struct list_head`). This change removes the need to add a
`PhantomPinned` field manually to Rust structs that contain C structs
which must not be moved.

Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@samsung.com&gt;
Link: https://lore.kernel.org/r/20230630150216.109789-1-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: make `UnsafeCell` the outer type in `Opaque`</title>
<updated>2023-11-08T13:09:03+00:00</updated>
<author>
<name>Alice Ryhl</name>
<email>aliceryhl@google.com</email>
</author>
<published>2023-06-14T11:53:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7fba72536eb5796311b4ecf419f517e8c5bfae31'/>
<id>urn:sha1:7fba72536eb5796311b4ecf419f517e8c5bfae31</id>
<content type='text'>
[ Upstream commit 35cad617df2eeef8440a38e82bb2d81ae32ca50d ]

When combining `UnsafeCell` with `MaybeUninit`, it is idiomatic to use
`UnsafeCell` as the outer type. Intuitively, this is because a
`MaybeUninit&lt;T&gt;` might not contain a `T`, but we always want the effect
of the `UnsafeCell`, even if the inner value is uninitialized.

Now, strictly speaking, this doesn't really make a difference. The
compiler will always apply the `UnsafeCell` effect even if the inner
value is uninitialized. But I think we should follow the convention
here.

Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Link: https://lore.kernel.org/r/20230614115328.2825961-1-aliceryhl@google.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Stable-dep-of: 0b4e3b6f6b79 ("rust: types: make `Opaque` be `!Unpin`")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: docs: fix logo replacement</title>
<updated>2023-10-25T10:16:29+00:00</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2023-10-18T15:55:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69cd191012486b1f040c1dca5e2e6ebe414bb107'/>
<id>urn:sha1:69cd191012486b1f040c1dca5e2e6ebe414bb107</id>
<content type='text'>
[ Upstream commit cfd96726e61136e68a168813cedc4084f626208b ]

The static files placement by `rustdoc` changed in Rust 1.67.0 [1],
but the custom code we have to replace the logo in the generated
HTML files did not get updated.

Thus update it to have the Linux logo again in the output.

Hopefully `rustdoc` will eventually support a custom logo from
a local file [2], so that we do not need to maintain this hack
on our side.

Link: https://github.com/rust-lang/rust/pull/101702 [1]
Link: https://github.com/rust-lang/rfcs/pull/3226 [2]
Fixes: 3ed03f4da06e ("rust: upgrade to Rust 1.68.2")
Cc: stable@vger.kernel.org
Tested-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@samsung.com&gt;
Link: https://lore.kernel.org/r/20231018155527.1015059-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>docs: Move rustdoc output, cross-reference it</title>
<updated>2023-10-25T10:16:29+00:00</updated>
<author>
<name>Carlos Bilbao</name>
<email>carlos.bilbao@amd.com</email>
</author>
<published>2023-07-18T15:15:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=43f4e8e32b97333184191bcde3ce9b673505d500'/>
<id>urn:sha1:43f4e8e32b97333184191bcde3ce9b673505d500</id>
<content type='text'>
[ Upstream commit 48fadf44007568e75c7af92857083058d57be403 ]

Generate rustdoc documentation with the rest of subsystem's documentation
in Documentation/output. Add a cross reference to the generated rustdoc in
Documentation/rust/index.rst if Sphinx target rustdoc is set.

Reviewed-by: Akira Yokosawa &lt;akiyks@gmail.com&gt;
Signed-off-by: Carlos Bilbao &lt;carlos.bilbao@amd.com&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
Link: https://lore.kernel.org/r/20230718151534.4067460-2-carlos.bilbao@amd.com
Stable-dep-of: cfd96726e611 ("rust: docs: fix logo replacement")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: error: fix the description for `ECHILD`</title>
<updated>2023-10-25T10:16:28+00:00</updated>
<author>
<name>Wedson Almeida Filho</name>
<email>walmeida@microsoft.com</email>
</author>
<published>2023-09-30T14:49:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0236504746dde0dc12730a0768445defb3126241'/>
<id>urn:sha1:0236504746dde0dc12730a0768445defb3126241</id>
<content type='text'>
commit 17bfcd6a81535d7d580ddafb6e54806890aaca6c upstream.

A mistake was made and the description of `ECHILD` is wrong (it reuses
the description of `ENOEXEC`). This fixes it to reflect what's in
`errno-base.h`.

Signed-off-by: Wedson Almeida Filho &lt;walmeida@microsoft.com&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Reviewed-by: Trevor Gross &lt;tmgross@umich.edu&gt;
Reviewed-by: Finn Behrens &lt;me@kloenk.dev&gt;
Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Fixes: 266def2a0f5b ("rust: error: add codes from `errno-base.h`")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230930144958.46051-1-wedsonaf@gmail.com
[ Use the plural, as noticed by Benno. ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rust: macros: vtable: fix `HAS_*` redefinition (`gen_const_name`)</title>
<updated>2023-08-09T19:15:07+00:00</updated>
<author>
<name>Qingsong Chen</name>
<email>changxian.cqs@antgroup.com</email>
</author>
<published>2023-08-08T02:54:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3fa7187eceee11998f756481e45ce8c4f9d9dc48'/>
<id>urn:sha1:3fa7187eceee11998f756481e45ce8c4f9d9dc48</id>
<content type='text'>
If we define the same function name twice in a trait (using `#[cfg]`),
the `vtable` macro will redefine its `gen_const_name`, e.g. this will
define `HAS_BAR` twice:

    #[vtable]
    pub trait Foo {
        #[cfg(CONFIG_X)]
        fn bar();

        #[cfg(not(CONFIG_X))]
        fn bar(x: usize);
    }

Fixes: b44becc5ee80 ("rust: macros: add `#[vtable]` proc macro")
Signed-off-by: Qingsong Chen &lt;changxian.cqs@antgroup.com&gt;
Reviewed-by: Andreas Hindborg &lt;a.hindborg@samsung.com&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Sergio González Collado &lt;sergio.collado@gmail.com&gt;
Link: https://lore.kernel.org/r/20230808025404.2053471-1-changxian.cqs@antgroup.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: fix bindgen build error with UBSAN_BOUNDS_STRICT</title>
<updated>2023-08-04T15:10:50+00:00</updated>
<author>
<name>Andrea Righi</name>
<email>andrea.righi@canonical.com</email>
</author>
<published>2023-07-11T07:19:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b05544884300e98512964103b33f8f87650ce887'/>
<id>urn:sha1:b05544884300e98512964103b33f8f87650ce887</id>
<content type='text'>
With commit 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC") if
CONFIG_UBSAN is enabled and gcc supports -fsanitize=bounds-strict, we
can trigger the following build error due to bindgen lacking support for
this additional build option:

   BINDGEN rust/bindings/bindings_generated.rs
 error: unsupported argument 'bounds-strict' to option '-fsanitize='

Fix by adding -fsanitize=bounds-strict to the list of skipped gcc flags
for bindgen.

Fixes: 2d47c6956ab3 ("ubsan: Tighten UBSAN_BOUNDS on GCC")
Signed-off-by: Andrea Righi &lt;andrea.righi@canonical.com&gt;
Acked-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Link: https://lore.kernel.org/r/20230711071914.133946-1-andrea.righi@canonical.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: delete `ForeignOwnable::borrow_mut`</title>
<updated>2023-08-04T15:10:50+00:00</updated>
<author>
<name>Alice Ryhl</name>
<email>aliceryhl@google.com</email>
</author>
<published>2023-07-06T09:46:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d24eb2d536ba27ef938a6563ac8bfb49c738cc1'/>
<id>urn:sha1:1d24eb2d536ba27ef938a6563ac8bfb49c738cc1</id>
<content type='text'>
We discovered that the current design of `borrow_mut` is problematic.
This patch removes it until a better solution can be found.

Specifically, the current design gives you access to a `&amp;mut T`, which
lets you change where the `ForeignOwnable` points (e.g., with
`core::mem::swap`). No upcoming user of this API intended to make that
possible, making all of them unsound.

Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
Reviewed-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Fixes: 0fc4424d24a2 ("rust: types: introduce `ForeignOwnable`")
Link: https://lore.kernel.org/r/20230706094615.3080784-1-aliceryhl@google.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: allocator: Prevent mis-aligned allocation</title>
<updated>2023-08-04T15:10:31+00:00</updated>
<author>
<name>Boqun Feng</name>
<email>boqun.feng@gmail.com</email>
</author>
<published>2023-07-30T01:29:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b3d8aa84bbfe9b58ccc5332cacf8ea17200af310'/>
<id>urn:sha1:b3d8aa84bbfe9b58ccc5332cacf8ea17200af310</id>
<content type='text'>
Currently the rust allocator simply passes the size of the type Layout
to krealloc(), and in theory the alignment requirement from the type
Layout may be larger than the guarantee provided by SLAB, which means
the allocated object is mis-aligned.

Fix this by adjusting the allocation size to the nearest power of two,
which SLAB always guarantees a size-aligned allocation. And because Rust
guarantees that the original size must be a multiple of alignment and
the alignment must be a power of two, then the alignment requirement is
satisfied.

Suggested-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Co-developed-by: "Andreas Hindborg (Samsung)" &lt;nmi@metaspace.dk&gt;
Signed-off-by: "Andreas Hindborg (Samsung)" &lt;nmi@metaspace.dk&gt;
Signed-off-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Cc: stable@vger.kernel.org # v6.1+
Acked-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Fixes: 247b365dc8dc ("rust: add `kernel` crate")
Link: https://github.com/Rust-for-Linux/linux/issues/974
Link: https://lore.kernel.org/r/20230730012905.643822-2-boqun.feng@gmail.com
[ Applied rewording of comment as discussed in the mailing list. ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: error: `impl Debug` for `Error` with `errname()` integration</title>
<updated>2023-06-12T23:24:42+00:00</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2023-05-31T17:44:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2e3115d717197cb2bc020dd1f06b06538474ac3'/>
<id>urn:sha1:d2e3115d717197cb2bc020dd1f06b06538474ac3</id>
<content type='text'>
Integrate the `Error` type with `errname()` by providing a new
`name()` method.

Then, implement `Debug` for the type using the new method.

[ Miguel: under `CONFIG_SYMBOLIC_ERRNAME=n`, `errname()` is a
  `static inline`, so added a helper to support that case,
  like we had in the `rust` branch. Also moved `#include` up
  and reworded commit message for clarity. ]

Co-developed-by: Wedson Almeida Filho &lt;walmeida@microsoft.com&gt;
Signed-off-by: Wedson Almeida Filho &lt;walmeida@microsoft.com&gt;
Co-developed-by: Sven Van Asbroeck &lt;thesven73@gmail.com&gt;
Signed-off-by: Sven Van Asbroeck &lt;thesven73@gmail.com&gt;
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
Signed-off-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Link: https://lore.kernel.org/r/20230531174450.3733220-1-aliceryhl@google.com
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
</feed>
