[M] Change in fuchsia/fuchsia[main]: [fuchsia_runtime] Scope thread_self access.

1 view
Skip to first unread message

'Adam Perry (Gerrit)' via owners-override

unread,
Jul 8, 2025, 10:49:42 AM7/8/25
to Owners Override
Attention needed from Owners Override

Adam Perry has uploaded the change for review

Adam Perry would like Owners Override to review this change.

Commit message

[fuchsia_runtime] Scope thread_self access.

This fixes a rare edge case where the Unowned could be
observed after the calling thread had exited because Unowned implements
Send and was returned with the 'static lifetime. Making any syscalls on
that handle would return bad handle errors and run afoul of bad handle
policy if we manage to turn it on.

Forces callers to use a lifetime from their own stack, analogous to
Rust's thread-local APIs. This guarantees that callers will be unable to
observe the Unowned after the handle it references is closed. Callers
who need a 'static handle reference can duplicate the handle, as this
change updates some existing callers to do.
Change-Id: Iebf5781feda7d6f8a5f9c550c4f704ba6bbd37e7

Change diff


Change information

Files:
  • M sdk/lib/scheduler/rust/src/lib.rs
  • M sdk/lib/scheduler/rust/tests/src/main.rs
  • M sdk/rust/zx/src/futex.rs
  • M sdk/rust/zx/src/process.rs
  • M sdk/rust/zx/src/thread.rs
  • M src/devices/bin/driver-host/src/driver_host.rs
  • M src/diagnostics/validator/logs/sink/puppet/rust/src/main.rs
  • M src/lib/diagnostics/inspect/contrib/rust/src/self_profile.rs
  • M src/lib/diagnostics/log/bench/src/common.rs
  • M src/lib/diagnostics/log/rust/src/fuchsia/sink.rs
  • M src/lib/fuchsia-runtime/src/lib.rs
  • M src/performance/memory/heapdump/instrumentation/src/profiler.rs
  • M src/starnix/kernel/logging/logging.rs
  • M src/starnix/kernel/task/current_task.rs
  • M src/starnix/kernel/task/scheduler/manager.rs
  • M src/starnix/kernel/task/syscalls.rs
  • M src/starnix/lib/starnix_sync/src/interruptible_event.rs
  • M src/sys/component_manager/tests/crash_introspect/report_then_panic_on_start.rs
  • M src/zircon/bin/role_manager/tests/integration/src/main.rs
Change size: M
Delta: 19 files changed, 79 insertions(+), 55 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Iebf5781feda7d6f8a5f9c550c4f704ba6bbd37e7
Gerrit-Change-Number: 1312625
Gerrit-PatchSet: 2
Gerrit-Owner: Adam Perry <adam...@google.com>
Gerrit-Reviewer: Adam Perry <adam...@google.com>
Gerrit-Reviewer: James Robinson <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/1932c09a1264780682adcd92b484fcc7c17afaea-HTML%40fuchsia-review.googlesource.com.
unsatisfied_requirement
satisfied_requirement
open
diffy

'James Robinson (Gerrit)' via owners-override

unread,
Jul 8, 2025, 11:01:59 AM7/8/25
to Adam Perry, Owners Override, GI Try Builder, CQ Bot
Attention needed from Adam Perry and Owners Override

James Robinson voted Owners-Override+1

Owners-Override+1
Open in Gerrit

Related details

Attention is currently required from:
  • Adam Perry
  • Owners Override
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Iebf5781feda7d6f8a5f9c550c4f704ba6bbd37e7
Gerrit-Change-Number: 1312625
Gerrit-PatchSet: 2
Gerrit-Owner: Adam Perry <adam...@google.com>
Gerrit-Reviewer: Adam Perry <adam...@google.com>
Gerrit-Reviewer: James Robinson <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Adam Perry <adam...@google.com>
Gerrit-Comment-Date: Tue, 08 Jul 2025 15:01:29 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/23c265d57b640f617017ebabbb294cabc7a76cde-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy

'CQ Bot (Gerrit)' via owners-override

unread,
Jul 8, 2025, 11:02:34 AM7/8/25
to Adam Perry, James Robinson, Owners Override, GI Try Builder

CQ Bot submitted the change

Change information

Commit message:
[fuchsia_runtime] Scope thread_self access.

This fixes a rare edge case where the Unowned could be
observed after the calling thread had exited because Unowned implements
Send and was returned with the 'static lifetime. Making any syscalls on
that handle would return bad handle errors and run afoul of bad handle
policy if we manage to turn it on.

Forces callers to use a lifetime from their own stack, analogous to
Rust's thread-local APIs. This guarantees that callers will be unable to
observe the Unowned after the handle it references is closed. Callers
who need a 'static handle reference can duplicate the handle, as this
change updates some existing callers to do.
Change-Id: Iebf5781feda7d6f8a5f9c550c4f704ba6bbd37e7
Fuchsia-Auto-Submit: Adam Perry <adam...@google.com>
Owners-Override: James Robinson <jam...@google.com>
Commit-Queue: Adam Perry <adam...@google.com>
Reviewed-by: James Robinson <jam...@google.com>
Files:
  • M sdk/lib/scheduler/rust/src/lib.rs
  • M sdk/lib/scheduler/rust/tests/src/main.rs
  • M sdk/rust/zx/src/futex.rs
  • M sdk/rust/zx/src/process.rs
  • M sdk/rust/zx/src/thread.rs
  • M src/devices/bin/driver-host/src/driver_host.rs
  • M src/diagnostics/validator/logs/sink/puppet/rust/src/main.rs
  • M src/lib/diagnostics/inspect/contrib/rust/src/self_profile.rs
  • M src/lib/diagnostics/log/bench/src/common.rs
  • M src/lib/diagnostics/log/rust/src/fuchsia/sink.rs
  • M src/lib/fuchsia-runtime/src/lib.rs
  • M src/performance/memory/heapdump/instrumentation/src/profiler.rs
  • M src/starnix/kernel/logging/logging.rs
  • M src/starnix/kernel/task/current_task.rs
  • M src/starnix/kernel/task/scheduler/manager.rs
  • M src/starnix/kernel/task/syscalls.rs
  • M src/starnix/lib/starnix_sync/src/interruptible_event.rs
  • M src/sys/component_manager/tests/crash_introspect/report_then_panic_on_start.rs
  • M src/zircon/bin/role_manager/tests/integration/src/main.rs
Change size: M
Delta: 19 files changed, 79 insertions(+), 55 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by James Robinson
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Iebf5781feda7d6f8a5f9c550c4f704ba6bbd37e7
Gerrit-Change-Number: 1312625
Gerrit-PatchSet: 3
Gerrit-Owner: Adam Perry <adam...@google.com>
Gerrit-Reviewer: Adam Perry <adam...@google.com>
Gerrit-Reviewer: James Robinson <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/37a5a91c0b519a54f4efcc792350db5ffdeb6231-HTML%40fuchsia-review.googlesource.com.
open
diffy
satisfied_requirement

'GI Roller (Gerrit)' via owners-override

unread,
Jul 8, 2025, 11:06:19 AM7/8/25
to Adam Perry, CQ Bot, James Robinson, Owners Override, GI Try Builder

Message from GI Roller

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Iebf5781feda7d6f8a5f9c550c4f704ba6bbd37e7
Gerrit-Change-Number: 1312625
Gerrit-PatchSet: 3
Gerrit-Owner: Adam Perry <adam...@google.com>
Gerrit-Reviewer: Adam Perry <adam...@google.com>
Gerrit-Reviewer: James Robinson <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Comment-Date: Tue, 08 Jul 2025 15:06:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/15efca7eaaf83a7a517377a3e932f9cfd6a17ffa-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages