FS#69024 - [mkinitcpio] [Security] initramfs world readable bit is restored on every package upgrade
Attached to Project:
Arch Linux
Opened by jamazi (jamazi) - Friday, 18 December 2020, 13:44 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Monday, 29 November 2021, 12:26 GMT
Opened by jamazi (jamazi) - Friday, 18 December 2020, 13:44 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Monday, 29 November 2021, 12:26 GMT
|
Details
Description:
mkinitcpio-remove hook script will remove old initramfs images, making new images world readable. Workaround: - Add 'chmod 600 "$out"' after line https://git.archlinux.org/mkinitcpio.git/tree/mkinitcpio#n230. - Execute the image compression in a subshell with umask 077 Additional info: * mkinitcpio >= v27 |
This task depends upon
Closed by Giancarlo Razzolini (grazzolini)
Monday, 29 November 2021, 12:26 GMT
Reason for closing: Implemented
Additional comments about closing: mkinitcpio 31 implements this.
Monday, 29 November 2021, 12:26 GMT
Reason for closing: Implemented
Additional comments about closing: mkinitcpio 31 implements this.
The only use case where the issue you described would be an issue is on a server, where you have untrusted users with shell access (or being able to run commands).
This is a problem because typically users embedding security material in the initramfs run chmod on the initramfs before or right after adding that security material by rerunning mkinitcpio with a modified config. And mkinitcpio itself respects that.
This didn't happen back when the initramfs was only removed during a "package* deletion, but the new hook fully deletes all vestiges of the initramfs every time /usr/lib/modules/$(uname -r)/ is deleted and replaced by a new directory with a different version.
I wasn't explaining it to you, I was examining it to "anyone reading this", for the sake of context.
Sue me, I guess, for being a wordy person.
I guess that not providing a patch qualifies as passive-aggressive BS now. Because clearly if I don't also provide a patch every time I report an issue it constitutes a "dig" at your hooks.
I *strongly* recommend you look in the mirror. You have a bizarre, irrational hatred of seeing my name and the word "mkinitcpio" together, and you automatically assume malice aforethought every time it occurs.
It's tiresome and sickening. Please stop this. Expressing doubt about your code is not reasonable grounds for personal attacks.
There is a reason I haven't volunteered my copious spare time for writing mkinitcpio patches -- you've made it *agonizing* to think about doing so.
Doesn't matter who wrote the hook, this is a security issue and should be fixed.
If two of the senior devs in the Arch project act like this to each other, I can see why Arch gets the poor reputation for not only trying to get help, but the lashback when reporting bugs.
I love Arch Linux. I don't want to see this, ever.
I'll pitch in if I'm able. I just need to know where to push a PR now and then.