public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Eric Sesterhenn <snakebyte@gmx.de>,
	linux-ntfs-dev@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [Linux-NTFS-Dev] Oops with corrupted NTFS image
Date: Mon, 07 Jul 2008 15:21:36 +0200	[thread overview]
Message-ID: <48721860.1010800@gmx.net> (raw)
In-Reply-To: <F2EEF4B5-3E11-480A-93E7-9078BDC578EA@cam.ac.uk>

On 07.07.2008 10:07, Anton Altaparmakov wrote:
> Hi,
>
> Thanks for the report.  Would you be able to try the below change to  
> your kernel and repeat?
>
> On 6 Jul 2008, at 18:21, Eric Sesterhenn wrote:
>   
>> 0xc030ad5c is in ntfs_read_locked_inode (fs/ntfs/time.h:95).
>> 90		u64 t = (u64)(sle64_to_cpu(time) - NTFS_TIME_OFFSET);
>> 91		/*
>> 92		 * Convert the time to 1-second intervals and the remainder to
>> 93		 * 1-nano-second intervals.
>> 94		 */
>> 95		ts.tv_nsec = do_div(t, 10000000) * 100;
>> 96		ts.tv_sec = t;
>> 97		return ts;
>> 98	}
>>     
>
> Please replace the ts.tv_nsec=... and ts.tv_sec=... with:
>
> 		if (t) {
> 			ts.tv_nsec = do_div(t, 10000000) * 100;
> 			ts.tv_sec = t;
> 		} else {
> 			ts.tv_nsec = 0;
> 			ts.tv_sec = 0;
> 		}
>   

AFAICS it is not the division that fails (unless a division itself can
cause an access to invalid memory), but either the write to ts or the
read from t. Dependign on compiler optimizations, the real root cause
may be related to an access to time.

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/


      parent reply	other threads:[~2008-07-07 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 17:21 Oops with corrupted NTFS image Eric Sesterhenn
2008-07-07  8:07 ` [Linux-NTFS-Dev] " Anton Altaparmakov
2008-07-07 12:24   ` Eric Sesterhenn
2008-07-07 13:03     ` Vegard Nossum
2008-07-07 13:26       ` Carl-Daniel Hailfinger
2008-07-07 13:33         ` Vegard Nossum
2008-07-07 13:21   ` Carl-Daniel Hailfinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48721860.1010800@gmx.net \
    --to=c-d.hailfinger.devel.2006@gmx.net \
    --cc=aia21@cam.ac.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntfs-dev@lists.sourceforge.net \
    --cc=snakebyte@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox