You are not logged in.

#1 2015-04-27 21:47:01

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

What allows /usr/bin/mount to call /usr/bin/modprobe xxx when needed?

Subject says it all.  Thanks.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2015-04-27 22:01:28

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: What allows /usr/bin/mount to call /usr/bin/modprobe xxx when needed?

/usr/bin/mount has the suid bit set.
http://unix.stackexchange.com/questions … y-bit-work


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2015-05-02 06:54:03

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: What allows /usr/bin/mount to call /usr/bin/modprobe xxx when needed?

Hmmm... I'm trying to allow my AUR package for turbostat to `modprobe msr` if it is not already loaded, so I ran `chmod u+s "$pkgdir/usr/bin/$pkgname"` in the PKGBUILD but it does not behave as /usr/bin/mount does in this regard with the suid bit set.

% ls -l /usr/bin/mount          
-rwsr-xr-x 1 root root 40208 Mar 13 10:36 /usr/bin/mount

% ls -l /usr/bin/turbostat
-rwsr-xr-x 1 root root 48984 May  2 02:49 /usr/bin/turbostat

% sudo turbostat
turbostat: no /dev/cpu/0/msr, Try "# modprobe msr" : No such file or directory

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2015-05-02 08:28:31

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: What allows /usr/bin/mount to call /usr/bin/modprobe xxx when needed?

setuid bit and sudo?

Is turbostat even programmed to call modprobe?

I don't think the subject says it all. ewaller answered how mount can be used as a regular user (depending on configuration of course; e.g. 'user'/'users' option), but that might not be exactly what you were after.

Offline

#5 2015-05-02 15:17:33

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: What allows /usr/bin/mount to call /usr/bin/modprobe xxx when needed?

Is turbosat a binary or is it a script? For security reasons, Linux ignores the SUID bit on scripts


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#6 2015-05-02 15:24:14

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: What allows /usr/bin/mount to call /usr/bin/modprobe xxx when needed?

Binary


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB