Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3321212imm; Sun, 30 Sep 2018 17:45:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Y90iI66KiypSP21hwmZyWdfNb233zEkP2Vg38JJqL6zrpUXEhRF9ke2Wuc6HXHmEHtkLd X-Received: by 2002:a62:32c4:: with SMTP id y187-v6mr1377464pfy.4.1538354754263; Sun, 30 Sep 2018 17:45:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538354754; cv=none; d=google.com; s=arc-20160816; b=NLMCZqT/fNx2mg5nPOhsSNI203gzJMRHnMXcJCrgE5++0dBMhO/u8G0paxW8aCJPo8 U+IwEMsOxdfFpuN00jclRCGia6vW+gadYLxC83vHF1w5tJi9F1SP6Ax8KUSBlgnr3XfS UthvpujFpRl8eTPro/2ede4AdX3AoHe0mI086Kz3QyMIXUEnsna7AOisQ5t8ypBsg/fe 4Cc/l1HtHZjH1ZlsjMMbjlfzM/FkWA+aCQX+z20x8JG1emuTs95uU6KIGEDYaboqAqBK JBcGByiwedtL5I+9s6zYu5YP5IJrGJmxQ1ZedekSUOP/5RLPlI9mgehOfIc3YyPvNyUf vXjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=8Cd+xM8DFNIybrXkwQ0/XyeF2epE4lYG8OrqQ9wJ2Ek=; b=bA9sUJVwiq0lt3SWEi/L8yIBZD8OW8Q+bWFfEsuxQtHCxsFpcFksfrf2unySgjgxik a/VfbsW2Lib20xnfDdMRogWHujR8vGuruySiLzaA3mLcZwHlqFeHV89dDFqaDvUZetfe g839dIx+0xjI2vUgYsvvkgq+qIVaqZb+ZRKkiE+ozDGc7AmvQDZy+LXWZKCU6TVDAn/p IF2jy8SQxq7Uc9LeagGQcIIFvAqNBkfs258MNVeMqoJ/X/oj+Rv3wEvPJPWsM6dDIvGn sH5Ok2b/ucKjBNTx9NL82zFyB+xEw308rBbhnUDt1xeEPG0BOpQoHHKd6lR1vSpz247E 9zTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=EKUGJjaZ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f190-v6si11671424pfc.327.2018.09.30.17.45.39; Sun, 30 Sep 2018 17:45:54 -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=@microsoft.com header.s=selector1 header.b=EKUGJjaZ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729786AbeJAHUA (ORCPT + 99 others); Mon, 1 Oct 2018 03:20:00 -0400 Received: from mail-by2nam03on0136.outbound.protection.outlook.com ([104.47.42.136]:2896 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729960AbeJAHQC (ORCPT ); Mon, 1 Oct 2018 03:16:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Cd+xM8DFNIybrXkwQ0/XyeF2epE4lYG8OrqQ9wJ2Ek=; b=EKUGJjaZjfXwVv1X6UH+cvS4F92pn7WC0HxQP7E0W4tEyzqgdIRJ7E35LyPzpJGbTjFeDLilCa+EAYPt37ziNWYhvhQaY/zc3yI2WNZLvSi6F+dqEipRKoq7jw4/kjkQT7JI3jA4rsrg0PS9yzGaXRG8AeDjRau9zY5CL1y5feI= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0165.namprd21.prod.outlook.com (10.173.192.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.5; Mon, 1 Oct 2018 00:40:42 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1228.006; Mon, 1 Oct 2018 00:40:42 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Julian Wiedmann , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 22/26] s390/qeth: don't dump past end of unknown HW header Thread-Topic: [PATCH AUTOSEL 4.9 22/26] s390/qeth: don't dump past end of unknown HW header Thread-Index: AQHUWR9iGx8EBdjP4USFveMUgs9oPw== Date: Mon, 1 Oct 2018 00:40:42 +0000 Message-ID: <20181001004026.147201-22-alexander.levin@microsoft.com> References: <20181001004026.147201-1-alexander.levin@microsoft.com> In-Reply-To: <20181001004026.147201-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY4PR21MB0165;6:sUODQppoNMbGpu4WPullwI7San1P4o19lA5mWwif5jf0qzvVTrr/xsX8yEn7Lpoj4V1CdM/s6P7y6JfSVZTz4/K94coAXcg1J6UnwbhbK2D18lJw+N2sJR6hVbitKBC6POF7ERxqBr2MpnpMiCDw7qscelGsu+E+O5Ax0mZkFvn0XiAdU2jvy8krWoJUHaTFDw8ywght2eLMvegfCTfcICuluMP7UxSDF+atM1Hc+JM/oPrEOO7e3knIY5lZdmDxB7heFXIU40Yj4ihC4Y0dGJbVpMF7DkfENm3/s4vA2Fal8t9ClCLXPPEgt0o3cy7DwF6OkZOxfT+7ypQk1OMLGj+hAB+qQM9+zY14OzqyEpXi13ZbD/pwPm+O5ob/uCkKQTWVvScxEm4k2NXv0scU0m3Y6PUpxe5PBbf+97lqACiHM5TQyi93JrU+ikg7NUTJXSii96cYF+7KSAfKCQduqg==;5:01G14pnyKWpIXiRlxPDFR3n0MOtaS2jaBqnIHbUIv/L5PM3QP4WpL3iBoDCa7eksFgR1hISCtG2DNNCIOWNTNOWnObHJtlz3ic8kE6GnrNidbYBJZzyzvmEwWzUqKASZrk2jVOUzpOUrJGMPT8E0OlON4ECIt+NR0+WZWVvLmj8=;7:XcLC6XCcFaB7XYudxFOOtDmTP7Rwqj1Bczw0us1oSHStNxDH1+6oZYdS8Gl9qzvUwTVckJk7xjy7dFHF6ET1ZgGDWYFPnCCyknVlEtCXv8RQylofgp506Eogj7lpF8618mtw8SL+zsrzuZJMd44itfn4pnO80UckFDw/AwhYmIv+U1MMKgaCA6E35R3QFujAArZ1SomNfrKsrzyZlgLDGDWKUdMRTjzV3qirzQYawHQui/Vm19h5+9eitT8tuNWM x-ms-office365-filtering-correlation-id: ecfcc9eb-2af4-484e-6e3b-08d6273684c3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7193020);SRVR:CY4PR21MB0165; x-ms-traffictypediagnostic: CY4PR21MB0165: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(104084551191319)(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(2018427008)(10201501046)(3002001)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991041);SRVR:CY4PR21MB0165;BCL:0;PCL:0;RULEID:;SRVR:CY4PR21MB0165; x-forefront-prvs: 0812095267 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(376002)(346002)(396003)(366004)(39860400002)(199004)(189003)(476003)(2616005)(256004)(217873002)(486006)(6486002)(1076002)(11346002)(446003)(86362001)(97736004)(2900100001)(3846002)(6116002)(2501003)(110136005)(478600001)(54906003)(2906002)(5250100002)(6436002)(8936002)(316002)(53936002)(14444005)(81166006)(81156014)(68736007)(5660300001)(99286004)(8676002)(10290500003)(26005)(6346003)(4326008)(86612001)(6506007)(305945005)(106356001)(7736002)(76176011)(6512007)(72206003)(102836004)(25786009)(105586002)(107886003)(186003)(14454004)(71200400001)(34290500001)(71190400001)(22452003)(36756003)(66066001)(10090500001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR21MB0165;H:CY4PR21MB0776.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: 9BCzqegnTHMoDexSqPCUUtgGYXNj6C6f5BjH5U/Yl8PFEJaq73WtMezMdwuzcraeFLF3Ny8K8Eoh1/xZtajedkbc9xhwOOCzGvnqzYiJwQ5GGCmU0V2h4xd9VVfJn6vXB+Z0TT2v/lqeRK8h6HSwHALGsqt0FrxnRe5bQPQydwDRk/EoJa2fplYoUGJKwwJ5mLjI+zBBihNP4JqVuZ5U1EveLqM5Zvu65N5GZDVPpiplG9+yKPLn/xbpIcUMy7iGqmJE5ISfl6HEciToW+51p820zlRxPQQt4FJbDBXXg5/lqXNNhqHLyVg6eJR/6JyGi3suBh+0Smoe6H6SF4tGQcKPYoSqd7tcUR1eYU+cmaE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecfcc9eb-2af4-484e-6e3b-08d6273684c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Oct 2018 00:40:42.7780 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0165 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_mai= n.c index e94e9579914e..58404e69aa4b 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -491,7 +491,7 @@ static int qeth_l2_process_inbound_buffer(struct qeth_c= ard *card, 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++; diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_mai= n.c index 4ca161bdc696..efefe075557f 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -1836,7 +1836,7 @@ static int qeth_l3_process_inbound_buffer(struct qeth= _card *card, 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++; --=20 2.17.1