Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5541896ybf; Thu, 5 Mar 2020 02:34:08 -0800 (PST) X-Google-Smtp-Source: ADFU+vtWHM2Ou6f2IDAfsRR07K4DDW9vLN3LxEEPzL8RznnZLLRhPZDP/3bcpsHCVxCV7iaKQHSc X-Received: by 2002:a9d:4b10:: with SMTP id q16mr6192355otf.72.1583404448067; Thu, 05 Mar 2020 02:34:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583404448; cv=none; d=google.com; s=arc-20160816; b=nLRo8b1SMgNrv5+0asCqHKguSg9qO7U32Q3DU0ZswaF++GQ4CbJtmweAfKB/pyDtYV d6oIvsHRxxaPjKVcqJ0dLKBDdZO/Dx+SngozMVCYQ+MHo2D/lp1G/3D8pwwYKOaqZrJd 74uPqfmE1JkTS1wB/QALS47ImvLAbMOhb3KaasBlA/8Wre6ul4bSKJsaNf1kHnQbrVNp QT1ShmoSopNzqeVOiQZmWPct8RpRZSb9L6B0zOHdMQ8nb1JnuU3rOc4HUadF1HnGlOzS 2B5h2K1RFFIlZBgvRW3/rKUUsEPfoSXfuL0FPCgzOMuhL1b7O6UmCIhmUsYu0bq/XsFD /iew== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lAG5oOfZYa0ZZc4Uadd+FIbLaL5zY+h9aowSlE+qW80=; b=JKTytvAQMXQFVoIPR3aUyLMT3gp6iLqkcbPbqG2hlsvtKC+545rsGy+dlmjMDSC7Tq DKyO0OI7V1j/7b35gLqmPvQbgKa8NH5zzdCqFLtH9hOYDYp+c2RE9+TjnZjMz1x3ratv 2NYAIi6GBsic2liiaedfFVyE2hJzUbmCy8ofsFip5MNsvjhfAHkn8bJ0kCO8P/DTaosP rSWOc/mUfztZUGkmB09v+VRyCjDxrtKVAuZj2I0yN9Y/6cLU1LvEditicpqHWs4QnydX 3eGW4a8rJOsr0Sj+topzgFsZL/YEN1jbLxMRCRzeB6fw9Vvx9/wIHaXbDjK0F9sWjn+/ /lFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=I6t8BP1I; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 j80si3059310oib.144.2020.03.05.02.33.53; Thu, 05 Mar 2020 02:34:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=I6t8BP1I; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725912AbgCEKds (ORCPT + 99 others); Thu, 5 Mar 2020 05:33:48 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.221]:30904 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbgCEKds (ORCPT ); Thu, 5 Mar 2020 05:33:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1583404423; s=strato-dkim-0002; d=chronox.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=lAG5oOfZYa0ZZc4Uadd+FIbLaL5zY+h9aowSlE+qW80=; b=I6t8BP1IPJ3h9bCv7LpRYMsWcdlrGwdeQ0+FB1a/YD0i1Ntw4idL1lr4HDQrQViawh WuWwFztUCYKkZlWAhi+UCa8HYJHkIMvVoJQS2Yo7KMBVpT/wxSaywaAOqY7Qbo67Jlv+ JsXhnH6p3b0EMjQwchGC8P1Ls7WSb0p5Fh7e7i9EGeoXyoldH8W6g9mQo+20Cma++Gme AT+t8Ad6T3uyh4gutgLJ2fc+9E76sSwSNm/Ib/88Kpi7R5oRWlOfF00cPRHFvra/Sgis 2UEN1FkLkwOT0TVKSDGv5RlSOchcSg7N7Chb5SKR46wN1C6G59ijRCxWxcjtg//qFc6+ jaoQ== X-RZG-AUTH: ":P2ERcEykfu11Y98lp/T7+hdri+uKZK8TKWEqNyiHySGSa9k9xmwdNnzHHXDaJfScGJUh" X-RZG-CLASS-ID: mo00 Received: from tauon.chronox.de by smtp.strato.de (RZmta 46.2.0 DYNA|AUTH) with ESMTPSA id Q01030w25AXfWvr (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 5 Mar 2020 11:33:41 +0100 (CET) From: Stephan Mueller To: Andrei Botila Cc: Herbert Xu , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] crypto: xts - add check for input length equal to zero Date: Thu, 05 Mar 2020 11:33:40 +0100 Message-ID: <4145904.A5P2xsN9yQ@tauon.chronox.de> In-Reply-To: <20200305102255.12548-1-andrei.botila@oss.nxp.com> References: <20200305102255.12548-1-andrei.botila@oss.nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Am Donnerstag, 5. M=E4rz 2020, 11:22:55 CET schrieb Andrei Botila: Hi Andrei, > From: Andrei Botila >=20 > Through this RFC we try to standardize the way input lengths equal to 0 > are handled in all skcipher algorithms. Currently, in xts when an input > has a length smaller than XTS_BLOCK_SIZE it returns -EINVAL while the > other algorithms return 0 for input lengths equal to zero. > The algorithms that implement this check are CBC, ARC4, CFB, OFB, SALSA20, > CTR, ECB and PCBC, XTS being the outlier here. All of them call > skcipher_walk_virt() which returns 0 if skcipher_walk_skcipher() finds > that input length is equal to 0. > This case was discovered when fuzz testing was enabled since it generates > this input length. > This RFC wants to find out if the approach is ok before updating the > other xts implementations. It may be a good idea to consolidate that. However, changing only one=20 implementation is not good. All XTS implementations would need to be converted then. Ciao Stephan