lkml.org 
[lkml]   [2011]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2] hda_hwdep: Fix possible buffer overflow
    Date
    If a line in the firmware file is larger than the given buffer size (and
    so the firmware file size), size is set to a value larger than the actual
    buffer size. This results in an overflow in the buffer passed.

    Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
    ---
    Changes in v2:
    * Just remove the erroneous check

    sound/pci/hda/hda_hwdep.c | 2 --
    1 files changed, 0 insertions(+), 2 deletions(-)

    diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
    index 72e5885..7e7d078 100644
    --- a/sound/pci/hda/hda_hwdep.c
    +++ b/sound/pci/hda/hda_hwdep.c
    @@ -756,8 +756,6 @@ static int get_line_from_fw(char *buf, int size, struct firmware *fw)
    }
    if (!fw->size)
    return 0;
    - if (size < fw->size)
    - size = fw->size;

    for (len = 0; len < fw->size; len++) {
    if (!*p)
    --
    1.7.3.4


    \
     
     \ /
      Last update: 2011-11-01 09:43    [W:0.019 / U:0.040 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site