<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://vulnerability.circl.lu</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Tue, 29 Sep 2026 20:48:46 +0000</lastBuildDate>
    <item>
      <title>CVE-2025-40072 — fanotify: Validate the return value of mnt_ns_from_dentry() before dereferencing</title>
      <link>https://vulnerability.circl.lu/vuln/cve-2025-40072</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;fanotify: Validate the return value of mnt_ns_from_dentry() before dereferencing&lt;/p&gt;
&lt;p&gt;The function do_fanotify_mark() does not validate if
mnt_ns_from_dentry() returns NULL before dereferencing mntns-&amp;gt;user_ns.
This causes a NULL pointer dereference in do_fanotify_mark() if the
path is not a mount namespace object.&lt;/p&gt;
&lt;p&gt;Fix this by checking mnt_ns_from_dentry()&amp;#39;s return value before
dereferencing it.&lt;/p&gt;
&lt;p&gt;Before the patch&lt;/p&gt;
&lt;p&gt;$ gcc fanotify_nullptr.c -o fanotify_nullptr
$ mkdir A
$ ./fanotify_nullptr
Fanotify fd: 3
fanotify_mark: Operation not permitted
$ unshare -Urm
Fanotify fd: 3
Killed&lt;/p&gt;
&lt;p&gt;int main(void){
    int ffd;
    ffd = fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_MNT, 0);
    if(ffd &amp;lt; 0){
        perror(&amp;#34;fanotify_init&amp;#34;);
        exit(EXIT_FAILURE);
    }&lt;/p&gt;
&lt;p&gt;printf(&amp;#34;Fanotify fd: %d\n&amp;#34;,ffd);&lt;/p&gt;
&lt;p&gt;if(fanotify_mark(ffd, FAN_MARK_ADD | FAN_MARK_MNTNS,
FAN_MNT_ATTACH, AT_FDCWD, &amp;#34;A&amp;#34;) &amp;lt; 0){
        perror(&amp;#34;fanotify_mark&amp;#34;);
        exit(EXIT_FAILURE);
    }&lt;/p&gt;
&lt;p&gt;return 0;
}&lt;/p&gt;
&lt;p&gt;After the patch&lt;/p&gt;
&lt;p&gt;$ gcc fanotify_nullptr.c -o fanotify_nullptr
$ mkdir A
$ ./fanotify_nullptr
Fanotify fd: 3
fanotify_mark: Operation not permitted
$ unshare -Urm
Fanotify fd: 3
fanotify_mark: Invalid argument&lt;/p&gt;
&lt;p&gt;[   25.694973] BUG: kernel NULL pointer dereference, address: 0000000000000038
[   25.695006] #PF: supervisor read access in kernel mode
[   25.695012] #PF: error_code(0x0000) - not-present page
[   25.695017] PGD 109a30067 P4D 109a30067 PUD 142b460…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Linux&lt;/p&gt;
&lt;p&gt;In the Linux kernel, the following vulnerability has been resolved:&lt;/p&gt;
&lt;p&gt;fanotify: Validate the return value of mnt_ns_from_dentry() before dereferencing&lt;/p&gt;
&lt;p&gt;The function do_fanotify_mark() does not validate if
mnt_ns_from_dentry() returns NULL before dereferencing mntns-&amp;gt;user_ns.
This causes a NULL pointer dereference in do_fanotify_mark() if the
path is not a mount namespace object.&lt;/p&gt;
&lt;p&gt;Fix this by checking mnt_ns_from_dentry()&amp;#39;s return value before
dereferencing it.&lt;/p&gt;
&lt;p&gt;Before the patch&lt;/p&gt;
&lt;p&gt;$ gcc fanotify_nullptr.c -o fanotify_nullptr
$ mkdir A
$ ./fanotify_nullptr
Fanotify fd: 3
fanotify_mark: Operation not permitted
$ unshare -Urm
Fanotify fd: 3
Killed&lt;/p&gt;
&lt;p&gt;int main(void){
    int ffd;
    ffd = fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_MNT, 0);
    if(ffd &amp;lt; 0){
        perror(&amp;#34;fanotify_init&amp;#34;);
        exit(EXIT_FAILURE);
    }&lt;/p&gt;
&lt;p&gt;printf(&amp;#34;Fanotify fd: %d\n&amp;#34;,ffd);&lt;/p&gt;
&lt;p&gt;if(fanotify_mark(ffd, FAN_MARK_ADD | FAN_MARK_MNTNS,
FAN_MNT_ATTACH, AT_FDCWD, &amp;#34;A&amp;#34;) &amp;lt; 0){
        perror(&amp;#34;fanotify_mark&amp;#34;);
        exit(EXIT_FAILURE);
    }&lt;/p&gt;
&lt;p&gt;return 0;
}&lt;/p&gt;
&lt;p&gt;After the patch&lt;/p&gt;
&lt;p&gt;$ gcc fanotify_nullptr.c -o fanotify_nullptr
$ mkdir A
$ ./fanotify_nullptr
Fanotify fd: 3
fanotify_mark: Operation not permitted
$ unshare -Urm
Fanotify fd: 3
fanotify_mark: Invalid argument&lt;/p&gt;
&lt;p&gt;[   25.694973] BUG: kernel NULL pointer dereference, address: 0000000000000038
[   25.695006] #PF: supervisor read access in kernel mode
[   25.695012] #PF: error_code(0x0000) - not-present page
[   25.695017] PGD 109a30067 P4D 109a30067 PUD 142b460…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/cve-2025-40072</guid>
    </item>
  </channel>
</rss>
