Received: by 10.213.65.68 with SMTP id h4csp243270imn; Fri, 23 Mar 2018 03:45:55 -0700 (PDT) X-Google-Smtp-Source: AG47ELskGEtMbK1xlIUtQbPSz957MA8zFw/3s3KHq0WswfQDYdXN/Lwiqs6ZjeOvwZYugbd0nfZe X-Received: by 10.99.49.143 with SMTP id x137mr21059343pgx.424.1521801955123; Fri, 23 Mar 2018 03:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801955; cv=none; d=google.com; s=arc-20160816; b=wynh8robtPpmgOHTDCoqdCuhkd8tNqM2gJzx6WOn87Hqg4ZYKo9V4HIFpwKzVKFGkk USsDKgBczbarTA0C5xKpuNzabkoh9ztjdAdLzweKL6ziCgnWnAfGODp223uDThvzyM0s tefwdmvdIw59xoTPZXTZqlk7j8CJ4aVJjLF0gLsYKbHTOkfwOGEu8YbbyMNFJ4NpFOoL cIAl88HbGnv0KNgcVMmDmstpcnVN08AisZmrPoIYOzHxYK86W5Wex8s9sS+yEsztvcKN UZk3Rzmp/3jxip1rmIANXy+F943P+RZ/MhxokH9/cAiTXaXX8Uk5XlOuaJutIaJXxjiU U+GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=2WycRnY3YeGClgCpDhAWOT0rzD/T4tA4KCvY3yzl7ag=; b=LMLLR+PCKupjn1kxW5+pLt+aN1+PkM1v7ijeQAsGCEuU5NwO08Vqmcg4Sb9vrXi3Gj LSy6Bx5HEd7DQZ6CBFZ6/rLD6UyDmKyPvAYzi4GP4JYojkel3USFYJtuMgIficsJFnzo zyNPwfJ9uGDMAQ5c5jzVKZHapS3Qz3/dFlRFtcfSitCcgNFqA9ZbWNn8osLsqWcElr39 q1OowIP+Ej3jdjDUaSmDmlEX19DumrSk3KDTXm0crdWViM0dbdROcURAoIJmPC7vQ8iw TsdNlFUk9eRkhJMc8+aLN1E3FcD2ZKqM1LxyVkP8utrmpdQFA+37UIJ1NYdyClEfaiM4 tjmg== 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 bi10-v6si8042229plb.105.2018.03.23.03.45.40; Fri, 23 Mar 2018 03:45:55 -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 S1752294AbeCWKom (ORCPT + 99 others); Fri, 23 Mar 2018 06:44:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46456 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933541AbeCWKPt (ORCPT ); Fri, 23 Mar 2018 06:15:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EDD38D09; Fri, 23 Mar 2018 10:15:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sameer Wadgaonkar , David Kershner , Sasha Levin Subject: [PATCH 4.4 53/97] staging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK set to y Date: Fri, 23 Mar 2018 10:54:40 +0100 Message-Id: <20180323094200.634018655@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sameer Wadgaonkar [ Upstream commit 3c2bf0bd08123f3497bd3e84bd9088c937b0cb40 ] The root issue is that we are not allowed to have items on the stack being passed to "DMA" like operations. In this case we have a vmcall and an inline completion of scsi command. This patch fixes the issue by moving the variables on stack in do_scsi_nolinuxstat() to heap memory. Signed-off-by: Sameer Wadgaonkar Signed-off-by: David Kershner Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visorhba/visorhba_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -792,7 +792,7 @@ static void do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) { struct scsi_device *scsidev; - unsigned char buf[36]; + unsigned char *buf; struct scatterlist *sg; unsigned int i; char *this_page; @@ -807,6 +807,10 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cm if (cmdrsp->scsi.no_disk_result == 0) return; + buf = kzalloc(sizeof(char) * 36, GFP_KERNEL); + if (!buf) + return; + /* Linux scsi code wants a device at Lun 0 * to issue report luns, but we don't want * a disk there so we'll present a processor @@ -820,6 +824,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cm if (scsi_sg_count(scsicmd) == 0) { memcpy(scsi_sglist(scsicmd), buf, cmdrsp->scsi.bufflen); + kfree(buf); return; } @@ -831,6 +836,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cm memcpy(this_page, buf + bufind, sg[i].length); kunmap_atomic(this_page_orig); } + kfree(buf); } else { devdata = (struct visorhba_devdata *)scsidev->host->hostdata; for_each_vdisk_match(vdisk, devdata, scsidev) {