Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3933212imm; Mon, 8 Oct 2018 11:55:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV61ex242ns8YB+EOcgItQMRfeAX0YFJ3suMsFDw5tC+f3hCKgF35/FAZFbV84cEP6xKHzUeS X-Received: by 2002:a17:902:b198:: with SMTP id s24-v6mr24200244plr.70.1539024933357; Mon, 08 Oct 2018 11:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024933; cv=none; d=google.com; s=arc-20160816; b=q9nVz7F0PmrVQ+aPxhNQPDg/saFQ1Zo9o9teqAg3IM6CTVWr+1kkBB1L25/3+cHShP hf5NvlY7CuZfSeGFxvSmobtzjwAhjdCV2/HPzu9/MfzBTDK2QRWx66YCVWpHYmzKgyg7 8rwWRbZvk2G0BaMbY65Jzq2P1zBNzXDz2I7/2yfx+qVEzdS5ttuvQVg0gCC2reWBTjVD KVP82gmUckVBtiCWccu6tYVo2sUqYMsGzn/d85rSNpPrFIB6y7PSiA91VJUy+GFW7Qwg NFhr1pp7Yn1yVFVj8ztvCInnyZOhAR17nJLdoRtYZapXWgKepPQ3Ehz/49HZeUBdER6C uEYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KOzGJf6lX6XhyfvW1m6Wzs5KByXaJXmBrzQuHO/dLsg=; b=u2TcPOjasgA39I57hoTnrmqQk/tG5UZsmtZmhCVt123BNR1nQn6yAbOZ6EPouj9z8i khlusYH0kyeqxEfwdRwyrzwOmQ/LEOFfw/PDUf+i65jxR62Tmglrk4P4Q7csKrYZD5JS g0OiL2DzFxevXdK8u6mWLV3l2RUM8arFxLAqFYZjswgGIDbSy5J+WALZ/wsxasl4z2eO 13DayPbNLW4RHYOvz0mTl4zBvWF/t+/0GrWvV1wJ+Pi1RQvBRWa5Tbflk0FwEHEXN/uW oajTL02W7aODSrpVoNXxfkWmP3YURG5L49U01UTtpmoVi73VDZon4joL6Buo91ZIAetX AtDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xtqsO1qK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f62-v6si20584014pfb.218.2018.10.08.11.55.18; Mon, 08 Oct 2018 11:55:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xtqsO1qK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732860AbeJICHI (ORCPT + 99 others); Mon, 8 Oct 2018 22:07:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:57606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727670AbeJICHI (ORCPT ); Mon, 8 Oct 2018 22:07:08 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E5D2A204FD; Mon, 8 Oct 2018 18:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024840; bh=UC33/sQiYaV9AYdu0YgPgc+f0tj5WjweKj6i1RKLjNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xtqsO1qKxhdE8cWGKwbvbv14eLOXEn6EEfJVTjCk9Z1A7lWV81yR+wMX9ZOvVFMBd xsaKyp5IJNXHBG9XBWYaOOJnCF1gCkT8rO5IFXtfclDq4YiAnm3Lxr8pagOXzdoMA7 Gkqna5hLh+vJ4vA+deF18x6cihrE5zqaCtElwuWA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 137/168] s390/qeth: dont dump past end of unknown HW header Date: Mon, 8 Oct 2018 20:31:57 +0200 Message-Id: <20181008175625.248817759@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julian Wiedmann [ 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- 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++;