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: <3BFCE55A-F7E2-4A19-8FD9-F23AF2A29D76@cam.ac.uk>
Date:	Tue, 30 Oct 2007 09:23:06 +0000
From:	Anton Altaparmakov <aia21@....ac.uk>
To:	Mike Galbraith <efault@....de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	linux-ntfs-dev@...ts.sourceforge.net, Neil Brown <neilb@...e.de>
Subject: Re: [Linux-NTFS-Dev] 2.6.23 regression: second access of empty ntfs file leads to D	state hang

Hi,

On 30 Oct 2007, at 08:00, Mike Galbraith wrote:
> On Mon, 2007-10-29 at 16:18 +0100, Mike Galbraith wrote:
>> On Mon, 2007-10-29 at 15:43 +0100, Mike Galbraith wrote:
>>> On Mon, 2007-10-29 at 13:39 +0000, Anton Altaparmakov wrote:
>>>> Hi Mike,
>>>>
>>>> Thanks for the files.  That is really odd.  And you are sure this  
>>>> just
>>>> works with 2.6.22.10 on the exact same file?  Have you run   
>>>> "chkdsk /
>>>> f /v /x" on the NTFS volume from Windows?
>>>
>>> Yes, 2.6.22.10 can md5sum that file just fine, did it several  
>>> times.  I
>>> haven't run chkdsk.
>>
>> I now have fun chkdsk, it didn't gripe, and the error is still  
>> present.
>
> Not being very good at walking away from unsolved mysteries, I  
> chased it
> down.  The problem is that...
> 	commit[a32ea1e1f925399e0d81ca3f7394a44a6dafa12c] Fix read/truncate  
> race
> ...calls ntfs_readpage() for a zero i_size inode, which it isn't
> accustomed to.

Great, thanks for doing that!

> Below is the hammer which made my box a happy camper again.

Yes that will fix it but the complete solution is more involved as  
there are three related bugs which explain why you were getting the  
hangs after the error...  I will make a patch for all of these in the  
next few days...

Best regards,

	Anton

> diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c
> index 6e5c253..ddab5a3 100644
> --- a/fs/ntfs/aops.c
> +++ b/fs/ntfs/aops.c
> @@ -401,7 +401,7 @@ static int ntfs_readpage(struct file *file,  
> struct page *page)
> 	MFT_RECORD *mrec;
> 	unsigned long flags;
> 	u32 attr_len;
> -	int err = 0;
> +	int err = 0, once = 0;
>
> retry_readpage:
> 	BUG_ON(!PageLocked(page));
> @@ -414,6 +414,18 @@ retry_readpage:
> 		return 0;
> 	}
> 	vi = page->mapping->host;
> +	/*
> +	 * If we've been called to read a zero sized inode, zero and bail.
> +	 */
> +	if (!once) {
> +		loff_t i_size = i_size_read(vi);
> +
> +		once++;
> +		if (!i_size) {
> +			zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
> +			goto done;
> +		}
> +	}
> 	ni = NTFS_I(vi);
> 	/*
> 	 * Only $DATA attributes can be encrypted and only unnamed $DATA


-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ