Skip to contentSkip to conversation

scsi/bfa/bfad.c:1037: possible off by one in strncpy ?

Bug 49461 [email protected] 1 participant 3 messages Oct 25, 2012 – Nov 19, 2013 1 message not in the archive SCSI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=49461

Alan <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

                 CC|                            |[email protected]
          Component|Other                       |SCSI
         AssignedTo|[email protected] |[email protected]
                   |sdl.org                     |
            Product|Drivers                     |IO/Storage
Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#2 lore raw
In reply to a message not in the archive

https://bugzilla.kernel.org/show_bug.cgi?id=49461

Jeff Zhou <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #1 from Jeff Zhou <[email protected]> --- In 3.10.9, it is correct:
scsi/bfa/bfad.c : 1036

    strncpy(driver_info.os_device_name, bfad->pci_name,
        sizeof(driver_info.os_device_name) - 1);

scsi/bfa/bfad.c : 1014
struct bfa_fcs_driver_info_s driver_info;

scsi/bfa/bfa_fcs.h : 672
struct bfa_fcs_driver_info_s {

    u8     version[BFA_VERSION_LEN];        /* Driver Version */
    u8     host_machine_name[BFA_FCS_OS_STR_LEN];
    u8     host_os_name[BFA_FCS_OS_STR_LEN]; /* OS name and version */
    u8     host_os_patch[BFA_FCS_OS_STR_LEN]; /* patch or service pack */
    u8     os_device_name[BFA_FCS_OS_STR_LEN]; /* Driver Device Name */

};

The copy length here is (BFA_FCS_OS_STR_LEN - 1), which should be.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.