Why should the rootfs have root ownership

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












The question maybe odd but i didn´t find any explanation to it, so:



Sevreral tools for generating rootfs use fakeroot in order to fake the permissions, create the rootfs and then archive it. After that when the archive will be extracted it will be seen by the kernel as having root ownership.



My question is why the linux kernel expects that the rootfs has root ownership?










share|improve this question





















  • What makes you think that the kernel expects this?
    – JdeBP
    Oct 10 '17 at 5:11










  • @JdeBP, because if the ownership of the rootfs is different than root, the kernel will fail to mount it.
    – Mouin
    Oct 10 '17 at 7:04










  • The vanilla kernel has no such restriction, to my knowledge. So again: What makes you think that the kernel expects this? What error message have you seen, and where?
    – JdeBP
    Oct 10 '17 at 10:12














up vote
0
down vote

favorite












The question maybe odd but i didn´t find any explanation to it, so:



Sevreral tools for generating rootfs use fakeroot in order to fake the permissions, create the rootfs and then archive it. After that when the archive will be extracted it will be seen by the kernel as having root ownership.



My question is why the linux kernel expects that the rootfs has root ownership?










share|improve this question





















  • What makes you think that the kernel expects this?
    – JdeBP
    Oct 10 '17 at 5:11










  • @JdeBP, because if the ownership of the rootfs is different than root, the kernel will fail to mount it.
    – Mouin
    Oct 10 '17 at 7:04










  • The vanilla kernel has no such restriction, to my knowledge. So again: What makes you think that the kernel expects this? What error message have you seen, and where?
    – JdeBP
    Oct 10 '17 at 10:12












up vote
0
down vote

favorite









up vote
0
down vote

favorite











The question maybe odd but i didn´t find any explanation to it, so:



Sevreral tools for generating rootfs use fakeroot in order to fake the permissions, create the rootfs and then archive it. After that when the archive will be extracted it will be seen by the kernel as having root ownership.



My question is why the linux kernel expects that the rootfs has root ownership?










share|improve this question













The question maybe odd but i didn´t find any explanation to it, so:



Sevreral tools for generating rootfs use fakeroot in order to fake the permissions, create the rootfs and then archive it. After that when the archive will be extracted it will be seen by the kernel as having root ownership.



My question is why the linux kernel expects that the rootfs has root ownership?







linux kernel root-filesystem ownership






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 9 '17 at 14:49









Mouin

125128




125128











  • What makes you think that the kernel expects this?
    – JdeBP
    Oct 10 '17 at 5:11










  • @JdeBP, because if the ownership of the rootfs is different than root, the kernel will fail to mount it.
    – Mouin
    Oct 10 '17 at 7:04










  • The vanilla kernel has no such restriction, to my knowledge. So again: What makes you think that the kernel expects this? What error message have you seen, and where?
    – JdeBP
    Oct 10 '17 at 10:12
















  • What makes you think that the kernel expects this?
    – JdeBP
    Oct 10 '17 at 5:11










  • @JdeBP, because if the ownership of the rootfs is different than root, the kernel will fail to mount it.
    – Mouin
    Oct 10 '17 at 7:04










  • The vanilla kernel has no such restriction, to my knowledge. So again: What makes you think that the kernel expects this? What error message have you seen, and where?
    – JdeBP
    Oct 10 '17 at 10:12















What makes you think that the kernel expects this?
– JdeBP
Oct 10 '17 at 5:11




What makes you think that the kernel expects this?
– JdeBP
Oct 10 '17 at 5:11












@JdeBP, because if the ownership of the rootfs is different than root, the kernel will fail to mount it.
– Mouin
Oct 10 '17 at 7:04




@JdeBP, because if the ownership of the rootfs is different than root, the kernel will fail to mount it.
– Mouin
Oct 10 '17 at 7:04












The vanilla kernel has no such restriction, to my knowledge. So again: What makes you think that the kernel expects this? What error message have you seen, and where?
– JdeBP
Oct 10 '17 at 10:12




The vanilla kernel has no such restriction, to my knowledge. So again: What makes you think that the kernel expects this? What error message have you seen, and where?
– JdeBP
Oct 10 '17 at 10:12










1 Answer
1






active

oldest

votes

















up vote
1
down vote













Because otherwise the owner of the root directory would be able to escalate privileges to root, f.i. by renaming /etc and creating a new one, and a new /etc/passwd.






share|improve this answer




















  • I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
    – Mouin
    Oct 10 '17 at 7:26










  • You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
    – Satō Katsura
    Oct 10 '17 at 7:30










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397041%2fwhy-should-the-rootfs-have-root-ownership%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













Because otherwise the owner of the root directory would be able to escalate privileges to root, f.i. by renaming /etc and creating a new one, and a new /etc/passwd.






share|improve this answer




















  • I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
    – Mouin
    Oct 10 '17 at 7:26










  • You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
    – Satō Katsura
    Oct 10 '17 at 7:30














up vote
1
down vote













Because otherwise the owner of the root directory would be able to escalate privileges to root, f.i. by renaming /etc and creating a new one, and a new /etc/passwd.






share|improve this answer




















  • I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
    – Mouin
    Oct 10 '17 at 7:26










  • You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
    – Satō Katsura
    Oct 10 '17 at 7:30












up vote
1
down vote










up vote
1
down vote









Because otherwise the owner of the root directory would be able to escalate privileges to root, f.i. by renaming /etc and creating a new one, and a new /etc/passwd.






share|improve this answer












Because otherwise the owner of the root directory would be able to escalate privileges to root, f.i. by renaming /etc and creating a new one, and a new /etc/passwd.







share|improve this answer












share|improve this answer



share|improve this answer










answered Oct 9 '17 at 18:04









Satō Katsura

10.7k11533




10.7k11533











  • I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
    – Mouin
    Oct 10 '17 at 7:26










  • You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
    – Satō Katsura
    Oct 10 '17 at 7:30
















  • I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
    – Mouin
    Oct 10 '17 at 7:26










  • You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
    – Satō Katsura
    Oct 10 '17 at 7:30















I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
– Mouin
Oct 10 '17 at 7:26




I am not sure to understand, but what i mean is that the kernel fails to mount the rootfs if it s not root
– Mouin
Oct 10 '17 at 7:26












You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
– Satō Katsura
Oct 10 '17 at 7:30




You asked why does the kernel do that, I gave you a plausible reason. Is that the definitive answer? No idea, you'll have to ask Linus for that. shrug
– Satō Katsura
Oct 10 '17 at 7:30

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397041%2fwhy-should-the-rootfs-have-root-ownership%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay