8000 Tags · Darksonn/linux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Tags: Darksonn/linux

Tags

sent/20250617-opaque-from-raw-ac5b8ef6faa2-v2

Toggle sent/20250617-opaque-from-raw-ac5b8ef6faa2-v2's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Add Opaque::cast_from

Since commit b20fbbc ("rust: check type of `$ptr` in
`container_of!`") we have enforced that the field pointer passed to
container_of! must match the declared field. This ca
8000
used mismatches when
using a pointer to bindings::x for fields of type Opaque<bindings::x>.

This situation encourages the user to simply pass field.cast() to the
container_of! macro, but this is not great because you might
accidentally pass a *mut bindings::y when the field type is
Opaque<bindings::x>, which would be wrong.

To help catch this kind of mistake, add a new Opaque::cast_from that
wraps a raw pointer in Opaque without changing the inner type. Also
rename raw_get() to cast_into() for naming consistency.

To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Miguel Ojeda <ojeda@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: dri-devel@lists.freedesktop.org
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Changes in v2:
- Use new naming, and rename raw_get().
- Link to v1: https://lore.kernel.org/r/20250617-opaque-from-raw-v1-1-a2e99efa3ba2@google.com

---
Alice Ryhl (2):
      rust: types: add Opaque::cast_from
      rust: types: rename Opaque::raw_get to cast_into

 rust/kernel/configfs.rs                |  2 +-
 rust/kernel/drm/device.rs              |  4 +---
 rust/kernel/drm/gem/mod.rs             |  4 +---
 rust/kernel/init.rs                    |  6 +++---
 rust/kernel/lib.rs                     |  7 +++++++
 rust/kernel/list.rs                    |  2 +-
 rust/kernel/list/impl_list_item_mod.rs |  4 ++--
 rust/kernel/time/hrtimer.rs            |  4 ++--
 rust/kernel/types.rs                   | 11 ++++++++---
 rust/kernel/workqueue.rs               |  2 +-
 10 files changed, 27 insertions(+), 19 deletions(-)
---
base-commit: 19272b3
change-id: 20250617-opaque-from-raw-ac5b8ef6faa2

Best regards,

sent/20250620-poll-table-null-bf9a6a6c569e-v2

Toggle sent/20250620-poll-table-null-bf9a6a6c569e-v2's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Allow null in poll table

This issue was discovered from a syzkaller report on Rust Binder.

Intended for Christian Brauner's tree.

To: Christian Brauner <christian@brauner.io>
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Jan Kara <jack@suse.cz>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: rust-for-linux@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Changes in v2:
- Reword safety comment on poll_wait. (Benno)
- Link to v1: https://lore.kernel.org/r/20250620-poll-table-null-v1-1-b3fe92a4fd0d@google.com

---
Alice Ryhl (1):
      poll: rust: allow poll_table ptrs to be null

 rust/helpers/helpers.c   |  1 +
 rust/helpers/poll.c      | 10 +++++++
 rust/kernel/sync/poll.rs | 68 ++++++++++++++++++------------------------------
 3 files changed, 37 insertions(+), 42 deletions(-)
---
base-commit: 19272b3
change-id: 20250620-poll-table-null-bf9a6a6c569e

Best regards,

sent/20250620-poll-table-null-bf9a6a6c569e-v1

Toggle sent/20250620-poll-table-null-bf9a6a6c569e-v1's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Allow null in poll table

This issue was discovered from a syzkaller report on Rust Binder.

Intended for Christian Brauner's tree.

To: Christian Brauner <christian@brauner.io>
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Jan Kara <jack@suse.cz>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: linux-kernel@vger.kernel.org
Cc: rust-for-linux@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Alice Ryhl (1):
      poll: rust: allow poll_table ptrs to be null

 rust/helpers/helpers.c   |  1 +
 rust/helpers/poll.c      | 10 ++++++++
 rust/kernel/sync/poll.rs | 65 +++++++++++++++++-------------------------------
 3 files changed, 34 insertions(+), 42 deletions(-)
---
base-commit: 19272b3
change-id: 20250620-poll-table-null-bf9a6a6c569e

Best regards,

sent/20250619-rust-panic-8bd14e564aa4-v1

Toggle sent/20250619-rust-panic-8bd14e564aa4-v1's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Better Rust panics

To: Arnd Bergmann <arnd@arndb.de>
To: Miguel Ojeda <ojeda@kernel.org>
To: Kees Cook <kees@kernel.org>
To: Tony Luck <tony.luck@intel.com>
To: Guilherme G. Piccoli <gpiccoli@igalia.com>
To: Peter Zijlstra <peterz@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Boqun Feng <boqun.feng@gmail.com>
To: Gary Guo <gary@garyguo.net>
To: Björn Roy Baron <bjorn3_gh@protonmail.com>
To: Benno Lossin <lossin@kernel.org>
To: Andreas Hindborg <a.hindborg@kernel.org>
To: Trevor Gross <tmgross@umich.edu>
To: Danilo Krummrich <dakr@kernel.org>
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: rust-for-linux@vger.kernel.org
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Alice Ryhl (1):
      panic: improve panic output from Rust panics

 include/asm-generic/bug.h |  2 ++
 kernel/panic.c            | 18 ++++++++++++++++++
 rust/kernel/lib.rs        | 22 +++++++++++++++++++---
 3 files changed, 39 insertions(+), 3 deletions(-)
---
base-commit: 19272b3
change-id: 20250619-rust-panic-8bd14e564aa4

Best regards,

sent/20250617-opaque-from-raw-ac5b8ef6faa2-v1

Toggle sent/20250617-opaque-from-raw-ac5b8ef6faa2-v1's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Add Opaque::from_raw

To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Miguel Ojeda <ojeda@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: dri-devel@lists.freedesktop.org
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Alice Ryhl (1):
      rust: types: add Opaque::from_raw

 rust/kernel/drm/device.rs  | 4 +---
 rust/kernel/drm/gem/mod.rs | 4 +---
 rust/kernel/lib.rs         | 7 +++++++
 rust/kernel/types.rs       | 5 +++++
 4 files changed, 14 insertions(+), 6 deletions(-)
---
base-commit: 19272b3
change-id: 20250617-opaque-from-raw-ac5b8ef6faa2

Best regards,

sent/20250616-rbtree-is-empty-28f51fccb99a-v1

Toggle sent/20250616-rbtree-is-empty-28f51fccb99a-v1's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Add RBTree::is_empty

To: Miguel Ojeda <ojeda@kernel.org>
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Alice Ryhl (1):
      rbtree: rust: add RBTree::is_empty

 rust/kernel/rbtree.rs | 6 ++++++
 1 file changed, 6 insertions(+)
---
base-commit: 19272b3
change-id: 20250616-rbtree-is-empty-28f51fccb99a

Best regards,

sent/20250612-revocable-ptr-comment-7c82b47a503f-v1

Toggle sent/20250612-revocable-ptr-comment-7c82b47a503f-v1's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Document why RevocableGuard uses &T

To: Miguel Ojeda <ojeda@kernel.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Marcelo Moreira <marcelomoreira1905@gmail.com>
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Alice Ryhl (1):
      revocable: rust: document why &T is not used in RevocableGuard

 rust/kernel/revocable.rs | 4 ++++
 1 file changed, 4 insertions(+)
---
base-commit: 19272b3
change-id: 20250612-revocable-ptr-comment-7c82b47a503f

Best regards,

sent/20250610-vec-default-4b0c54aadebc-v1

Toggle sent/20250610-vec-default-4b0c54aadebc-v1's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
Implement Default for Vec with any allocator

To: Danilo Krummrich <dakr@kernel.org>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Alice Ryhl (1):
      rust: vec: impl Default for Vec with any allocator

 rust/kernel/alloc/kvec.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: 19272b3
change-id: 20250610-vec-default-4b0c54aadebc

Best regards,

sent/20250506-userptr-newtype-2f060985c33b-v3

Toggle sent/20250506-userptr-newtype-2f060985c33b-v3's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
__user for Rust

This is based on top of the strncpy_from_user for Rust patch.
https://lore.kernel.org/r/20250616-strncpy-from-user-v5-0-2d3fb0e1f5af@google.com

I don't see a clear owner of uaccess in MAINTAINERS, so I suggest that
it lands through Miguel's tree.

To: Miguel Ojeda <ojeda@kernel.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <lossin@kernel.org>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Changes in v3:
- Use ptr::wrapping_byte_add in UserPtr::wrapping_byte_add.
- Add missing #[inline].
- Add Reviewed-by tags.
- Rewrite commit message.
- Rebase on v5 of strncpy_from_user.
- Link to v2: https://lore.kernel.org/r/20250527-userptr-newtype-v2-1-a789d266f6b0@google.com

Changes in v2:
- Change usize to raw pointer.
- Make field private.
- Rename wrapping_add to wrapping_byte_add.
- Add to prelude.
- Rebase on v4 of strncpy_from_user
- Link to v1: https://lore.kernel.org/r/20250506-userptr-newtype-v1-1-a0f6f8ce9fc5@google.com

---
Alice Ryhl (1):
      uaccess: rust: use newtype for user pointers

 rust/kernel/prelude.rs           |  2 ++
 rust/kernel/uaccess.rs           | 71 +++++++++++++++++++++++++++++++++-------
 samples/rust/rust_misc_device.rs |  2 ++
 3 files changed, 63 insertions(+), 12 deletions(-)
---
base-commit: d9946fe286439c2aeaa7953b8c316efe5b83d515
change-id: 20250506-userptr-newtype-2f060985c33b
prerequisite-change-id: 20250424-strncpy-from-user-1f2d06b0cdde:v5
prerequisite-patch-id: a683dbdea04daab269af0a6c90873e4dd139fe31
prerequisite-patch-id: 3db271c7acaff1a96836640e034d0321e5f412f5

Best regards,

sent/20250506-userptr-newtype-2f060985c33b-v2

Toggle sent/20250506-userptr-newtype-2f060985c33b-v2's commit message

Verified

This tag was signed with the committer’s verified signature.
Darksonn Alice Ryhl
__user for Rust

This is based on top of the strncpy_from_user for Rust patch.

To: Miguel Ojeda <ojeda@kernel.org>
To: Alexander Viro <viro@zeniv.linux.org.uk>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Gary Guo <gary@garyguo.net>
Cc: Björn Roy Baron <bjorn3_gh@protonmail.com>
Cc: Benno Lossin <benno.lossin@proton.me>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Trevor Gross <tmgross@umich.edu>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Alice Ryhl <aliceryhl@google.com>

---
Changes in v2:
- Change usize to raw pointer.
- Make field private.
- Rename wrapping_add to wrapping_byte_add.
- Add to prelude.
- Rebase on v4 of strncpy_from_user
- Link to v1: https://lore.kernel.org/r/20250506-userptr-newtype-v1-1-a0f6f8ce9fc5@google.com

---
Alice Ryhl (1):
      uaccess: rust: use newtype for user pointers

 rust/kernel/prelude.rs           |  2 ++
 rust/kernel/uaccess.rs           | 68 +++++++++++++++++++++++++++++++++-------
 samples/rust/rust_misc_device.rs |  2 ++
 3 files changed, 60 insertions(+), 12 deletions(-)
---
base-commit: f34da179a4517854b2ffbe4bce8c3405bd9be04e
change-id: 20250506-userptr-newtype-2f060985c33b
prerequisite-change-id: 20250424-strncpy-from-user-1f2d06b0cdde:v4
prerequisite-patch-id: d35c479ddb84bacc541dbb226c7911e5a22cad7e
prerequisite-patch-id: e0c345945dabfa18e9ca11f7fe11f8178d071285

Best regards,
0