Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MATE without GVFS / automount / udisks
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
NTU
Apprentice
Apprentice


Joined: 17 Jul 2015
Posts: 187

PostPosted: Wed Aug 16, 2017 2:01 am    Post subject: MATE without GVFS / automount / udisks Reply with quote

Hey, I was just wondering if anyone has looked into trimming down MATE's control center and Caja to remove the automounting, udisks, and gvfs? Those are just extra ways to break into a Linux system and screw it up. An infected android phone that uses MTP for example can utilize udisks/gvfs and the TUN/TAP driver and cause all kinds of issues on the PC it's connected to. I was forced to re-install the entire system again to get it to behave normally again. I know this from experience, it happened to me, but I didn't have AIDE running at the time of the Android phone attacking my Gentoo box so I'm not sure exactly what happened. I plugged it in again on a Gentoo system that didn't have MATE installed, rather only LXDE, without gvfs, udisks or any automounting enabled, as well as the TUN/TAP kernel driver disabled and the phone had no effect. I'm not sure which exact feature it is, but is there any info out there about gvfs and udisks being a security vulnerability? I like MATE but if it's a security risk, it's not worth a pretty desktop, for me anyway. Thoughts? Thanks!

Putting this in development section because it pertains to modifying MATE, but also a security question, so not sure what thread this belongs in the most. Please move where you feel it more appropriate. (not sure how to word that last part)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Wed Aug 16, 2017 2:57 am    Post subject: Reply with quote

What???

Connecting an MTP device should not affect the machine, at most it would affect only the current user (unless you were using root with MATE, BAD BAD BAD). Need more details, so you actually clicked on something on your phone over MTP and it took over your machine? Or you enabled autorun?

If not, it's a bug that needs to be reported upstream as this should not happen. It seems that if your phone got infected somehow, other peoples' systems should have got infected and this should have been resolved in the gvfs/udisks/automount code by now and fairly well known, though I haven't seen anything. This most likely is user error unless you can pinpoint a specific piece of malware on your android phone that's triggering this, and send it upstream so it can be fixed.

On the other hand I do not know how long you can specify something like
Code:
USE=-udisks emerge --newuse @world

to disable udisks entirely. Because of how software development works, nobody wants to keep this option available for eternity as it would mean they would have to test both and they really only want to test WITH udisks.

However you can force polkit to disable you from mounting without mucking with USE flags and this should remain viable as long as polkit continues to be used: Add this to
/etc/polkit-1/rules.d/99-custom.rules (or whatever you want to call this file)
Code:
polkit.addRule(function(action, subject) {
               if (action.id == "org.freedesktop.udisks2.filesystem-mount" ) {
                   return polkit.Result.NO;
               }
           });

This will prohibit udisks2 from ever mounting.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
NTU
Apprentice
Apprentice


Joined: 17 Jul 2015
Posts: 187

PostPosted: Wed Aug 16, 2017 5:33 pm    Post subject: Reply with quote

Thank you for the polkit policy! Yeah I'm not sure, it was awhile ago, 2 years maybe? So if nobody else is aware of udisks or gvfs being a security risk, it's possible I did something stupid but I've been wary of those two things since.

Cheers mate!
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Wed Aug 16, 2017 6:08 pm    Post subject: Reply with quote

There's always a risk but the idea is that it should be written to minimize risk.

GVFS should simply be a convenience factor. It doesn't require root privileges, it merely maps things that wouldn't normally be considered a filesystem into a virtual filesystem - so you can get gvfs-capable applications to edit an off system file like sftp://different.host/file.txt seamlessly.

udisks, however, does eventually require root privileges. This, if written wrong, can have security implications. It tries to mitigate these by default:

- Only the console user can mount. This is the equivalent permissions of the so-called "evil maid" who has physical access to your hardware anyway.
- The idea is hopefully nothing really stupid is done: thus, there are several rules: you can't mount things over /bin, /sbin, etc. (it explicitly wants you to mount in /media or something so it can't interfere with the system) and it will prohibit you from using setuid binaries. For filesystems where the concept of "user" doesn't make sense (like FAT), it tries to make it easy for the user as possible - it sets permissions to only the console user.
- and yeah it was designed so that you can disable the feature without recompiling (like if your console, though you may be sitting at it, is actually physically secure and you don't want people plugging in disks to steal data.)

Please let people know if you see damage caused by plugging something in to a udisks user-mount system, it's a bug of some sort.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum