Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3819566pxk; Tue, 22 Sep 2020 03:33:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYvM4+BbqwykaHrVXCcF0oZHQNs8QKAgZamb2Yms9aRTSB0IhHd22uNBgZTrd+YdtFp+1G X-Received: by 2002:a17:906:4c42:: with SMTP id d2mr3967792ejw.506.1600770798536; Tue, 22 Sep 2020 03:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600770798; cv=none; d=google.com; s=arc-20160816; b=rVEDtveOSBeKU7GrhH0ayrNYM8O2SGKFJQIN0ErknNfIyfsrfYwMqpbFotX9Bj0PBD wntM+4+tPjd54eRDNSPz0WLe3O0Jv0W3s559WjG9yBTq7P/ceW3E2x5IttRc4DpE6YpB M5rt5/B2dp6LUp9ZM37IKEG7wYmcO1KMvE/6hDANdjZL7riHQcmISGS56gyCLgIGeUIq DDANaMytXt0EJl1Be0NSrTO+D2TxUMLtHI6nDKnuHIj5ZOQohiD9jEJA3b5xdXQUqZ8K Vhl3i08ZsaUHovNbCBl9tStY/KKgc4gsjWj5Bayn+QKKdblsUI6KSzV2hHcQSIMqrMT6 23Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=4/HgkdPfwvx9hh+ecBAVGHQ12vx6oJVsY/D1hoj+iSw=; b=Znw86EAcoVdgiT0g3kYkIUb51EVkN05KmpB8CYErs60VTkw8YWySFVJhrhN+e09rbf Naf08t//PNwPW/A+0qmmMLOlmAIe15UT2ydfwN0o3xg25X3wdztf2ZoZnk+xEAQrk7Wx En7TotGhmfqw4x8226jyQMFAeuxrJapLMPvNZgTHtNaVrSUHHvkSXl16epGCf0zU9jRO yjkqqR9XizjN9H8YVczPZtA0++vs0SqcfefztCdQxuzO8UoGI8m7cxTgMhmoZ3UGGPU4 llU4+ncKXLicu38B3kIwogpcsCOA35bbSCIpKEDsjpkgNMxYc+0Z/kxnnbYxqu/Tv8aw S2rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="dDn/CygK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lk17si10321062ejb.188.2020.09.22.03.32.54; Tue, 22 Sep 2020 03:33:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="dDn/CygK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbgIVKbR (ORCPT + 99 others); Tue, 22 Sep 2020 06:31:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgIVKbR (ORCPT ); Tue, 22 Sep 2020 06:31:17 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0DCC061755; Tue, 22 Sep 2020 03:31:17 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id l126so12034844pfd.5; Tue, 22 Sep 2020 03:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4/HgkdPfwvx9hh+ecBAVGHQ12vx6oJVsY/D1hoj+iSw=; b=dDn/CygKuT/cyzJ653BoeDbc8tMs8JGPl9cJTnkBnqPrn6KD6JuIcd6Z6R6j7Tcbwq gfHocxme2l0h+bH/3F6E8Xe8DEbH8IuCkksDDXWeHkzgufezRBnoaEL/l3hKdeQZZdSj 2OnTLrSVqugDqWGU0C1N+dI+nOeMo832g+xP1LplaZ4+0aOj93QpMsK9Ydb6I56oMoZf 3BVrWn/3vH3BfyG6/F6Nxq2cwwtSwB3mNQFVTmzJaz8B9QtjsE+0nXgAHYFT7FwdtPFZ 9OWzllYjuRsj+7P1935RxKgrug3NthNuRjO79LWaDIgR/b6GtTYHgYBoJ+U4oJQlABJR iWjg== 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:mime-version :content-transfer-encoding; bh=4/HgkdPfwvx9hh+ecBAVGHQ12vx6oJVsY/D1hoj+iSw=; b=mQU56x8T42rJU0QxeG7WxgLbiqTCmx0tS8GiNGr1N2ta0gbZj0bAbv++9zDk0jsvsz C8i+7FzKO+iyiRdv1nTsG5Mc+wL4rc1CoisWsWa+mKOKrb9tvfgDvmmwEdUC+1spqyMw V/jhllYm96foUzhALBcpoefl1kuogJ8uN3tb2zZkOaBMoyKWztpfrgBOxINzks6AgWq/ nLO3fhX32M3K7mYegJYrUMveSfFi7DpQLaQAH9jhQXlK9pk14e1oNQHlsSUgKhF9BU38 X1YIcf8JAoXqWtCtvrbb7MWhS5hK+uMV/qIQUWxpIYwkVSpRb0xHEVARHwg45miEBnI7 eR3A== X-Gm-Message-State: AOAM532Pwd+HtEKb4ABxlmhLNTKtcEmx6yyc9V7Kka/FUBorNzTQmPqN zs+j3k4BMt6ZH6Uf9p+mu/BgaJHMGFM= X-Received: by 2002:a17:902:a413:b029:d2:1fde:d2af with SMTP id p19-20020a170902a413b02900d21fded2afmr3855104plq.56.1600770676596; Tue, 22 Sep 2020 03:31:16 -0700 (PDT) Received: from ZB-PF0YQ8ZU.360buyad.local (f.a4.5177.ip4.static.sl-reverse.com. [119.81.164.15]) by smtp.gmail.com with ESMTPSA id 203sm14589028pfz.131.2020.09.22.03.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 03:31:15 -0700 (PDT) From: Zhenzhong Duan To: linux-kernel@vger.kernel.org Cc: freude@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, schwidefsky@de.ibm.com, linux-s390@vger.kernel.org, Zhenzhong Duan Subject: [PATCH] s390/zcrypt: Fix a size determination in zcrypt_unlocked_ioctl() Date: Tue, 22 Sep 2020 18:30:59 +0800 Message-Id: <20200922103059.859-1-zhenzhong.duan@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With new ioctl(ZCRYPT_PERDEV_REQCNT) introduced, kernel use dynamic allocation for the 256 element array of unsigned integers for the number of successfully completed requests per device. It's not a static array of 64 elements any more. Fixes: af4a72276d49 ("s390/zcrypt: Support up to 256 crypto adapters.") Signed-off-by: Zhenzhong Duan --- drivers/s390/crypto/zcrypt_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 4dbbfd88262c..5c3f3f89e2f3 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -1449,7 +1449,7 @@ static long zcrypt_unlocked_ioctl(struct file *filp, unsigned int cmd, if (!reqcnt) return -ENOMEM; zcrypt_perdev_reqcnt(reqcnt, AP_DEVICES); - if (copy_to_user((int __user *) arg, reqcnt, sizeof(reqcnt))) + if (copy_to_user((int __user *) arg, reqcnt, sizeof(u32) * AP_DEVICES)) rc = -EFAULT; kfree(reqcnt); return rc; -- 2.25.1