Comments (5)
I don't think this needs anything special to reproduce. Any encrypted pool with a passphrase should exhibit this behavior. I found it when stratis-min failed like this during boot when called from stratis-fstab-setup.
from stratisd.
I could also reproduce this after boot, by stopping stratisd.service and then running stratisd-min and stratis-min from the command line.
from stratisd.
Smoking gun has got to be here:
+++ b/src/jsonrpc/client/key.rs
@@ -25,7 +25,7 @@ pub fn key_set(key_desc: KeyDescription, keyfile_path: Option<
&str>) -> StratisR
let (read_end, write_end) = pipe()?;
write(write_end, password.as_bytes())?;
- do_request!(KeySet, key_desc; read_end)
+ do_request!(KeySet, key_desc; read_end.as_raw_fd())
}
};
if rc != 0 {
and here:
--- a/src/jsonrpc/client/pool.rs
+++ b/src/jsonrpc/client/pool.rs
@@ -2,7 +2,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-use std::path::PathBuf;
+use std::{os::fd::AsRawFd, path::PathBuf};
use nix::unistd::{pipe, write};
@@ -37,7 +37,7 @@ pub fn pool_start(
do_request_standard!(PoolStart, id, unlock_method; {
let (read_end, write_end) = pipe()?;
write(write_end, password.as_bytes())?;
- read_end
+ read_end.as_raw_fd()
})
} else {
do_request_standard!(PoolStart, id, unlock_method)
Actually, I believe the first change is benign because the pipe is created before the macro is expanded.
from stratisd.
- do_request!(KeySet, key_desc; read_end) + do_request!(KeySet, key_desc; read_end.as_raw_fd())
Just thinking out loud, I have no idea what's actually going on: Does this now leak the file descriptor? I.e., where is it closed now? But maybe this doesn't matter in a one-shot process like stratis-min. It will exit very soon anyway.
from stratisd.
- do_request!(KeySet, key_desc; read_end) + do_request!(KeySet, key_desc; read_end.as_raw_fd())
Just thinking out loud, I have no idea what's actually going on: Does this now leak the file descriptor? I.e., where is it closed now? But maybe this doesn't matter in a one-shot process like stratis-min. It will exit very soon anyway.
The do_request_standard!
macros final "argument" is the entire expression below.
let (read_end, write_end) = pipe()?;
write(write_end, password.as_bytes())?;
read_end
When the macro is expanded, that whole bit of syntax is evaluated and used in the call. That worked, when read_end
was the value of the expression, because Rust lifetime rules prevented drop from being called on the file descriptor while it was in use. But when nix went to requiring a raw file descriptor instead, i.e., just a number, the lifetime rules allowed the file to be dropped while that number was still in use.
from stratisd.
Related Issues (20)
- Add ability in early boot to specify either pool name or pool UUID
- When stratisd is left down for a while, filesystem sometimes can't unmount
- Compiling question on SLES15SP4 HOT 2
- Add a nightly task that runs cargo-audit on something built w/ cargo-auditable HOT 2
- Support for filesystem sizes and filesystem size limits in early boot
- Increase syn dependency in stratisd_proc_macros if we can
- error adding luks_device as cache to pool HOT 3
- Avoid creating XFS filesystems with 64 bit extent count
- Support origin field for filesystem snapshots
- missing stratis pool after update to Fedora 39: thin_repair out of metadata space HOT 47
- Add human readable result to stratis-dumpmetadata
- Should we log output of executable invocations at the info level, regardless of whether there is an error returned?
- Add ability to overwrite pool-level metadata to stratis-dumpmetadata
- Use already defined Name type to enforce validity of Names
- Address large_enum_variant clippy allow on DeviceInfo in identify.rs
- Address static_mut_refs clippy allow in dm.rs
- Address allowed use of deprecated flock function HOT 2
- stratis-fstab-setup calls `stratis-min pool is-encrypted` without argument
- Do password verification on user-entered password value in stratis-min
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stratisd.