Re: [PATCH] NTFS comment expanded, small fix.

From: Anton Altaparmakov (aia21@cus.cam.ac.uk)
Date: Sun Apr 15 2001 - 12:11:08 EST


Linus, Alan,

Please do not apply this patch as both the comment and the code are wrong
and unnecessary, respectively.

Can the numerous ntfs fixes in the -ac series be applied to the mainstream
kernel instead? Thanks.

Rogier and everyone doing any NTFS work, please use -ac series kernels as
ntfs has had major updates which are now proven to be a Good Thing
(TM)... - I get bug reports for mainstream kernel ntfs several times a
month while I haven't received a single one for the -ac series (perhaps
due to smaller userbase admittedly, but all bugs reported are fixed in the
-ac patches).

Also, if you need info about ntfs read the ntfs docs at:
        http://linux-ntfs.sourceforge.net/ntfs

For example the fixups are explained at:
        http://linux-ntfs.sourceforge.net/ntfs/concepts/fixup.html

And if the docs don't suffice (they are work in progress), look at the
linux-ntfs project source code. Especially at the doc directory and the
include directory (and sometimes the libntfs directory). Either the header
files or the library files contain extensive documentation about the
meaning of each and every field in the ntfs structures. For example, the
fixup mechanism is described in:
        linux-ntfs/include/layout.h, lines 84 to 110.
You can find the most current code in CVS on sourceforge. The project page
is:
        http://sourceforge.net/projects/linux-ntfs/

You can browse the cvs cvs on the web or download the lot. (don't use the
now out of date packaged linux-ntfs-0.0.1 distribution as it is out of
date...)

At 13:53 15/04/2001, Rogier Wolff wrote:
>I am studying an NTFS problem, and came across the NTFS fixup mechanism.

Care to elaborate? - We could save you some time perhaps...

>It took me much too long to understand the fixup mechanism, even though
a comment tried to explain it. So I rewrote the comment.

If you read what I referenced above you will want to revise your own
comment....

>Also, the "start" value that is read from the record, could be much
larger than expected, which could lead to accessing random data. The
fixup should fail then, and this is also patched below.

No it can't (in theory). The volume would be corrupt if it was. That kind
of check belongs in ntfs fsck utility but not in kernel code.

In any case, the correct check, if you want one, would be:

if (start + (count * 2) > size)
        return 0;

And it has to happen before the:

count--;

Hope this helps,

Best regards,

        Anton

-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS maintainer / WWW: http://sourceforge.net/projects/linux-ntfs/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/

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



This archive was generated by hypermail 2b29 : Sun Apr 15 2001 - 21:00:24 EST