Changeset dfd879fa in rtems


Ignore:
Timestamp:
Mar 16, 2017, 10:59:23 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
d50ab079
Parents:
6c988987
git-author:
Sebastian Huber <sebastian.huber@…> (03/16/17 10:59:23)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/16/17 14:33:58)
Message:

dosfs: Fix race condition msdos_dir_read()

Obtain file system instance lock before member access.

Update #2937.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/dosfs/msdos_dir.c

    r6c988987 rdfd879fa  
    8989    bool               is_first_entry;
    9090
     91    sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
     92                                MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
     93    if (sc != RTEMS_SUCCESSFUL)
     94        rtems_set_errno_and_return_minus_one(EIO);
     95
    9196    /*
    9297     * cast start and count - protect against using sizes that are not exact
     
    107112             fat_fd->fat_file_size                              :
    108113             fs_info->fat.vol.bpc;
    109 
    110     sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
    111                                 MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
    112     if (sc != RTEMS_SUCCESSFUL)
    113         rtems_set_errno_and_return_minus_one(EIO);
    114114
    115115    while (count > 0 && cmpltd >= 0)
Note: See TracChangeset for help on using the changeset viewer.