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: <aVN06OKsKxZe6-Kv@casper.infradead.org>
Date: Tue, 30 Dec 2025 06:44:56 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Zhiyu Zhang <zhiyuzhang999@...il.com>
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, Jan Kara <jack@...e.cz>,
	hirofumi@...l.parknet.co.jp, linux-fsdevel@...r.kernel.org,
	syzkaller <syzkaller@...glegroups.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [Kernel Bug] WARNING in vfat_rmdir

On Tue, Dec 30, 2025 at 02:18:17AM +0800, Zhiyu Zhang wrote:
> +++ b/fs/fat/dir.c
> @@ -92,8 +92,10 @@ static int fat__get_entry(struct inode *dir, loff_t *pos,
>         *bh = NULL;
>         iblock = *pos >> sb->s_blocksize_bits;
>         err = fat_bmap(dir, iblock, &phys, &mapped_blocks, 0, false);
> -       if (err || !phys)
> -               return -1;      /* beyond EOF or error */
> +       if (err)
> +               return err;     /* real error (e.g., -EIO, -EUCLEAN) */
> +       if (!phys)
> +               return -1;      /* beyond EOF */

Ooh, -1 is a real errno, so -1 or errno is a bad API.  I'd suggest just
returning -ENOENT directly instead of translating it in the caller.







Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ