Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp283136iob; Wed, 18 May 2022 02:03:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlYxod20fqjNP0THt1LIH/zsj8VSlugEaIukQxUoAGPzfeVaV5EZW0bUAcGfMPMJMaS6I2 X-Received: by 2002:a17:903:22cb:b0:15e:d715:1bd8 with SMTP id y11-20020a17090322cb00b0015ed7151bd8mr26188446plg.159.1652864622602; Wed, 18 May 2022 02:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652864622; cv=none; d=google.com; s=arc-20160816; b=p+d3Ctc/Ur+XU/TqBvkSO1/mgNuQZ/s+JF37u89PjMvXIdS1trPFGwRhbUETEMcEo6 X8eaKMyuVYzc2l0hdSfq9oo/iz8eHjuU05hKxoD12F4wIF1hEXLAomgCKgo5gfYG1Hyt 9C/rp9YWBD9M/4TJML0/sPDv6zPfDjoKr40mqU2N/aYRQ4vbNFOx59h4ndW7eB5mhpQv k8Ju6ARKxFPhJQhvh6fJBJsdx0h6xjFinK379K9PEC1Rlwr2WpaPrNRSoMi0ytEdyfst JAurrga/J38dDZxlLKiuUfhi0swLoA2XQ62UH43SVt7PX0V+yC3pKQX7oRP3wfrdHJVj Yhaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:reply-to:subject:to:from:date:mime-version :dkim-signature; bh=5b9ExFuV/mdbXBcWZ/YTWQ8xvIPBld8ClYxJkOjjqFQ=; b=Tl7U+o0s9XsxdZP7XTXuBaHWGpHtyNu3mB7+KvBK/yaCPBf0rVPwEAaClUDAQQOjf/ DoHUa9UXaA2UxSQVShnh3pTzuMC03anWPZg6yOlPnx1Bf9OojXeTVxh9pl3drNNzIkO2 xD2jNiBaBgJwTu+S6AHAtbURWe/1+gAwMFYH42ARtlEfk7rni0oORRn17+N//Hq/Wcje jiZN0yXA1gYBpiVHUn3s/DUuLiVY81tG5HqCKqPjR8UI9M/XZcfBWN9V9R/3K6GUqisS pD/Vdfh8dduw17i/B4T13ThEaZh+/nIOTUO1NWCK4DFE8W9rIFCapIfADYbD//GDHM/L pDzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=sqwyNbO3; spf=softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f10-20020a170902ce8a00b0016161f4428fsi2487449plg.231.2022.05.18.02.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 02:03:42 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=sqwyNbO3; spf=softfail (google.com: domain of transitioning linux-crypto-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CE5D813CA21; Wed, 18 May 2022 02:03:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233682AbiERJDi (ORCPT + 99 others); Wed, 18 May 2022 05:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233672AbiERJDi (ORCPT ); Wed, 18 May 2022 05:03:38 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4753E1238A8; Wed, 18 May 2022 02:03:37 -0700 (PDT) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24I8isbW017356; Wed, 18 May 2022 09:03:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=mime-version : date : from : to : subject : reply-to : in-reply-to : references : message-id : content-type : content-transfer-encoding; s=pp1; bh=5b9ExFuV/mdbXBcWZ/YTWQ8xvIPBld8ClYxJkOjjqFQ=; b=sqwyNbO3CE+rC7+zMxgccmjhhR53iMoeId7JVnXtt0+SLjU3h7qRfvCTu7Jk3sT0muZl sAT3zUIm6J8WjVmY/Gph2VWo/3ZP7beHmoJ23SdNjuPItewc+k9MU0EKqexfc8XIOEJP ZsealRbOxzpn8c2wPDhFpYOxP3bSC270ieS/dTPYHZAp5OlDO+hnYnSodlZ3lA8BG/A3 Or3StUKx0tvPgULlOip/Ulf+mUyR4RnUlYxOhALrqSa9pZoqP4pHbWTAea8NEZcTQzzx 6JhHA9HQHMzGJGyYnIOEfnVie66PvHauH5w1GTQqXNpxGQPlNoDVL0ccRlAOs0na/nu1 BA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g4wjh8css-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 May 2022 09:03:34 +0000 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24I93XcF013967; Wed, 18 May 2022 09:03:33 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g4wjh8a9d-10 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 May 2022 09:03:33 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24I8QeWP021832; Wed, 18 May 2022 08:30:32 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma01dal.us.ibm.com with ESMTP id 3g242b9xhc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 May 2022 08:30:32 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24I8UVaS22348232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 May 2022 08:30:31 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7FB88112065; Wed, 18 May 2022 08:30:31 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05A65112063; Wed, 18 May 2022 08:30:31 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.10.229.42]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 18 May 2022 08:30:30 +0000 (GMT) MIME-Version: 1.0 Date: Wed, 18 May 2022 10:30:30 +0200 From: Harald Freudenberger To: undisclosed-recipients:; Subject: Re: [PATCH] s390/crypto: fix scatterwalk_unmap() callers in AES-GCM Reply-To: freude@linux.ibm.com In-Reply-To: References: <20220517143047.3054498-1-jannh@google.com> User-Agent: Roundcube Webmail/1.4.13 Message-ID: X-Sender: freude@linux.ibm.com Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 9EUW4Wyvf76gYoLAuzxu8q96O3eUjMhp X-Proofpoint-ORIG-GUID: 0rNeDyJbJunPJw4CkZwJGcEECBwMHQ_t X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-18_03,2022-05-17_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 mlxscore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=799 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205180048 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2022-05-17 20:01, Heiko Carstens wrote: > On Tue, May 17, 2022 at 04:30:47PM +0200, Jann Horn wrote: >> The argument of scatterwalk_unmap() is supposed to be the void* that >> was >> returned by the previous scatterwalk_map() call. >> The s390 AES-GCM implementation was instead passing the pointer to the >> struct scatter_walk. >> >> This doesn't actually break anything because scatterwalk_unmap() only >> uses >> its argument under CONFIG_HIGHMEM and ARCH_HAS_FLUSH_ON_KUNMAP. >> >> Note that I have not tested this patch in any way, not even >> compile-tested >> it. >> >> Fixes: bf7fa038707c ("s390/crypto: add s390 platform specific aes gcm >> support.") >> Signed-off-by: Jann Horn >> --- >> IDK which tree this has to go through - s390 or crypto? >> maybe s390 is better, since they can actually test it? >> >> arch/s390/crypto/aes_s390.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) > > This can go via the s390 tree, however I'd like to have an ACK from > Harald, who wrote the original code. > >> diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c >> index 54c7536f2482..1023e9d43d44 100644 >> --- a/arch/s390/crypto/aes_s390.c >> +++ b/arch/s390/crypto/aes_s390.c >> @@ -701,7 +701,7 @@ static inline void >> _gcm_sg_unmap_and_advance(struct gcm_sg_walk *gw, >> unsigned int nbytes) >> { >> gw->walk_bytes_remain -= nbytes; >> - scatterwalk_unmap(&gw->walk); >> + scatterwalk_unmap(gw->walk_ptr); >> scatterwalk_advance(&gw->walk, nbytes); >> scatterwalk_done(&gw->walk, 0, gw->walk_bytes_remain); >> gw->walk_ptr = NULL; >> @@ -776,7 +776,7 @@ static int gcm_out_walk_go(struct gcm_sg_walk *gw, >> unsigned int minbytesneeded) >> goto out; >> } >> >> - scatterwalk_unmap(&gw->walk); >> + scatterwalk_unmap(gw->walk_ptr); >> gw->walk_ptr = NULL; >> >> gw->ptr = gw->buf; >> >> base-commit: 42226c989789d8da4af1de0c31070c96726d990c >> -- >> 2.36.0.550.gb090851708-goog >> Ok, tests pass. Here is my Acked-by: Harald Freudenberger