{"id":2220762,"url":"http://patchwork.ozlabs.org/api/1.1/covers/2220762/?format=json","web_url":"http://patchwork.ozlabs.org/project/ubuntu-kernel/cover/20260408003238.233653-1-acelan.kao@canonical.com/","project":{"id":15,"url":"http://patchwork.ozlabs.org/api/1.1/projects/15/?format=json","name":"Ubuntu Kernel","link_name":"ubuntu-kernel","list_id":"kernel-team.lists.ubuntu.com","list_email":"kernel-team@lists.ubuntu.com","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260408003238.233653-1-acelan.kao@canonical.com>","date":"2026-04-08T00:32:37","name":"[SRU,R,0/1] dma-buf filesystem flags fix","submitter":{"id":2976,"url":"http://patchwork.ozlabs.org/api/1.1/people/2976/?format=json","name":"AceLan Kao","email":"acelan.kao@canonical.com"},"mbox":"http://patchwork.ozlabs.org/project/ubuntu-kernel/cover/20260408003238.233653-1-acelan.kao@canonical.com/mbox/","series":[{"id":499053,"url":"http://patchwork.ozlabs.org/api/1.1/series/499053/?format=json","web_url":"http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=499053","date":"2026-04-08T00:32:37","name":"dma-buf filesystem flags fix","version":1,"mbox":"http://patchwork.ozlabs.org/series/499053/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2220762/comments/","headers":{"Return-Path":"<kernel-team-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=nypeUhSC;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com\n (client-ip=185.125.189.65; helo=lists.ubuntu.com;\n envelope-from=kernel-team-bounces@lists.ubuntu.com;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fr3tx0B7Sz1xv0\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 08 Apr 2026 10:32:56 +1000 (AEST)","from localhost ([127.0.0.1] helo=lists.ubuntu.com)\n\tby lists.ubuntu.com with esmtp (Exim 4.86_2)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1wAGqc-0006dB-9b; Wed, 08 Apr 2026 00:32:46 +0000","from mail-qk1-f170.google.com ([209.85.222.170])\n by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.86_2) (envelope-from <acelan@gmail.com>) id 1wAGqb-0006cm-Fs\n for kernel-team@lists.ubuntu.com; Wed, 08 Apr 2026 00:32:45 +0000","by mail-qk1-f170.google.com with SMTP id\n af79cd13be357-8cb4136d865so725008885a.1\n for <kernel-team@lists.ubuntu.com>; Tue, 07 Apr 2026 17:32:45 -0700 (PDT)","from localhost (211-75-139-220.hinet-ip.hinet.net. [211.75.139.220])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8d2a864b6a7sm1350786485a.36.2026.04.07.17.32.41\n for <kernel-team@lists.ubuntu.com>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Apr 2026 17:32:41 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775608363; x=1776213163; darn=lists.ubuntu.com;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:sender:from:to:cc:subject:date:message-id:reply-to;\n bh=8gHviIlNLQrFbUNQnE3C7dX3K3Sq1Ykn2Mo0tVNmlzk=;\n b=nypeUhSC5d1RG++gP8LT5vXfTD7PWXNBjDZN9RHP9B/nnFySaiUqLG+gMG6K5mnOX4\n jOeLJ+Mxt+qRBYfErv9RKCrBIF5c3QIH/4ClV7jLj3pRNL7hJapsYr2igWvPKhBL+BL2\n s0/0KbRFFBHyOpA8ZVfbZ21oq/8zihsR8PajErejGq/+uwQra8aFT1xv8fJYDr7+CMn4\n TExpoqONlHxmBOYBmpaLe4dmaG6W2YqGrITpnlM+elS5bfFds+qwYj7hkMLv5YrcV/Ct\n jMXZS9vpAxR2NwAXswowmgRkKCwTLnR+AuuOqyGpyJuUFuBlXXmy0dB9a0pTFRy69tr6\n eTbQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775608363; x=1776213163;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:sender:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=8gHviIlNLQrFbUNQnE3C7dX3K3Sq1Ykn2Mo0tVNmlzk=;\n b=XCo//26Dv9Zmkd2RygBewqPhtdrGspHNrS+2E2BQyX+/GXCsl7TMaktCJp0rlU6hhS\n 9IPDoVW3TFfgIkLmKfAS9j/v/ZkXZ66tsWSGDlzjOSsj2NnE8pDeT8rLZ/3jHFXed5TP\n qsbeQb8m/fezNtsv7Fd7EncQQxMyrGXUopOzu2VN94XlNX+KjNmGuDnq/rEGSRoo7jhG\n Fq0xhJ7fZ46yxgwbx+HM1R1cImiFFx8QCoy7oeDlEzT2Wt5HPlF3PFRwmd66cilgDc8T\n vYbGFzR1MDtqKG4Z2RWWr7Od5gfP9aksQ4gicGJscMHyOkPCtlyGt4Dyz+ywwl4ca5NI\n FDew==","X-Gm-Message-State":"AOJu0YxtGZtcz6NTuu54AWQ4SOJiH2NyH+bYCpvdQQaaVcBNl9kFf86Q\n NdclMNy+W6BYDVQtCwCcSleD28mMLFOjEcBmAygP8phfz3tj/WoPprb/9Q2o2U8/","X-Gm-Gg":"AeBDiesPc9eEB+oKFP9QzB9laVRKlV07JTAfuVY2V5Ozyilhb21A/8fcNKV0t7/oE7t\n AdrZtOiPlQtAHW9SB4H3euFxtkttUlT/5qVgfn5jPZTUzXxCsrOTqqcaWOFnnPWanV/yo1Jck6b\n 3c/IiYih8FQ2TMpz1U7+wNVI6t73gtRjSUXVr8EKwK7/gGbTXvttM50bZFTJRnbhcctuTmJ+Y33\n NRN0BMMBKsc9urQZ5LztseMLWNTXJh+GMlNLc7Et56xRhvsmZtQKQ3EVnmafzkYPmZLonifb2/p\n M9jyeRPUQgfApBOUAUZT/D6yzcjbz1NHPvsx4Ga+Gvjz2bPZZESN9ikM+Ju0xl4lC+H4FGnZsml\n 3BXhyo2+uSFDLO3/8nc4tMIRka+5diXYlYBt36g1hUqe89lqTUurxVn7Lx6Rf3h722FwmumPmZj\n IqPDF/VOSpOFNVr2oNGDxxZNhEJ8eg/A457ynlSHSRvCr53dkh6Z8t","X-Received":"by 2002:a05:620a:25ca:b0:8cf:bac2:d927 with SMTP id\n af79cd13be357-8d41bfc4c66mr2758048085a.15.1775608362412;\n Tue, 07 Apr 2026 17:32:42 -0700 (PDT)","From":"AceLan Kao <acelan.kao@canonical.com>","To":"kernel-team@lists.ubuntu.com","Subject":"[SRU][R][PATCH 0/1] dma-buf filesystem flags fix","Date":"Wed,  8 Apr 2026 08:32:37 +0800","Message-ID":"<20260408003238.233653-1-acelan.kao@canonical.com>","X-Mailer":"git-send-email 2.53.0","MIME-Version":"1.0","Received-SPF":"pass client-ip=209.85.222.170; envelope-from=acelan@gmail.com;\n helo=mail-qk1-f170.google.com","X-BeenThere":"kernel-team@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Kernel team discussions <kernel-team.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/kernel-team>","List-Post":"<mailto:kernel-team@lists.ubuntu.com>","List-Help":"<mailto:kernel-team-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"kernel-team-bounces@lists.ubuntu.com","Sender":"\"kernel-team\" <kernel-team-bounces@lists.ubuntu.com>"},"content":"From: \"Chia-Lin Kao (AceLan)\" <acelan.kao@canonical.com>\n\nBugLink: https://bugs.launchpad.net/bugs/2139656\n\n[Impact]\nThe VFS layer now enforces that inodes flagged with S_ANON_INODE must be located on\nfilesystems with the SB_I_NOEXEC flag set. The dmabuf (Direct Memory Access Buffer)\nfilesystem creates inodes using alloc_anon_inode(), which sets the S_ANON_INODE flag\nbut does not set SB_I_NOEXEC and SB_I_NODEV on the filesystem.\n\nThis causes a kernel warning when a dmabuf is memory-mapped, which can occur in\nmultimedia applications such as GStreamer's v4l2src (Video4Linux source) element.\nThe warning does not cause a crash but indicates a VFS policy violation that will\neventually become a fatal error in future kernel versions.\n\nError log:\n```\n[ 60.061328] WARNING: CPU: 2 PID: 2803 at fs/exec.c:125 path_noexec+0xa0/0xd0\n...\n[ 60.061637] do_mmap+0x2b5/0x680\n```\n\nAffected scenarios: Any system running multimedia applications that use video capture\nor memory-mapped dmabuf operations, particularly with Video4Linux source elements or\nsimilar hardware-accelerated media processing.\n\n[Fix]\nSet the SB_I_NOEXEC and SB_I_NODEV flags on the dmabuf filesystem context. This follows\nthe same pattern previously applied to other anonymous inode filesystems such as\nsecretmem (commit 98f99394a104c) and the anon_inode filesystem (commit ce7419b6cf23d).\n\nThe fix is minimal - adding two flag assignments in drivers/dma-buf/dma-buf.c:\n- fc->s_iflags |= SB_I_NOEXEC;\n- fc->s_iflags |= SB_I_NODEV;\n\nThese changes align the dmabuf filesystem with the VFS enforcement introduced in\ncommit 1e7ab6f67824 (\"anon_inode: rework assertions\").\n\nUpstream patch: https://lore.kernel.org/lkml/20260114011917.241196-1-acelan.kao@canonical.com/\n\n[Test Plan]\n1. Install a system with a video capture device (USB webcam, integrated camera, or\n   Video4Linux-compatible device)\n\n2. Install GStreamer and the v4l2src plugin:\n   $ sudo apt-get install gstreamer1.0-plugins-good gstreamer1.0-plugins-base\n\n3. Run a GStreamer pipeline that uses v4l2src to capture video:\n   $ gst-launch-1.0 v4l2src ! video/x-raw, width=640, height=480, framerate=30/1 ! videoconvert ! autovideosink\n\n4. Check the kernel log for warnings:\n   $ dmesg | grep -i \"path_noexec\\|SB_I_NOEXEC\"\n\nExpected result without fix:\n- WARNING message appears in dmesg at fs/exec.c:125 (path_noexec+0xa0/0xd0)\n  indicating anonymous inode on non-compliant filesystem\n\nExpected result with fix:\n- No warning appears; video capture works correctly without VFS policy violations\n\n[Where problems could occur]\nThe dmabuf filesystem itself could be affected if the SB_I_NOEXEC or SB_I_NODEV flags\ncause unexpected behavior with the filesystem's inode operations.\n\nIf there are edge cases where the dmabuf filesystem needs to allow execution or device\naccess for specific operations, this fix could prevent those operations from working.\nSymptoms would include dmabuf allocations failing, memory mapping failing, or hardware\nacceleration features becoming unavailable.\n\nThe SB_I_NODEV flag prevents device node creation on the filesystem (which should never\noccur on a pseudo-filesystem), and SB_I_NOEXEC prevents execution (which is the correct\nbehavior for a memory buffer filesystem). These are defensive flags used by all\nsimilar anonymous inode filesystems, so the regression risk is minimal, but if there\nare hidden dependencies on the absence of these flags, dmabuf clients could fail.\n\nMonitor for:\n- Memory mapping failures in applications using dmabuf\n- Failures to create dmabuf file descriptors\n- DMA operations failing to map memory regions\n- Video capture or media acceleration features becoming unavailable\n\n[Other Info]\nThis is a backport of a fix for the upstream kernel. The patch follows the exact\napproach used in previous commits to other anonymous inode filesystems:\n- commit 98f99394a104c (\"secretmem: use SB_I_NOEXEC\")\n- commit ce7419b6cf23d (\"anon_inode: raise SB_I_NODEV and SB_I_NOEXEC\")\n\nThe warning was introduced by commit 1e7ab6f67824 (\"anon_inode: rework assertions\")\nwhich added enforcement in the VFS layer that anonymous inodes must have these flags\nset on their host filesystem.\n\nChia-Lin Kao (AceLan) (1):\n  UBUNTU: SAUCE: dma-buf: set SB_I_NOEXEC and SB_I_NODEV on dmabuf\n    filesystem\n\n drivers/dma-buf/dma-buf.c | 2 ++\n 1 file changed, 2 insertions(+)"}