-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
lib / distro-agnostic.sh: drop chmod on /bin/ping #9033
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
base: main
Are you sure you want to change the base?
Conversation
we are way past buster now (if ever this was needed to begin with)
WalkthroughRemoved privilege-escalation code from the distro-agnostic rootfs installation script that previously set the ping binary with set-uid permissions inside the chroot environment, along with associated security comments. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
One does wonder that this didn't break later when the pkg was upgraded. do we have a history on this? |
|
https://forum.armbian.com/topic/11276-unable-to-ping-as-user/ doesn't link to a debian bug, so it's just an empirical report |
|
https://forum.proxmox.com/threads/no-ping-from-non-root-user-in-debian-buster-lxc.72366/ suggests it may not be fully extinguished |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 743 🏁 Script executed: Length of output: 1760 🏁 Script executed: Length of output: 812 🏁 Script executed: Length of output: 303 🏁 Script executed: Length of output: 1476 🏁 Script executed: Length of output: 2135 🏁 Script executed: Length of output: 269337 🏁 Script executed: Unrecoverable error: Request timed out after 300000ms (requestId=85b61cf3-a19a-4025-84a8-75567c355216) 🏁 Script executed: Length of output: 7084 @tabrisnet Based on my investigation, here's what I found about the history of this chmod operation: HistoryThe The comment in the code provides important context: # @TODO: security problem?
# ping needs privileged action to be able to create raw network socket
# this is working properly but not with (at least) Debian Buster
chroot_sdcard chmod u+s /bin/pingThe mention of "Debian Buster" (released in 2019) suggests this code is quite old and was originally added to work around ping permission issues in that era. Why It Didn't Break on Package UpgradesThe chmod operation likely didn't cause breakage on package upgrades for several reasons:
Conclusion: The PR author is correct that this chmod is no longer needed (and may never have been truly necessary). Modern Debian/Ubuntu distributions handle ping permissions correctly through capabilities, making this manual permission modification obsolete and potentially a security concern. |
the way I interpreted my research into the use of chmod here was that it was yet another instance of Armbian mucking around without understanding what is really going on. Kind of like using sudo instead of understanding why an ordinary users can't do something. Oh wait, that perfectly describes what happened here... LOL There's so much of this kind of stuff in Armbian, it's really scary. |
No, it can be traced back to 2019 and the forum thread which was already linked which then refers to c65eff6 which the rabbit could have also found via git blame. |
|
Generally speaking from my understanding ping was never designed to run as causal user. Though I guess through some other popular proprietary OS out of Redmond we learned that user can actually use ping. And Ubuntu also allows ping for users by default. Debian does not. Both positions are valid. But for the sake of comfort I'd stick to allowance. Not sure though if this hack is still necessary. Perhaps go with Rabbit's concern and switch hack to file capabilities ? |
we are way past buster now (if ever this was needed to begin with)
let's stop mucking around with permissions this way
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.