<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=6831&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=6831</link>
		<description><![CDATA[The most recent posts in Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133.]]></description>
		<lastBuildDate>Thu, 26 Jun 2025 21:40:25 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=56305#p56305</link>
			<description><![CDATA[<p>On Ubuntu, the NTFS driver (read and write) was installed and enabled by default since 2007.<br />It worked without problems and &quot;compatibility issues&quot;.<br />It seems that this particular security problem occurred about ten years ago, for example:<br />_https://unix.stackexchange.com/questions/296967/how-to-recursively-remove-execute-permissions-from-files-without-touching-folder<br />_https://unix.stackexchange.com/q/296967<br />Nothing was done to fix it.<br />You may not believe, but computer science students (and their professors, perhaps), usually do not notice that this problem exists. They simply install Ubuntu and use it for their projects.<br />It might be obvious that this strange phenomenon correlates with pulseaudio and systemd.<br />It is very probable that it is a symptom of dementia caused by pulseaudio and enhanced by pipewire.</p><p>EDIT:<br />Because of dementia, it might be difficult to understand that what kind of security problem it is.<br />It is a backdoor in Devuan.</p><p>It seems that Stuxnet is already forgotten (because of dementia).</p><div class="quotebox"><blockquote><div><p>It is typically introduced to the target environment via an <span style="color: red"><strong>infected USB flash drive</strong></span>, thus crossing any air gap. The worm then propagates across the network, scanning for Siemens Step7 software on computers controlling a PLC.<br />_https://en.wikipedia.org/wiki/Stuxnet</p></div></blockquote></div><p><strong>Uh-oh. How just inserting a USB drive can pwn a Linux box </strong><br />_https://www.bitdefender.com/en-us/blog/hotforsecurity/uh-oh-how-just-inserting-a-usb-drive-can-pwn-a-linux-box</p><div class="quotebox"><blockquote><div><p>CVE-2025-37986 is a vulnerability discovered in the Linux kernel&#039;s USB Type-C device pointer handling system, disclosed on May 20, 2025.<br />_https://www.wiz.io/vulnerability-database/cve/cve-2025-37986</p></div></blockquote></div><div class="quotebox"><blockquote><div><p>Linux USB Subsystem Vulnerabilities<br />Fourteen vulnerabilities have been found to be affecting the USB subsystem on Linux. The vulnerabilities affect all Linux devices with USB ports. However, physical access is required to initiate them.</p><p>Threat ID:<br />&#160; &#160; CC-1777 <br />Category:<br />&#160; &#160; Exploit <br />Threat Severity:<br />&#160; &#160; Low <br />Threat Vector:<br />Published:<br />&#160; &#160; 14 November 2017 12:00 AM <br />_https://digital.nhs.uk/cyber-alerts/2017/cc-1777</p></div></blockquote></div><p><strong>Researchers found 26 new vulnerabilities in the USB drivers used in Windows, Linux, macOS and other systems.</strong><br />_https://www.hugdiy.com/blog/you-wouldnt-know-until-you-test-it-how-to-restore-all-these-usb-vulnerabilities/</p>]]></description>
			<author><![CDATA[dummy@example.com (igorzwx)]]></author>
			<pubDate>Thu, 26 Jun 2025 21:40:25 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=56305#p56305</guid>
		</item>
		<item>
			<title><![CDATA[Re: Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=56302#p56302</link>
			<description><![CDATA[<div class="quotebox"><blockquote><div><p>Nobody complains, and nobody is trying to fix the problem.</p><p>This seems to be a symptom of dementia caused by pulseaudio and pipewire.</p></div></blockquote></div><p>It is important to note that consideration should be given when using exFAT or NTFS file systems on Linux systems. These file systems (M$) are not natively supported by Linux, and their usage carries risks due to potential compatibility issues.</p><p>In other words, micro$ FS should remain on your desk next to the window — like a broken vase. Though I find exFAT extremely useful for file exchange.</p>]]></description>
			<author><![CDATA[dummy@example.com (Devarch)]]></author>
			<pubDate>Thu, 26 Jun 2025 20:45:49 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=56302#p56302</guid>
		</item>
		<item>
			<title><![CDATA[Re: Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=56282#p56282</link>
			<description><![CDATA[<p>The latest version of Linux Mint (22.1) has the same security problem.<br />USB Drives (NTFS, exFAT) are automatically mounted with all files executable.<br />Nobody complains, and nobody is trying to fix the problem.</p><p>This seems to be a symptom of dementia caused by pulseaudio and pipewire.<br />It may also explain a strange phenomenon of Neo-Luddism and AI hate<br />_https://en.wikipedia.org/wiki/Neo-Luddism<br />_https://en.wikipedia.org/wiki/Luddite</p><p>Perhaps, it is too late to do something about Devuan Wiki.</p>]]></description>
			<author><![CDATA[dummy@example.com (igorzwx)]]></author>
			<pubDate>Thu, 26 Jun 2025 14:28:06 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=56282#p56282</guid>
		</item>
		<item>
			<title><![CDATA[Re: Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=52130#p52130</link>
			<description><![CDATA[<p>Hope it works for you. </p><div class="quotebox"><cite>PedroReina wrote:</cite><blockquote><div><p>After 20 years, at last I know how to fix this annoying behaviour.</p></div></blockquote></div><p>I thought that it is a special feature of Devuan.<br />If it is &quot;annoying behaviour&quot; for you, it does not mean that it is also annoying for others.<br />Since nobody complains, it might be the normal way of things for pulseaudio users.<br />Although, of course, it might be a security problem. </p><p>The <span class="bbc">/etc/udisks2/mount_options.conf</span> should be tested and verified.</p><p>Umask<br />_https://en.wikipedia.org/wiki/Umask<br />_https://wiki.archlinux.org/title/Umask</p><div class="codebox"><pre><code>$ umask
0022 </code></pre></div><div class="quotebox"><blockquote><div><p>_https://www.linuxquestions.org/questions/linux-general-1/mounting-ntsf-drive-in-fstab-unsure-of-fmask-and-dmask-values-4175458533/#post4934200</p><div class="codebox"><pre class="vscroll"><code>fmask, dmask, and umask taken together pertain only to Windows filetypes ( NTFS and FAT32 ) whereas umask alone pertains to both windows and Linux filetypes but are implemented 2 different ways.

On Linux Filesystems

At the moment of birth every file has permissions of 666 and every directory has permissions of 777. A system wide umask is created to modify these permissions immediately after birth and it&#039;s currently set at 002. So when you create a new file it&#039;s permissions are:

666
002 &lt;-- minus the umask
==
664

And every new directory has permissions of:

777
002 &lt;-- minus the umask
==
775

On Windows Filesystems

Windows fileystems have no Linux file permission attributes so a virtual filesystem is used to create a &quot;view&quot; to give them the appearance that they do have them. The system wide umask has no affect on these filesystems nor does a chmod or a chown. They can only be set when the &quot;view&quot; is created in fstab.

At the moment of birth NTFS files and folders start out with exactly the same permissions: 777. If you were to set up in fstab a umask of 002 for these partitions then the result would be different from a Linux filesystem:

File: 777 - 002 = 775
Folder: 777 - 002 = 775

The folder setting is fine and that&#039;s the way you want them to be but the files have all been made executable - every single one of them. You can change that by separating umask into it&#039;s constituent parts: fmask and dmask:

So if you set up fstab this way for an NTFS partition: dmask=002,fmask=113

File: 777 - 113 = 664
Folder: 777 - 002 = 775 </code></pre></div></div></blockquote></div><p>_https://thelinuxcode.com/automount-usb-ubuntu/<br />_https://www.freedesktop.org/wiki/Software/udisks/<br />_https://storaged.org/doc/udisks2-api/latest/mount_options.html<br />_https://www.kernel.org/doc/Documentation/filesystems/vfat.txt</p><p>ArchWiki<br />_https://wiki.archlinux.org/title/Udisks#NTFS_mount_failing<br />_https://wiki.archlinux.org/title/Udisks#NTFS_file_creation_failing_(filename-dependent)</p><div class="codebox"><pre><code>$ locate udisksd
/usr/libexec/udisks2/udisksd
/usr/share/man/man8/udisksd.8.gz

$ man udisksd
$ man udisksctl </code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (igorzwx)]]></author>
			<pubDate>Tue, 10 Sep 2024 14:34:24 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=52130#p52130</guid>
		</item>
		<item>
			<title><![CDATA[Re: Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=52129#p52129</link>
			<description><![CDATA[<p>After 20 years, at last I know how to fix this annoying behaviour. Thanks a lot!</p>]]></description>
			<author><![CDATA[dummy@example.com (PedroReina)]]></author>
			<pubDate>Tue, 10 Sep 2024 08:53:11 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=52129#p52129</guid>
		</item>
		<item>
			<title><![CDATA[Automounting USB Drives (NTFS, exFAT) with dmask=022,fmask=133]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=52121#p52121</link>
			<description><![CDATA[<p>System: Devuan, Mate Desktop</p><div class="codebox"><pre><code>$ cat /etc/*-release | grep PRETTY
PRETTY_NAME=&quot;Devuan GNU/Linux 5 (daedalus)&quot; 

$ inxi -S
System:
  Host: devuan Kernel: 6.1.0-25-amd64 arch: x86_64 bits: 64 Desktop: MATE
    v: 1.26.0 Distro: Devuan GNU/Linux 5 (daedalus)</code></pre></div><p>When you insert a USB drive, it is automatically mounted to a directory under <span class="bbc">/media</span> <br />However, if your USB drive has a Windows file system (e.g. NTFS, or exFAT), all your text files (and all other files: *.jpg, *.wav, etc.) on the USB drive become executable (777 - 022 = 755).<br />If you copy such files to your home folder, you have to fix permissions, for example:</p><div class="codebox"><pre><code>$ chmod -Rv -x+X -- ./ </code></pre></div><p>_https://unix.stackexchange.com/questions/296967/how-to-recursively-remove-execute-permissions-from-files-without-touching-folder</p><p>It seems that this problem can be easily fixed with <span class="bbc">/etc/udisks2/mount_options.conf</span></p><div class="codebox"><pre><code>$ ls -1 /etc/udisks2/
mount_options.conf.example
udisks2.conf 

$ sudo nano /etc/udisks2/mount_options.conf
 
$ cat /etc/udisks2/mount_options.conf
[defaults]
vfat_defaults=uid=$UID,gid=$GID,shortname=mixed,utf8=1,showexec,dmask=022,fmask=133
exfat_defaults=uid=$UID,gid=$GID,iocharset=utf8,errors=remount-ro,dmask=022,fmask=133
ntfs_defaults=uid=$UID,gid=$GID,dmask=022,fmask=133 </code></pre></div><p>NOTE: <span class="bbc">/etc/udisks2/mount_options.conf</span> is enabled automatically (a reboot is not required).<br />You can simply insert your USB drive and check file permissions:</p><div class="codebox"><pre><code>$ touch file.txt
$ stat -c %a file.txt
644
$ mkdir folder1
$ stat -c %a folder1
755 </code></pre></div><p>See:<br />_https://chmodcommand.com/chmod-644/<br />_https://chmodcommand.com/chmod-755/</p><p>Perhaps, this <span class="bbc">mount_options.conf</span> can be somehow improved, or there is a better solution.</p>]]></description>
			<author><![CDATA[dummy@example.com (igorzwx)]]></author>
			<pubDate>Mon, 09 Sep 2024 11:30:53 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=52121#p52121</guid>
		</item>
	</channel>
</rss>
