Showing error 1761

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/ntfs/mft.c
Line in file: 2597
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by af5eb745efe97d91d2cbe793029838b3311c15da
Tools: Smatch (1.59)
Entered: 2013-09-10 20:24:52 UTC


Source:

2567                if (seq_no)
2568                        m->sequence_number = seq_no;
2569                if (usn && le16_to_cpu(usn) != 0xffff)
2570                        *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs)) = usn;
2571        }
2572        /* Set the mft record itself in use. */
2573        m->flags |= MFT_RECORD_IN_USE;
2574        if (S_ISDIR(mode))
2575                m->flags |= MFT_RECORD_IS_DIRECTORY;
2576        flush_dcache_page(page);
2577        SetPageUptodate(page);
2578        if (base_ni) {
2579                /*
2580                 * Setup the base mft record in the extent mft record.  This
2581                 * completes initialization of the allocated extent mft record
2582                 * and we can simply use it with map_extent_mft_record().
2583                 */
2584                m->base_mft_record = MK_LE_MREF(base_ni->mft_no,
2585                                base_ni->seq_no);
2586                /*
2587                 * Allocate an extent inode structure for the new mft record,
2588                 * attach it to the base inode @base_ni and map, pin, and lock
2589                 * its, i.e. the allocated, mft record.
2590                 */
2591                m = map_extent_mft_record(base_ni, bit, &ni);
2592                if (IS_ERR(m)) {
2593                        ntfs_error(vol->sb, "Failed to map allocated extent "
2594                                        "mft record 0x%llx.", (long long)bit);
2595                        err = PTR_ERR(m);
2596                        /* Set the mft record itself not in use. */
2597                        m->flags &= cpu_to_le16(
2598                                        ~le16_to_cpu(MFT_RECORD_IN_USE));
2599                        flush_dcache_page(page);
2600                        /* Make sure the mft record is written out to disk. */
2601                        mark_ntfs_record_dirty(page, ofs);
2602                        unlock_page(page);
2603                        ntfs_unmap_page(page);
2604                        goto undo_mftbmp_alloc;
2605                }
2606                /*
2607                 * Make sure the allocated mft record is written out to disk.
Show full sources