lkml.org 
[lkml]   [2019]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 008/105] NFC: fdp: fix incorrect free object
    Date
    From: Pan Bian <bianpan2016@163.com>

    [ Upstream commit 517ce4e93368938b204451285e53014549804868 ]

    The address of fw_vsc_cfg is on stack. Releasing it with devm_kfree() is
    incorrect, which may result in a system crash or other security impacts.
    The expected object to free is *fw_vsc_cfg.

    Signed-off-by: Pan Bian <bianpan2016@163.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/nfc/fdp/i2c.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/nfc/fdp/i2c.c
    +++ b/drivers/nfc/fdp/i2c.c
    @@ -267,7 +267,7 @@ static void fdp_nci_i2c_read_device_prop
    *fw_vsc_cfg, len);

    if (r) {
    - devm_kfree(dev, fw_vsc_cfg);
    + devm_kfree(dev, *fw_vsc_cfg);
    goto vsc_read_err;
    }
    } else {

    \
     
     \ /
      Last update: 2019-11-11 19:37    [W:4.058 / U:0.436 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site