lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251130073017.GS3538@ZenIV>
Date: Sun, 30 Nov 2025 07:30:17 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: syzbot <syzbot+b74150fd2ef40e716ca2@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: Forwarded: [PATCH] ipc/mqueue: fix dentry refcount imbalance in
 prepare_open()

On Sat, Nov 29, 2025 at 11:11:24PM -0800, syzbot wrote:

> 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.

That makes no sense.

> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -883,6 +883,7 @@ static int prepare_open(struct dentry *dentry, int oflag, int ro,
>  	if ((oflag & O_ACCMODE) == (O_RDWR | O_WRONLY))
>  		return -EINVAL;

... we return an error without refcount increment.

>  	acc = oflag2acc[oflag & O_ACCMODE];
> +	dget(dentry);
>  	return inode_permission(&nop_mnt_idmap, d_inode(dentry), acc);

... with possibly return an error *with* refcount increment.
How the caller is supposed to tell one from another?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ