lkml.org 
[lkml]   [2012]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH] ocfs2: Fix NULL pointer dereferrence in __ocfs2_change_file_space
    Date
    Hmm... forgot to send to stable.  Is this enough?

    Cc: stable@vger.kernel.org

    Or do I need to re-send?

    Cheers,
    --
    Luis

    Luis Henriques <luis.henriques@canonical.com> writes:

    > As ocfs2_fallocate() will invoke __ocfs2_change_file_space() with a NULL
    > as the first parameter (file), it may trigger a NULL pointer dereferrence
    > due to a missing check. See http://bugs.launchpad.net/bugs/1006012.
    >
    > Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    > ---
    > fs/ocfs2/file.c | 2 +-
    > 1 file changed, 1 insertion(+), 1 deletion(-)
    >
    > diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
    > index 6e39668..84822a4 100644
    > --- a/fs/ocfs2/file.c
    > +++ b/fs/ocfs2/file.c
    > @@ -1950,7 +1950,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
    > if (ret < 0)
    > mlog_errno(ret);
    >
    > - if (file->f_flags & O_SYNC)
    > + if (file && (file->f_flags & O_SYNC))
    > handle->h_sync = 1;
    >
    > ocfs2_commit_trans(osb, handle);


    \
     
     \ /
      Last update: 2012-06-21 01:21    [W:0.022 / U:119.428 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site