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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mx06vq3w.fsf@openvz.org>
Date:	Mon, 01 Oct 2012 07:16:35 +0400
From:	Dmitry Monakhov <dmonakhov@...nvz.org>
To:	Fengguang Wu <fengguang.wu@...el.com>
Cc:	kernel-janitors@...r.kernel.org, Theodore Ts'o <tytso@....edu>,
	linux-ext4@...r.kernel.org
Subject: Re: [ext4:dev 47/50] fs/ext4/extents.c:4949 ext4_ext_punch_hole() warn: inconsistent returns mutex:&inode->i_mutex: locked (4813,4815) unlocked (4806,4949)

On Mon, 1 Oct 2012 10:50:47 +0800, Fengguang Wu <fengguang.wu@...el.com> wrote:
> Hi Dmitry,
> 
> FYI, there are new smatch warnings show up in
> 
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev
> head:   07043757c1a4018a04aded14deb1f28269a4b2ad
> commit: c6a59106b4106d13dc824a388c5572ddd65a0779 [47/50] ext4: punch_hole should wait for DIO writers
> 
>   arch/x86/include/asm/jump_label.h:25 arch_static_branch() info: ignoring unreachable code.
> + fs/ext4/extents.c:4949 ext4_ext_punch_hole() warn: inconsistent returns mutex:&inode->i_mutex: locked (4813,4815) unlocked (4806,4949)
Yes, that is correct, my bad. Sorry, patch attached
BTW  What tool(compile option) you use to catch this issue?

> 
> vim +4949 fs/ext4/extents.c
> 
> c6a59106 (Dmitry Monakhov   2012-09-29  4808) 
> c6a59106 (Dmitry Monakhov   2012-09-29  4809) 	mutex_lock(&inode->i_mutex);
> c6a59106 (Dmitry Monakhov   2012-09-29  4810) 	/* Need recheck file flags under mutex */
> c6a59106 (Dmitry Monakhov   2012-09-29  4811) 	/* It's not possible punch hole on append only file */
> c6a59106 (Dmitry Monakhov   2012-09-29  4812) 	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
> c6a59106 (Dmitry Monakhov   2012-09-29  4813) 		return -EPERM;
                                                               ^^^^^^^^^^^^^^^^
> c6a59106 (Dmitry Monakhov   2012-09-29  4814) 	if (IS_SWAPFILE(inode))
> c6a59106 (Dmitry Monakhov   2012-09-29  4815) 		return -ETXTBSY;
                                                               ^^^^^^^^^^^^^^^^^^
> c6a59106 (Dmitry Monakhov   2012-09-29  4816) 
> 2be4751b (Allison Henderson 2011-09-03  4817) 	/* No need to punch hole beyond i_size */
> 2be4751b (Allison Henderson 2011-09-03  4818) 	if (offset >= inode->i_size)
> c6a59106 (Dmitry Monakhov   2012-09-29  4819) 		goto out_mutex;
> 2be4751b (Allison Henderson 2011-09-03  4820) 

View attachment "0001-ext4-ext4_ext_punch_hole-put-i_mutex-on-error.patch" of type "text/x-patch" (1167 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ