From nobody Mon Dec 1 22:06:14 2025 Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 262A18635D for ; Sun, 30 Nov 2025 07:11:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764486686; cv=none; b=CZSVybyJr6MgluQ0hmP8FYUtTmKQTPOgZz6mqatQ1+lt3ZYkCnT68JZ7YPA6j72Gi3uSgOyPsWexzLaKxcIrTol07+ce81FECj+MvsqQ0vT3gW+EomiuFzoHw4xDGJIJXgpzAZbvTi4cgNTjVn+6WBz7blcXiRfD/3FfbwQH51E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764486686; c=relaxed/simple; bh=YtrTRPrCQ9ZZM0mf+U7ec6MwweMlUXt4bRJJqbuJepA=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=SMwsEszm1y8lvFikyOk3cZTr2Ft1oeiuLBlpUQB//Cv0g5GU/vs43Zn32+HvSE7C5cfE832B8qCnYeOnn3mnGMldpFNumvdJEcTuYfkz1/7noFu13uRibzfZw0y8QKSttW1/itir/ggGKHUn8LpTaR60ijdijlMhVH4/j1Z5MHQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-il1-f198.google.com with SMTP id e9e14a558f8ab-43322fcfae7so25767965ab.1 for ; Sat, 29 Nov 2025 23:11:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764486684; x=1765091484; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bnuip0oijucKWGSxGcbmATsl66NIuXzaQ49YL1yxPO4=; b=OCQAXqrGTc1aPXgIQ1W11EHUHOcGL1ONFchn5ZIdKKlg8YP4JAQu9g2V2OOmy/H2v9 R4YImk3wTf+hmrXOQepoIDMDJmhM4tUUGQs6l9dXnFqvekGjbRpg2UsubaWbN3PoNuA3 Cd/EbtByIKqpnBdU+uJ6u2M32jT2Eiv269yqPT7mUjamcKM7sMIlFcfizCuI1+e84/mj IYbzWJYDFffPhVYQO3t9jLo2921vOtTDRi8/6w1aVwloq9gWIwYl3DwGU/tgB3kFUWVI CD3Hd7qLLfCvkV3kbufUF/RaSqApRCHVfjWfIIK5V/aenkPfIRFk4TKEfqt+O+2gcUzq /8JA== X-Gm-Message-State: AOJu0YyEx0oAW/suTAI9ADXR4jQ+E4ZQDgboMV162EPtOk4EghL8UxIC GbHkkPjzLkQRQQcOJC9i1r1G8ShvtfPNmo9H2Q5jcHzEefat5jKIrjPv/v/Uxev73KzxmOE10dN KYp/anN09h6Dz6OYjSqbzXx/5opYq4xTQPeRq3SaGAX2Y29kxzZ96AB5PIRw= X-Google-Smtp-Source: AGHT+IG60oMuRNRl9IA/1a4dVkKVAwIqyFoLIrEd/zOQaFA2pxm9Ilwe5YHwSW0pQckFpuYXs7T0MCDCX0hOaNO3FSiB4D9Nsdq+ Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:1feb:b0:433:29c3:c4f6 with SMTP id e9e14a558f8ab-435dd08b782mr162515195ab.15.1764486684083; Sat, 29 Nov 2025 23:11:24 -0800 (PST) Date: Sat, 29 Nov 2025 23:11:24 -0800 In-Reply-To: <692aef93.a70a0220.d98e3.015b.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <692bee1c.a70a0220.d98e3.0167.GAE@google.com> Subject: Forwarded: [PATCH] ipc/mqueue: fix dentry refcount imbalance in prepare_open() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] ipc/mqueue: fix dentry refcount imbalance in prepare_open() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi= t master When opening an existing message queue, prepare_open() does not increment the dentry refcount, but end_creating() always calls dput(). This causes a refcount imbalance that triggers a WARN_ON_ONCE in fast_dput() when the file is later closed. The creation path via vfs_mkobj() correctly increments the refcount, but the "already exists" path was missing the corresponding dget(). Add the missing dget() call when opening an existing queue to balance the dput() in end_creating(). Reported-by: syzbot+b74150fd2ef40e716ca2@syzkaller.appspot.com Closes: https://syzkaller.appspot.com/bug?extid=3Db74150fd2ef40e716ca2 Signed-off-by: Deepanshu Kartikey --- ipc/mqueue.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 328bcc3ee3ad..63ff2c322549 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -883,6 +883,7 @@ static int prepare_open(struct dentry *dentry, int ofla= g, int ro, if ((oflag & O_ACCMODE) =3D=3D (O_RDWR | O_WRONLY)) return -EINVAL; acc =3D oflag2acc[oflag & O_ACCMODE]; + dget(dentry); return inode_permission(&nop_mnt_idmap, d_inode(dentry), acc); } =20 --=20 2.43.0