Age | Commit message (Collapse) | Author |
|
2041: Set the length of a socket address when calling `recvmsg` on Linux r=asomers a=JarredAllen
# Background
I think I've found a bug with `recvmsg` on Linux where it doesn't set the length of a received socket address. I found this while working with unix datagram sockets with path `struct sockaddr_un` addresses, but I think this applies to any variable-length socket address type.
At present, the `sun_len` field of `UnixAddr` on Linux shows up as 0 whenever I call `recvmsg`. I think it's reading uninitialized memory (afaict the `recvmsg` function never initializes it before we call `MaybeUninit::assume_init`), though it's possible that it's being zero-initialized somewhere that I missed. Either way, this isn't the correct behavior, which should set it to the length of the `struct sockaddr_un` contents (or whatever other type of socket).
# Changes
I changed the `recvmsg` function to construct the returned socket address from the `struct sockaddr` and length returned by the libc `recvmsg` call (using the `from_raw` function the trait provides). Since the trait is sealed so downstream crates can't implement it, I believe this shouldn't be a breaking change.
# Validation
I've tested that my code (which failed due to this bug) now works. I also added a new test case which tests that we construct `UnixAddr`s correctly in the `recvmsg` function, which passes locally for me and fails if I cherry-pick it onto the current `master`.
I've also checked that `cargo test` and `cargo clippy` both still pass on `aarch64-apple-darwin` and on `aarch64-unknown-linux-musl` targets (the two targets I develop for/have access to). Hopefully your CI will confirm that everything else still works.
Co-authored-by: Jarred Allen <jarred@moveparallel.com>
Co-authored-by: Jarred Allen <jarredallen73@gmail.com>
|
|
|
|
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
2077: Enable socket timestamping options on Android r=asomers a=spencercw
Requires https://github.com/rust-lang/libc/pull/3267 which landed in libc 0.2.147.
Co-authored-by: Chris Spencer <spencercw@gmail.com>
|
|
|
|
|
|
|
|
2048: Enable additional socket timestamping flags r=asomers a=spencercw
Co-authored-by: Chris Spencer <spencercw@gmail.com>
|
|
2076: Clippy cleanup r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
2067: Address seeming typo in lib.rs r=asomers a=solidsnack
I believe the `my` here was intended to be `many` -- but am not sure.
Co-authored-by: Jason Dusek <jason.dusek@gmail.com>
|
|
I believe the `my` here was intended to be `many` -- but am not sure.
|
|
2027: Update to bitflags 2.2.1. r=asomers a=qwandor
This is a new major version and requires some code changes.
2057: Haiku: `speed_t` is defined as `u8` for 32 and 64 bit systems r=asomers a=nielx
This fixes the build on 32 bit Haiku systems.
Co-authored-by: Andrew Walbran <qwandor@google.com>
Co-authored-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
|
|
2051: Update CHANGELOG for patch release 0.26.2 r=asomers a=asomers
[skip ci]
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
2061: For invalid IP address conversions with future Rust versions r=asomers a=asomers
Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr are wrappers around the C types (though for now at least, they are identical on all platforms I'm aware of). So do the conversions explicitly instead of transmuting.
Fixes #2053
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
Rust's standard library no longer guarantees that Ipv4Addr and Ipv6Addr
are wrappers around the C types (though for now at least, they are
identical on all platforms I'm aware of). So do the conversions
explicitly instead of transmuting.
Fixes #2053
|
|
2062: Disable the doc test for sys::personality::personality on aarch64 r=asomers a=asomers
It's failing in CI, and we don't yet know why. Possibly the cloud provider just turned on seccomp.
Issue #2060
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
It's failing in CI, and we don't yet know why. Possibly the cloud
provider just turned on seccomp.
Issue #2060
|
|
|
|
2052: Fix CI with the latest rustup r=asomers a=asomers
Co-authored-by: Alan Somers <asomers@gmail.com>
Co-authored-by: Ben Kimock <kimockb@gmail.com>
|
|
fix the new clippy::non-minimal-cfg lint
|
|
The latest Rustup does not allow the toolchain specification to be
blank, which we were using. Fix it by ensuring that only one toolchain
is ever installed in a given task, so we won't need to use the
+$TOOLCHAIN with cargo.
|
|
[skip ci]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is a new major version and requires some code changes.
|
|
|
|
2009: Add more detail for ptrace documentation r=asomers a=thomasqueirozb
All functions are documented with the equivalent C call example except for `read`, `read_user`, `write` & `write_user`.
I was looking for the function that used `PTRACE_PEEKDATA` and couldn't find it using the documentation and had to go to the source code to find it out. In hindsight, it's pretty obvious that it was read... But still I think it would be nice to have it documented
Co-authored-by: Thomas de Queiroz Barros <38295417+thomasqueirozb@users.noreply.github.com>
|
|
2040: timerfd: Add TFD_TIMER_CANCEL_ON_SET flag r=asomers a=apohrebniak
Hi.
This PR adds an TFD_TIMER_CANCEL_ON_SET flag to use with `timerfd` on Linux and Android
Co-authored-by: Andrii Pohrebniak <andrii.pohrebniak@gmail.com>
|
|
2042: Update memoffset to 0.9 r=asomers a=est31
Updates memoffset to version 0.9
Co-authored-by: est31 <MTest31@outlook.com>
|
|
2043: Clippy cleanup: r=asomers a=asomers
fix the new clippy::non_minimal_cfg lint
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
fix the new clippy::non_minimal_cfg lint
|
|
|
|
|
|
2029: Remove 'static mut' usage in features::os::kernel_version. r=asomers a=zachs18
Resolves #2028
Note that this is (AFAICT) the first use of `Atomic*` types in `nix` (other than tests). However, this shouldn't be a portability issue, since `nix` is not `#![no_std]`, and (IIUC) [`std` requires](https://doc.rust-lang.org/std/sync/atomic/#portability) at least loads and stores of pointer-sized atomics (i.e. `AtomicUsize`), which is all this PR uses.
Co-authored-by: Zachary S <zasample18+github@gmail.com>
|
|
|
|
|
|
2033: remove unused mut from two variable declarations in sys/socket/mod.rs r=asomers a=inglorion
This addresses diagnostics like:
error: variable does not need to be mutable
--> src/sys/socket/mod.rs:1537:13
|
1537 | let mut p = &mut mmsghdr.msg_hdr;
Co-authored-by: Bob Haarman <inglorion@google.com>
|
|
This addresses diagnostics like:
error: variable does not need to be mutable
--> src/sys/socket/mod.rs:1537:13
|
1537 | let mut p = &mut mmsghdr.msg_hdr;
|
|
(re-commit for CI retry after rustix 0.37.18 release)
|
|
2026: Update to published release of libc r=asomers a=atouchet
Co-authored-by: Alex Touchet <alextouchet@outlook.com>
|
|
|
|
2021: Fixing link in rustdoc comments in User::from_name r=asomers a=austinkeeley
Link text is correct but the URL goes to the wrong function. Probably just a copy/paste issue from the other function.
Co-authored-by: Austin Keeley <austin.keeley@gmail.com>
|