Bug 48871 - drivers/scsi/lpfc/lpfc_init.c: 2 * Buffer is accessed out of bounds
Summary: drivers/scsi/lpfc/lpfc_init.c: 2 * Buffer is accessed out of bounds
Status: RESOLVED CODE_FIX
Alias: None
Product: SCSI Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: scsi_drivers-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-15 21:00 UTC by David Binderman
Modified: 2012-12-22 09:18 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.7-rc1
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Binderman 2012-10-15 21:00:31 UTC
I just ran the static analyser cppcheck over the source code of the
linux kernel version 3.7-rc1

It said

[linux-3.7-rc1/drivers/scsi/lpfc/lpfc_init.c:3908]: (error) Buffer is accessed out of bounds.
[linux-3.7-rc1/drivers/scsi/lpfc/lpfc_init.c:3913]: (error) Buffer is accessed out of bounds.

The source code is
    case LPFC_SLI_EVENT_STATUS_NOT_PRESENT:
        sprintf(message, "Optics faulted/incorrectly installed/not " \
                "installed - Reseat optics, if issue not "
                "resolved, replace.");
        break;
    case LPFC_SLI_EVENT_STATUS_WRONG_TYPE:
        sprintf(message,
            "Optics of two types installed - Remove one optic or " \
            "install matching pair of optics.");
        break;

but

    char message[80];

Suggest increase size of message.
Comment 1 James Smart 2012-10-31 19:02:13 UTC
Thank You.

This problem has been addressed by patch5 of our 8.3.36 patch kit: See  
http://marc.info/?l=linux-scsi&m=135170915426118&w=2

-- james s


On 10/17/2012 6:26 AM, bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=48871
>
>
> Alan <alan@lxorguk.ukuu.org.uk> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |alan@lxorguk.ukuu.org.uk
>            Component|Other                       |Other
>           AssignedTo|drivers_other@kernel-bugs.o |scsi_drivers-other@kernel-b
>                     |sdl.org                     |ugs.osdl.org
>              Product|Drivers                     |SCSI Drivers
>
>
>
>
Comment 2 Florian Mickler 2012-12-22 09:18:56 UTC
A patch referencing this bug report has been merged in Linux v3.8-rc1:

commit 8c1312e1b9dae446af17d5a5f11c325cbb4c9103
Author: James Smart <james.smart@emulex.com>
Date:   Wed Oct 31 14:45:09 2012 -0400

    [SCSI] lpfc 8.3.36: Correct buffer length overrun

Note You need to log in before you can comment on or make changes to this bug.