lkml.org 
[lkml]   [2016]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch V2 04/28] x86/perf/intel/uncore: Add sanity checks for pci dev package id
    The storage array is size limited, but misses a sanity check

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    ---
    arch/x86/kernel/cpu/perf_event_intel_uncore.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    Index: b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
    ===================================================================
    --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
    +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
    @@ -882,7 +882,7 @@ static int uncore_pci_probe(struct pci_d
    int phys_id, ret;

    phys_id = uncore_pcibus_to_physid(pdev->bus);
    - if (phys_id < 0)
    + if (phys_id < 0 || phys_id >= UNCORE_SOCKET_MAX)
    return -ENODEV;

    if (UNCORE_PCI_DEV_TYPE(id->driver_data) == UNCORE_EXTRA_PCI_DEV) {

    \
     
     \ /
      Last update: 2016-02-22 12:41    [W:4.201 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site