From patchwork Fri Aug 23 22:08:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Kuehl X-Patchwork-Id: 1152454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46FbBw6jqQz9sMr; Sat, 24 Aug 2019 08:08:40 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1i1HjY-0003j0-QW; Fri, 23 Aug 2019 22:08:36 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1i1HjU-0003ho-Lb for kernel-team@lists.ubuntu.com; Fri, 23 Aug 2019 22:08:32 +0000 Received: from mail-pl1-f198.google.com ([209.85.214.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1i1HjU-0000Xx-67 for kernel-team@lists.ubuntu.com; Fri, 23 Aug 2019 22:08:32 +0000 Received: by mail-pl1-f198.google.com with SMTP id c14so6605619plo.12 for ; Fri, 23 Aug 2019 15:08:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yDH8EmHllhEySCJxlNdmu/9xwzRyU+Cv6MYoSp3SPDM=; b=o24twVxdtygVQXmemuPf2YBX3F644lv1hyNp4/jm2mMaVVWpTo5AiBbBPsO9Roh8cf UuHDozrVohQau39DdFsR8nHwGXU70jpezGYJx6ulBTu4NTthc4vLLvEKK9eGMZsKT5y/ DfNyz/mOtofWF4RLMOvJdvJLxmt35dbgcHQ89zaxkf1wC+Sk1wfnCpXdrnVabZluo6sB 8VkJM3gIZeuGQNYUCQB1cpKM/U7vOCWwvV4Ri1jIt2e9GZuGE5XfdVyAxetWqjqAKC0i J6l8DTWsIVHdb/B6SlUTBeL9VJc1v86QJ1WuvE3dJo2ypdHbQ1huqgMdS/nHxkYa1eoq D2eA== X-Gm-Message-State: APjAAAWXqPKo/T50dMYiA2vx9CLq3HhsB5gfGqzK9HpKJMHV56TlmxtB Nml7No0zU1P1B+jpytTUL8fwbSPaExvdQCnk7M+p5NFem7Fgxnz2A1z38f2zVBhX+GwZXIMk9cZ INj/YnH2MtGv4LB37LWQON51F54YcY1WxCe3AttDLDA== X-Received: by 2002:a17:902:3:: with SMTP id 3mr7437310pla.41.1566598110612; Fri, 23 Aug 2019 15:08:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0CyY6TLm2u7Mruwu+EmFTOLu+9oqIdbIG55mvYe7ZCGKqbBwnefrUIbR5ELtOkYVKYAIQJA== X-Received: by 2002:a17:902:3:: with SMTP id 3mr7437299pla.41.1566598110497; Fri, 23 Aug 2019 15:08:30 -0700 (PDT) Received: from localhost.localdomain (c-71-63-131-226.hsd1.or.comcast.net. [71.63.131.226]) by smtp.gmail.com with ESMTPSA id e10sm4534090pfj.151.2019.08.23.15.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2019 15:08:29 -0700 (PDT) From: Connor Kuehl To: kernel-team@lists.ubuntu.com Subject: [Bionic][SRU][PATCH 2/4] crypto: cfb - fix decryption Date: Fri, 23 Aug 2019 15:08:23 -0700 Message-Id: <20190823220825.25608-3-connor.kuehl@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190823220825.25608-1-connor.kuehl@canonical.com> References: <20190823220825.25608-1-connor.kuehl@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Dmitry Eremin-Solenikov BugLink: https://bugs.launchpad.net/bugs/1841264 crypto_cfb_decrypt_segment() incorrectly XOR'ed generated keystream with IV, rather than with data stream, resulting in incorrect decryption. Test vectors will be added in the next patch. Signed-off-by: Dmitry Eremin-Solenikov Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu (cherry picked from commit fa4600734b74f74d9169c3015946d4722f8bcf79) Signed-off-by: Connor Kuehl --- crypto/cfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/cfb.c b/crypto/cfb.c index 94ee39bed758..0ae43945e435 100644 --- a/crypto/cfb.c +++ b/crypto/cfb.c @@ -145,7 +145,7 @@ static int crypto_cfb_decrypt_segment(struct skcipher_walk *walk, do { crypto_cfb_encrypt_one(tfm, iv, dst); - crypto_xor(dst, iv, bsize); + crypto_xor(dst, src, bsize); iv = src; src += bsize;