lkml.org 
[lkml]   [2018]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.18 137/168] s390/qeth: dont dump past end of unknown HW header
    Date
    4.18-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Julian Wiedmann <jwi@linux.ibm.com>

    [ Upstream commit 0ac1487c4b2de383b91ecad1be561b8f7a2c15f4 ]

    For inbound data with an unsupported HW header format, only dump the
    actual HW header. We have no idea how much payload follows it, and what
    it contains. Worst case, we dump past the end of the Inbound Buffer and
    access whatever is located next in memory.

    Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/s390/net/qeth_l2_main.c | 2 +-
    drivers/s390/net/qeth_l3_main.c | 2 +-
    2 files changed, 2 insertions(+), 2 deletions(-)

    --- a/drivers/s390/net/qeth_l2_main.c
    +++ b/drivers/s390/net/qeth_l2_main.c
    @@ -425,7 +425,7 @@ static int qeth_l2_process_inbound_buffe
    default:
    dev_kfree_skb_any(skb);
    QETH_CARD_TEXT(card, 3, "inbunkno");
    - QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN);
    + QETH_DBF_HEX(CTRL, 3, hdr, sizeof(*hdr));
    continue;
    }
    work_done++;
    --- a/drivers/s390/net/qeth_l3_main.c
    +++ b/drivers/s390/net/qeth_l3_main.c
    @@ -1390,7 +1390,7 @@ static int qeth_l3_process_inbound_buffe
    default:
    dev_kfree_skb_any(skb);
    QETH_CARD_TEXT(card, 3, "inbunkno");
    - QETH_DBF_HEX(CTRL, 3, hdr, QETH_DBF_CTRL_LEN);
    + QETH_DBF_HEX(CTRL, 3, hdr, sizeof(*hdr));
    continue;
    }
    work_done++;

    \
     
     \ /
      Last update: 2018-10-08 20:55    [W:2.106 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site