Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933786AbdGKQRL (ORCPT ); Tue, 11 Jul 2017 12:17:11 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:7293 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932731AbdGKQRJ (ORCPT ); Tue, 11 Jul 2017 12:17:09 -0400 X-IronPort-AV: E=Sophos;i="5.40,347,1496073600"; d="scan'208";a="32404865" From: Bart Van Assche To: Bart Van Assche , "nab@linux-iscsi.org" CC: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mchristi@redhat.com" , "roland@purestorage.com" , "target-devel@vger.kernel.org" , "martin.petersen@oracle.com" , "hare@suse.de" Subject: Re: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length Thread-Topic: [PATCH] iscsi-target: Reject immediate data underflow larger than SCSI transfer length Thread-Index: AQHS4A5DNXdpZ4WaCUuW3rpeuY6x8KIbGi6AgAEAVwCAMlJUgIAAlU4A Date: Tue, 11 Jul 2017 16:17:05 +0000 Message-ID: <1499789824.2586.16.camel@wdc.com> References: <1496895685-18464-1-git-send-email-nab@linux-iscsi.org> <1496936253.3028.1.camel@wdc.com> <1496991302.28997.66.camel@haakon3.risingtidesystems.com> <1499757761.28145.45.camel@haakon3.daterainc.com> In-Reply-To: <1499757761.28145.45.camel@haakon3.daterainc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: wdc.com; dkim=none (message not signed) header.d=none;wdc.com; dmarc=none action=none header.from=wdc.com; x-originating-ip: [63.163.107.100] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;CY1PR0401MB1534;20:OhAWZ71wqjEPKvWSk2RIeZWLSzlh+rcqo/oY8OLj7KBzkWKR4FX0soBnpruI0LRC7Yy4zocZpwbDoVvLXxtjEDSsBUec6RAmp4iWukUWVv7lZ/3XU1MjzBPHqRlwRMGcy6UmkZRIx96HHLEXOwTVsdgrBMDxusYQczWURKHT/Uo= x-ms-office365-filtering-correlation-id: 932344b1-7c9d-4f23-8700-08d4c8784586 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY1PR0401MB1534; x-ms-traffictypediagnostic: CY1PR0401MB1534: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(236129657087228); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY1PR0401MB1534;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY1PR0401MB1534; x-forefront-prvs: 0365C0E14B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39400400002)(39860400002)(39450400003)(39840400002)(39410400002)(39850400002)(24454002)(377424004)(6512007)(99286003)(2950100002)(54906002)(4326008)(53936002)(54356999)(50986999)(6436002)(6506006)(76176999)(93886004)(229853002)(102836003)(77096006)(6486002)(217423001)(36756003)(6306002)(2906002)(6116002)(2900100001)(6246003)(86362001)(38730400002)(189998001)(25786009)(7736002)(966005)(3846002)(305945005)(8936002)(5660300001)(103116003)(14454004)(33646002)(2501003)(66066001)(72206003)(8676002)(3660700001)(478600001)(3280700002)(81166006)(14773001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0401MB1534;H:CY1PR0401MB1536.namprd04.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jul 2017 16:17:05.2595 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0401MB1534 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6BGHHoN020947 Content-Length: 689 Lines: 15 On Tue, 2017-07-11 at 00:22 -0700, Nicholas A. Bellinger wrote: > So rejecting this case as already done in commit abb85a9b51 is the > correct approach for >= v4.3.y. Hello Nic, I hope that you agree that the current target_cmd_size_check() implementation is complicated and ugly. Patch 30/33 of the patch series I referred to in my e-mail removes a significant number of lines of code from that function. So my patch series not only makes target_cmd_size_check() easier to maintain and to verify but it makes that function also faster. Hence please reconsider the approach from my patch series. For patch 30/33, see also https://www.spinics.net/lists/target-devel/msg15384.html. Bart.