11618 Use exec_attr instead of suid for smbfs mount and unmount

Review Request #2262 - Created Aug. 24, 2019 and submitted

Information
Gordon Ross
illumos-gate
11618
Reviewers
general

11618 Use exec_attr instead of suid for smbfs mount and unmount

I have to say, the old "SUID, add priv, drop SUID" seemed simpler.
I guess the RBAC way is "better", right? :)

Works now.

gwr@gwr-oi2$ mkdir H
gwr@gwr-oi2$ mount -F smbfs //gwr@sm20lab/home_gwr H
gwr@gwr-oi2$ ls H
[...]
gwr@gwr-oi2$ umount H
Jason King
Gordon Ross
Joshua Clulow
Gordon Ross
Gordon Ross
Gordon Ross
Jason King
Jason King
Gordon Ross
Gordon Ross
Gordon Ross
Jason King
Joshua Clulow
Gordon Ross
Review request changed

Status: Closed (submitted)

Gordon Ross

   
usr/src/cmd/fs.d/smbclnt/umount/umount.c (Diff revision 11)
 
 

The sprintf here was a bug, reported by Marco Ivaldi marco.ivaldi@mediaservice.net (thanks). If someone were to exec this program with a very long argv[0] then data after typename could be smashed.

Note however that the bug was NOT any sort of root exploit because after the __init_suid_priv() call above the program has given up its root privileges and is running as the real user. That makes this just an ordinary bug, not a security bug.

Loading...