-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added error for writing to /dev/ on Linux. #11991
Conversation
Ack, I just found another case - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind rebasing this cleanly on the latest master branch. I think it makes sense to add these error message for now. It may turn out that #11992 is a better long term fix for this, but I don't think that needs to prevent us from making this improvement now.
There, a fresh commit atop latest master. (I have, admittedly, not tested the result at all, but the merge required no manual massaging at all, so I'm reasonably confident it won't secretly burn the fields and salt the earth.) |
45f4283
to
2224d2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this. Looks like it just needs another rebase.
83fa3f7
to
b536b38
Compare
I only realized when I went to rebase all my PRs after the fun with #12072 that my pushing a rebase wouldn't have sent any notification, so, done. |
@aerusso since you noted this issue originally I thought you might have a few minutes to review this stop gap. It's not quite a fix, but the least we can do is properly detect the issue and warn people. |
This looks straightforward. The only thing I can suggest is that the error message,
sounds like a problem with the system (user: "Why the heck can't the stream be written to /dev/null?!"). I suggest something like
which makes it very clear that it's no fault of the user. |
That gives me a thought - how would you feel about something like:
? That way, we can minimize the number of people objecting to this/posting bugs about this, until some more permanent fix is merged. |
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated error message looks good to me. Thanks.
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: openzfs#11991
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: openzfs#11991
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: openzfs#11991
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: #11991
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: openzfs#11991
Starting in Linux 5.10, trying to write to /dev/{null,zero} errors out. Prefer to inform people when this happens rather than hoping they guess what's wrong. Reviewed-by: Antonio Russo <aerusso@aerusso.net> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Rich Ercolani <rincebrain@gmail.com> Closes: openzfs#11991
Motivation and Context
Starting in Linux 5.10, trying to write to /dev/ files errors out.
Prefer to inform people when this happens rather than hoping they
guess what's wrong.
Description
Plumbed an error check in for all the zfs_send_* calls in zfs_do_send, that checks
and if all of the above are true, prints an additional message.
(I also had an implementation that just detects and rejects attempting to write /dev on
Linux, but I like this approach better. If people disagree, I'll open that PR instead.)
How Has This Been Tested?
Lightly on my Debian bullseye VM where #11445 was reproducing before; it prints the correct message on trying to overwrite dev nodes in /dev, not for attempting to write things in /proc or /sys or on the root FS.
Types of changes
Checklist:
Signed-off-by
.