Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2504782imm; Mon, 24 Sep 2018 05:35:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV63UsTvSb+y24WtQe6OI3/INmy+MOOC8O1hVavCZW4+t6HLSXRDV7lKQVxPRlyrWdvFHxj38 X-Received: by 2002:a17:902:8a92:: with SMTP id p18-v6mr10453053plo.148.1537792547749; Mon, 24 Sep 2018 05:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792547; cv=none; d=google.com; s=arc-20160816; b=RIosNi02e5C1Jl+h/BZrscC8P1sH7KfEw3KCEmtOlUlF8Ruuc2FhxngeBtJQlxYIr1 cT67StY+bVc7WeIyLL2oAz4WIUamwqUoT9W9Pw7m25+isNoroG0SWYvK//aqoUYsfyE8 qEza1fS3KVWAzAOxrzTemdnb8iX5YIfgZQ5UnqbXm+l7zxMaNgDeu0w9yckH+KylpXfC UoUgWExKobRdpYbT6RvKVkCSOSEgfpQAc7OGvYOvvb4ONXLp/RtNqD92nIQdlQQjDhQn qoq4Sz+4B6E+LFViVQvbqr2xaZ7S4/rsk7B3OYkoDuzgacewAz0PEe0529TlQGrAl2vf FEDA== 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; bh=jhZeraMaC+85LctaY4viAZt0dCkgWVijGh99TPCdBx0=; b=TWZmxLgZz9vjGSMpk9KHBPS8c+vvdhfdnSwlL+zwm2b9+C6kEA8nq0BvEKnMHucB3b zv38l8yNiq64D22TyahVLZrJqqMDRVq8HmdFTKYsplZObgei21dX1Uh5HyMSPXHlfdcQ qzQ00t80ZXxUjfY1UlJH6DVdhfMfAG3Kj/IMnXXTh0ZcvoonkIrTV9PHcxYaFMmQ1RFE BOau506QIhN6SPDdlTojgy4qRQlfv2QkerZHqMF7YkaGtoqd+3x8eBNGszNEpY7obGBe 7YEA0yeXXgKGZY6d8h5wTxPB1kSfqxd6Lgm2+1sk8FAMINkNYXAxk3g9Gjxq/njxuLVz linw== ARC-Authentication-Results: i=1; mx.google.com; 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 q1-v6si35131697plb.35.2018.09.24.05.35.32; Mon, 24 Sep 2018 05:35:47 -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; 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 S2388291AbeIXSfR (ORCPT + 99 others); Mon, 24 Sep 2018 14:35:17 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58356 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733238AbeIXSfQ (ORCPT ); Mon, 24 Sep 2018 14:35:16 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 95DA31018; Mon, 24 Sep 2018 12:33:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ingo Franzki , Harald Freudenberger , Martin Schwidefsky Subject: [PATCH 4.18 103/235] s390/crypto: Fix return code checking in cbc_paes_crypt() Date: Mon, 24 Sep 2018 13:51:29 +0200 Message-Id: <20180924113115.814888179@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@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: Ingo Franzki commit b81126e01a8c6048249955feea46c8217ebefa91 upstream. The return code of cpacf_kmc() is less than the number of bytes to process in case of an error, not greater. The crypt routines for the other cipher modes already have this correctly. Cc: stable@vger.kernel.org # v4.11+ Fixes: 279378430768 ("s390/crypt: Add protected key AES module") Signed-off-by: Ingo Franzki Acked-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- arch/s390/crypto/paes_s390.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/s390/crypto/paes_s390.c +++ b/arch/s390/crypto/paes_s390.c @@ -208,7 +208,7 @@ static int cbc_paes_crypt(struct blkciph walk->dst.virt.addr, walk->src.virt.addr, n); if (k) ret = blkcipher_walk_done(desc, walk, nbytes - k); - if (n < k) { + if (k < n) { if (__cbc_paes_set_key(ctx) != 0) return blkcipher_walk_done(desc, walk, -EIO); memcpy(param.key, ctx->pk.protkey, MAXPROTKEYSIZE);