Showing error 1879

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: fs/xfs/xfs_log.c
Line in file: 3433
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

3403 *        A. Valid client identifier
3404 *        B. tid ptr value falls in valid ptr space (user space code)
3405 *        C. Length in log record header is correct according to the
3406 *                individual operation headers within record.
3407 * 5. When a bwrite will occur within 5 blocks of the front of the physical
3408 *        log, check the preceding blocks of the physical log to make sure all
3409 *        the cycle numbers agree with the current cycle number.
3410 */
3411STATIC void
3412xlog_verify_iclog(xlog_t         *log,
3413                  xlog_in_core_t *iclog,
3414                  int                 count,
3415                  boolean_t         syncing)
3416{
3417        xlog_op_header_t        *ophead;
3418        xlog_in_core_t                *icptr;
3419        xlog_in_core_2_t        *xhdr;
3420        xfs_caddr_t                ptr;
3421        xfs_caddr_t                base_ptr;
3422        __psint_t                field_offset;
3423        __uint8_t                clientid;
3424        int                        len, i, j, k, op_len;
3425        int                        idx;
3426
3427        /* check validity of iclog pointers */
3428        spin_lock(&log->l_icloglock);
3429        icptr = log->l_iclog;
3430        for (i=0; i < log->l_iclog_bufs; i++) {
3431                if (icptr == NULL)
3432                        xlog_panic("xlog_verify_iclog: invalid ptr");
3433                icptr = icptr->ic_next;
3434        }
3435        if (icptr != log->l_iclog)
3436                xlog_panic("xlog_verify_iclog: corrupt iclog ring");
3437        spin_unlock(&log->l_icloglock);
3438
3439        /* check log magic numbers */
3440        if (be32_to_cpu(iclog->ic_header.h_magicno) != XLOG_HEADER_MAGIC_NUM)
3441                xlog_panic("xlog_verify_iclog: invalid magic num");
3442
3443        ptr = (xfs_caddr_t) &iclog->ic_header;
Show full sources