Title: Safely parse unaligned ancillary messages by youknowdot · Pull Request #9640 · RustPython/RustPython · GitHub
Open Graph Title: Safely parse unaligned ancillary messages by youknowdot · Pull Request #9640 · RustPython/RustPython
X Title: Safely parse unaligned ancillary messages by youknowdot · Pull Request #9640 · RustPython/RustPython
Description: Summary Parse ancillary-message bytes without assuming the public input slice is aligned for cmsghdr. Read complete headers with unaligned loads and validate data-prefix, declared-length, available-byte and next-offset bounds before slicing or advancing. A truncated final payload is returned only up to the bytes available; malformed short headers terminate parsing rather than underflowing. Preserve the relevant platform-specific next-header rules, including Solaris/illumos rounding, Linux musl/ohos and emscripten strict end boundaries, and Hurd's next-message fit check. For an unaligned slice, offsets are interpreted relative to the beginning of the supplied bytes. Traversal continues to use the existing i32-sized checked_cmsg_space bound. This does not change the generic ancillary packer, whose alignment and ownership require separate work, and does not claim complete Python recvmsg diagnostics or arbitrary-platform runtime parity. #9638 separately addresses the AF_ALG send helper. Validation Independently source-reviewed libc 0.2.189 platform CMSG layouts and boundary rules, unaligned accesses, checked arithmetic, lifetimes, malformed inputs and test safety. Added host-internal tests for unaligned headers, short/truncated and maximal declared lengths, zero-payload boundaries, and comparison against the platform CMSG_NXTHDR macro. These validate byte-buffer invariants, not Python API behavior. rustfmt, git diff --check, and normal repository hooks passed. Source merge-tree with #9638 was clean. No local RustPython build or execution, no host-unit-test execution, and no cross-target runtime validation were performed. Hosted CI must validate compilation and tests; unsupported targets still need their own execution evidence.
Open Graph Description: Summary Parse ancillary-message bytes without assuming the public input slice is aligned for cmsghdr. Read complete headers with unaligned loads and validate data-prefix, declared-length, available...
X Description: Summary Parse ancillary-message bytes without assuming the public input slice is aligned for cmsghdr. Read complete headers with unaligned loads and validate data-prefix, declared-length, available...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9640
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:8c69d082-a561-5906-1410-10c93981f4f6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B9AC:3DCD28:158411D:1C85EFA:6B01FE19 |
| html-safe-nonce | 372134f273f96d3fb7017defd9b2c576862498d3e4cbfa15111eadf2091da094 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOUFDOjNEQ0QyODoxNTg0MTFEOjFDODVFRkE6NkIwMUZFMTkiLCJ2aXNpdG9yX2lkIjoiNDA0OTExNzY2NjA1NTY4MzYwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4e449a4bd1c151457421687a0f791c2b11091ee958102b0c4165021dcb6e5253 |
| hovercard-subject-tag | pull_request:5140243089 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9640/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary Parse ancillary-message bytes without assuming the public input slice is aligned for cmsghdr. Read complete headers with unaligned loads and validate data-prefix, declared-length, available... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width