Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Some questions about wine and security
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
pizza-rat
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2022
Posts: 81

PostPosted: Fri Feb 24, 2023 10:07 pm    Post subject: Some questions about wine and security Reply with quote

I often run closed-source Windows games via wine (usually either through Steam or Lutris for convenience) and I was thinking lately about what kind of access wine might have in the off-chance that any one of these games had some malicious code hiding in it. So, a few questions...

#1. Can a program launched through wine read any file it wants anywhere on my filesystem? Of course, it can't write to anything that requires root permissions (I assume) but couldn't it read text files, or even things like Firefox and Thunderbird profiles entirely?

#2. Does unmapping the rest of the linux filesystem (ie what's often mapped to Z: by default whenever you set up a new wine prefix) actually reliably prevent #1? What about winetricks's sandbox (or lutris's sandbox) option?

#3. Why does unmapping Z: break some games?

#4. What are other reliable options for preventing applications run through wine from having access to anything outside of their prefix? I have heard of firejail (neither the default lutris or steam profiles work for me, the former seems to have no access to Vulkan and the latter spits an error about an integer parameter out of range), flatpak, apparmor and running wine as a separate user.

I know some of this is paranoid, and I know "just dont run closed source software ever :)))" is one kind of solution, too, but I'm curious about all of this. Using a VM would probably be a solution too but as far as I'm aware most games require you to have a second GPU to feed to the VM, don't they?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21709

PostPosted: Fri Feb 24, 2023 10:43 pm    Post subject: Reply with quote

  1. Wine is not a sandbox. Any file that your user can access with a native Linux command can be accessed by a Windows program running under Wine.
  2. This mitigates it a little bit, but only a little. A determined program could still do anything that your Linux user has permission to do.
  3. Unknown. This should not happen.
  4. Use a sandboxing mechanism, such as Firejail, so that the kernel enforces that the confined application cannot access the target resource.
Back to top
View user's profile Send private message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 572
Location: Ásgarðr

PostPosted: Fri Feb 24, 2023 11:08 pm    Post subject: Reply with quote

Code:
as far as I'm aware most games require you to have a second GPU to feed to the VM, don't they?

GPU passthrough is indeed the best solution but it requires of course to have a second gpu. :wink:

Otherwise, you could give a try to qemu with USE=virgl enabled.
This will enable media-libs/virglrenderer (library used to implement a virtual 3D GPU used by qemu)
Then setup a minimal vm with the os of your choice and use wine in the vm. Performance was quite good (much better than using standard qxl) last time I tried. (more than a year ago)
Back to top
View user's profile Send private message
pizza-rat
Tux's lil' helper
Tux's lil' helper


Joined: 23 Dec 2022
Posts: 81

PostPosted: Sat Feb 25, 2023 12:16 am    Post subject: Reply with quote

Hu wrote:
  1. Wine is not a sandbox. Any file that your user can access with a native Linux command can be accessed by a Windows program running under Wine.
  2. This mitigates it a little bit, but only a little. A determined program could still do anything that your Linux user has permission to do.
  3. Unknown. This should not happen.
  4. Use a sandboxing mechanism, such as Firejail, so that the kernel enforces that the confined application cannot access the target resource.


It sounds like Firejail, or perhaps Flatpak or Apparmor are the way to go for my setup. Is one recommended over the others for such a use case, before I make another thread asking for help configuring Firejail?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players 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