Skip to content

Add advisory for invalid pointer dereference in fmt::Pointer impl for crossbeam_epoch::{Atomic,Shared}#3042

Merged
LawnGnome merged 1 commit into
rustsec:mainfrom
taiki-e:crossbeam-epoch-fmt-ptr
Jul 6, 2026
Merged

Add advisory for invalid pointer dereference in fmt::Pointer impl for crossbeam_epoch::{Atomic,Shared}#3042
LawnGnome merged 1 commit into
rustsec:mainfrom
taiki-e:crossbeam-epoch-fmt-ptr

Conversation

@taiki-e

@taiki-e taiki-e commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Affected crate(s)

  • crossbeam-epoch (recent downloads per crates.io: 112.9M)

Links to upstream issue(s) or PR(s)

Severity

  • I confirmed that null pointer dereference can be triggered without unsafe code when the opt-level is low or when the pointer is to a DST.
    • 0.9.19's fix addressed this.
  • I guess use-after-free is also possible when combined with other unsafe code.
    • 0.9.20's fix addressed this.
      • Another case addressed in 0.9.20 is an unsoundness that can likely be triggered in Miri or sanitizer but is not considered to occur on real hardware. (See the PR 1276 mentioned above for details.)

Checklist

  • Advisory filename(s) starts with RUSTSEC-0000-0000 as the ID
  • date field is set to the public disclosure date
  • Contains a concise and descriptive title after advisory metadata
  • Asked maintainer(s) if publishing an advisory is appropriate

aliases = []

[affected]
functions = { "<crossbeam_epoch::Atomic as core::fmt::Pointer>::fmt" = [">= 0.9.0, < 0.9.20"], "<crossbeam_epoch::Shared as core::fmt::Pointer>::fmt" = [">= 0.9.0, < 0.9.20"] }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...

error: RustSec error: parse error: error parsing ./crates/crossbeam-epoch/RUSTSEC-0000-0000.md
Caused by:
  -> parse error: error parsing ./crates/crossbeam-epoch/RUSTSEC-0000-0000.md
  -> parse error: TOML parse error at line 10, column 15
   |
10 | functions = { "<crossbeam_epoch::Atomic as core::fmt::Pointer>::fmt" = [">= 0.9.0, < 0.9.20"], "<crossbeam_epoch::Shared as core::fmt::Pointer>::fmt" = [">= 0.9.0, < 0.9.20"] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
parse error: invalid character ' ' in identifier: 'Atomic as core'

  -> TOML parse error at line 10, column 15
   |
10 | functions = { "<crossbeam_epoch::Atomic as core::fmt::Pointer>::fmt" = [">= 0.9.0, < 0.9.20"], "<crossbeam_epoch::Shared as core::fmt::Pointer>::fmt" = [">= 0.9.0, < 0.9.20"] }
   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
parse error: invalid character ' ' in identifier: 'Atomic as core'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the rustsec folks: I don't think we have an exact issue for allowing trait methods here, but rustsec/rustsec#940 touches on it. We should probably allow this and look at pulling something in to replace the ad hoc FromStr impl for FunctionPath, but I don't think it's a blocker for this particular PR.

@taiki-e
taiki-e force-pushed the crossbeam-epoch-fmt-ptr branch from cc76c7f to bf85a3d Compare July 6, 2026 18:32

@LawnGnome LawnGnome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LawnGnome
LawnGnome merged commit b86f52d into rustsec:main Jul 6, 2026
1 check passed
@taiki-e
taiki-e deleted the crossbeam-epoch-fmt-ptr branch July 7, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants