[coreboot-gerrit] Patch merged into coreboot/master: amd/amdht: Fix format security errors

gerrit at coreboot.org gerrit at coreboot.org
Thu Jan 26 12:13:50 CET 2017


the following patch was just integrated into master:
commit f6776fa62c84ae516f84c99859d826f77d508079
Author: Paul Menzel <pmenzel at molgen.mpg.de>
Date:   Fri Jan 20 14:49:35 2017 +0100

    amd/amdht: Fix format security errors
    
    Ubuntu’s default compiler flags for GCC [1][2] include `-Wformat
    -Wformat-security`, causing errors similar like the one below.
    
    ```
        CC         romstage/northbridge/amd/amdht/ht_wrapper.o
    src/northbridge/amd/amdht/ht_wrapper.c: In function 'AMD_CB_EventNotify':
    src/northbridge/amd/amdht/ht_wrapper.c:124:4: error: format not a string literal and no format arguments [-Werror=format-security]
        printk(log_level, event_class_string_decodes[evtClass]);
        ^
    […]
    ```
    
    Fix that, by explicitly using a format string.
    
    TEST=Built and booted on ASUS KGPE-D16.
    
    [1] https://stackoverflow.com/questions/17260409/fprintf-error-format-not-a-string-literal-and-no-format-arguments-werror-for
        "fprintf, error: format not a string literal and no format arguments [-Werror=format-security"
    [2] I tested with gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609.
    
    Change-Id: Iabe60deeffa441146eab31dac4416846ce95c32a
    Signed-off-by: Paul Menzel <pmenzel at molgen.mpg.de>
    Reviewed-on: https://review.coreboot.org/18208
    Tested-by: build bot (Jenkins)
    Reviewed-by: Nico Huber <nico.h at gmx.de>


See https://review.coreboot.org/18208 for details.

-gerrit



More information about the coreboot-gerrit mailing list