Ticket #10998: Fix_CIDs_in_MSI_code.patch

File Fix_CIDs_in_MSI_code.patch, 1016 bytes (added by waddlesplash, 6 years ago)

Git patch.

  • src/system/kernel/arch/x86/msi.cpp

    From 661b8e2b2870e25bdee95212f97adad887779d83 Mon Sep 17 00:00:00 2001
    From: Augustin Cavalier <waddlesplash@gmail.com>
    Date: Thu, 3 Jul 2014 12:31:20 -0400
    Subject: [PATCH] CIDs 1162783 & 1162784: out-of-bounds access & write
    
     * NUM_IO_VECTORS is not 256 on x86, but rather 224 as set by NUM_IO_VECTORS in "arch_int.h".
     * Jessicah mentioned hearing about MSI crashes before, but that was a few weeks ago.
     * These were the only CIDs in the MSI code.
    ---
     src/system/kernel/arch/x86/msi.cpp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/system/kernel/arch/x86/msi.cpp b/src/system/kernel/arch/x86/msi.cpp
    index 4578e14..64dc74a 100644
    a b msi_allocate_vectors(uint8 count, uint8 *startVector, uint64 *address,  
    5757    if (result != B_OK)
    5858        return result;
    5959
    60     if (vector >= 256) {
     60    if (vector >= NUM_IO_VECTORS) {
    6161        free_io_interrupt_vectors(count, vector);
    6262        return B_NO_MEMORY;
    6363    }