From patchwork Mon Jan 4 12:09:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Elwell X-Patchwork-Id: 11996597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E604EC433DB for ; Mon, 4 Jan 2021 12:11:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C95721E92 for ; Mon, 4 Jan 2021 12:11:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C95721E92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=raspberrypi.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=i5COYj+k5fYvWIInFOuATwvMhFYAYqUFo6ih6fhyPuE=; b=iAXt5pxznscvxJXp2M3ZkUEld T+V/M8ngyHdhjNIxwmBvYI5L3p6sUGWIsT6PENa6B294bHWngTXQYwcNdW4BKSls52uMivyV1FCeb Nkv6QqYFeZ6wfneJhhYT1eNN4ysrQJ2VMCwLtAYJk4iFPsO1izTZuQ5RfRo055b2GXsQIjTJwzY2u QlvBDSYXzTSh1IT8W4ZBsg/Gqe0E+r7sgnD3NkzDXYB3xES46ebbplolg+9l0d95OWKvkW+C7OFE1 yfKnuAAFnVFDc7xq7sh2tpcDflXXEgy6vmVHuq/dVwQMJAuYCmAxg9mL2f95yk1WWwQr1iE+W5NmH 8tm3nORfw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwOgS-00009F-9Z; Mon, 04 Jan 2021 12:10:00 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwOgL-00006V-KH for linux-arm-kernel@lists.infradead.org; Mon, 04 Jan 2021 12:09:54 +0000 Received: by mail-wr1-x42b.google.com with SMTP id r7so31911379wrc.5 for ; Mon, 04 Jan 2021 04:09:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LdYMZkS95/eUCPYzKGKS+r7Qt7k4YYv/NUk3PW6Pl6M=; b=t3xs7tGmZGwD0IqGuTOyXMg6xsE/FT5Xymf4MjL59gc+Wy8qfxalVk5KsmxNrOgAIF ubqZqYvYBklV4iyLAo7aIRZWU87vTqfB6wrpOXwrcHhCyaIscgqB5FVkx6kEjGq29lzp 4OgOnZXi3qRhEZVBBthDx20n8b9Kpl+Ntz8DmgFde2MfRERNSR3B8dmfw5ZxTafU4TOO Nd/rNKpoXl85O+BS7CPZ8/qe5vfxT1DM5iY8VCOGTZkMzYMlYBld9ydxRW4DgB+jJzHW WF/F9Bdw3HLC9Z/Oe62oiDExi2lmKdx5q804Pxm9a2svmnM451PTu2x/42aPDATuiwQz +xLw== 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=LdYMZkS95/eUCPYzKGKS+r7Qt7k4YYv/NUk3PW6Pl6M=; b=SO/UD8oxv9QjmDS9kAbU4YGovIZBysVqEi2oa+B1K9nlpSdireVLnob1rN67/um9Vk kRVCNb7BpZ+D8A1jE/RLdxkZQHl14w2GoxCQ+zZWaYpnTRlOd6HXCBS6wZKaiD2iPLzS E6w3VKBuz1UDdpOGT8pSQ9itvTSO7RD5maIIBY9EEHnruw7cdGtNi0cBzEInS7dfoc+G Rhse/6y56AD9lsgKHFZ1qmiAN9yBSXZ+RfJ9Ogg//dIcNxyoKnIotrhRfQyx8rnkkcii ES7r4JmS+HmqjjRCWmsbwhy5HSECLj3cifLa4vlwk77aro1qoMpp8VSaSe8ONot9Wa+y axuA== X-Gm-Message-State: AOAM5307zSJs03SbaKaKNIVnJJKbIr8RojwLaKs4DVrVmxSMqUTZ/dxY kFN8AUrwMhX84OH5dwVvhUnxAQ== X-Google-Smtp-Source: ABdhPJzAVVIXj5IF0S29oZ1G6emiMhBnQp4oWbVSCI6mCtHw7LpxJ6WZ9eO9o7Ar3gWSlA4KfLU4Dg== X-Received: by 2002:adf:f891:: with SMTP id u17mr80838377wrp.253.1609762192439; Mon, 04 Jan 2021 04:09:52 -0800 (PST) Received: from buildbot.pitowers.org ([2a00:1098:3142:14:ae1f:6bff:fedd:de54]) by smtp.gmail.com with ESMTPSA id x66sm33692952wmg.26.2021.01.04.04.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 04:09:51 -0800 (PST) From: Phil Elwell To: Nicolas Saenz Julienne , Greg Kroah-Hartman , Arnd Bergmann , Dan Carpenter , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org Subject: [PATCH 1/2] staging: vchiq: Fix bulk userdata handling Date: Mon, 4 Jan 2021 12:09:27 +0000 Message-Id: <20210104120929.294063-2-phil@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210104120929.294063-1-phil@raspberrypi.com> References: <20210104120929.294063-1-phil@raspberrypi.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210104_070953_726136_EAE9DE5F X-CRM114-Status: GOOD ( 14.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Phil Elwell Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The addition of the local 'userdata' pointer to vchiq_irq_queue_bulk_tx_rx omitted the case where neither BLOCKING nor WAITING modes are used, in which case the value provided by the caller is replaced with a NULL. Fixes: 4184da4f316a ("staging: vchiq: fix __user annotations") Signed-off-by: Phil Elwell Tested-by: Stefan Wahren --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index f500a7043805..2a8883673ba1 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -958,7 +958,7 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance, struct vchiq_service *service; struct bulk_waiter_node *waiter = NULL; bool found = false; - void *userdata = NULL; + void *userdata; int status = 0; int ret; @@ -997,6 +997,8 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance, "found bulk_waiter %pK for pid %d", waiter, current->pid); userdata = &waiter->bulk_waiter; + } else { + userdata = args->userdata; } /* From patchwork Mon Jan 4 12:09:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Elwell X-Patchwork-Id: 11996601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 623F4C433E0 for ; Mon, 4 Jan 2021 12:11:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1E79B21E92 for ; Mon, 4 Jan 2021 12:11:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E79B21E92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=raspberrypi.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kMIqOMEhGJGtlrEoa6vepPO0ix0Jh0Wue/bCRC02usQ=; b=tfhYKS9SRX+aMmxOyqw4CGtyw kK94yiWMkmixFD0DjUekcTGtOvK/YU2NY6X2PhvndvjKSohTalLsBqF/gUBWL+MUlxVnHMl/TnQ59 4Dks6nyFbpRdEKES4RvKl7gGYylC+UYK1lhpWXKJfhd+flvHaSL+Lm/lNxxso0g8Kl3TgqvOsTsjL UGVdnl7HCTYqDms3xmVpQcolhhJjmStL5WLQW86P3bJe4erzMulLlEs7AMlgtK6/1AcNj/3z1mzL0 JMWG6qyErhLpkNsACvFFOVOorC8qaik8naJCP170P+eH91nisxE6rllIZ6hJG3b37tWQScoRpjkf+ S/Eu8AmJQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwOga-0000C6-CK; Mon, 04 Jan 2021 12:10:08 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwOgO-00007a-NH for linux-arm-kernel@lists.infradead.org; Mon, 04 Jan 2021 12:09:58 +0000 Received: by mail-wr1-x430.google.com with SMTP id d26so31880539wrb.12 for ; Mon, 04 Jan 2021 04:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NX9GgUhvrdFINxLCVAgA1k2tN4aNPfLwDkftpmTakS4=; b=cTovjni5LQCRAn6uHRuxGVYwlk3KeVos6rIAlDhRBydP7rVzrt2MVmqKQ9VhP7TEhT 4kD+aDA9dWY36k+ujzmAJ4DdZ+BjpQ2bg0kfVhqjdrKYClArK0+AnPg33bIDmHqXGAN9 WEarYd2R/gOPj3MuqOgtWaRJcOrdE/mfdiZjRIgd0Eou1MskM23TbAMogOdrFaRmTQy5 SsSDuX6EbZNEoFWAaTsEo+tDj446O9+gm7/P7n3c59u5xmJdm3dmJhFu7+/8TktZhTbR KXJL7EcAw4yczqVIKHyf1tzxH0gQXiwhh/1LoxrUEmKiiH7Mi5LVuPFYh7rJNXxTVGSn +zTQ== 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=NX9GgUhvrdFINxLCVAgA1k2tN4aNPfLwDkftpmTakS4=; b=DQpgQuz9nbzUwe+WMBV7qsMGRGKCaNJMi5oTJXMqWvAeUeodKasOKNYJFVyjnj4o16 QD8loA7m0i5p2SoTaciNn58CSMJT0NyPQfPgTwy/mLBPVGfHFm2+V1Ol7863t9pSrx7P dMEzwNJ1fdPIqo8PnBRroFpgva5I4HfBPvO3FpaeaDby94HLuD+6DijquY5IDe/wi5tP MtwPkPMlfM1RoqybDIK/CdR8GdjfeEAqBR9EdhzfzyfLLbo8kWJEqUO4l0UOgin90IvU 48FN4OAWxQOdLCCg/0AAS728U+eEQma4uVCW8z+s1uobMD+5UWnLdlXJYvjXB6kWIxOM UB5A== X-Gm-Message-State: AOAM532YpCGjLdE9CMTNMMieIZCwUhMn7ac1jSozJJl0ecbCLXPMlxQF Md1CuKdk+ZJgzlIfisNibTENGg== X-Google-Smtp-Source: ABdhPJzCKAT3H5EG+58xo4rEm8YigOVsJHy9bx80PMJBNUq89UyAuaI0Pc85gv7qTARQeGyVXbnoRQ== X-Received: by 2002:adf:8342:: with SMTP id 60mr80603401wrd.140.1609762195420; Mon, 04 Jan 2021 04:09:55 -0800 (PST) Received: from buildbot.pitowers.org ([2a00:1098:3142:14:ae1f:6bff:fedd:de54]) by smtp.gmail.com with ESMTPSA id x66sm33692952wmg.26.2021.01.04.04.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 04:09:54 -0800 (PST) From: Phil Elwell To: Nicolas Saenz Julienne , Greg Kroah-Hartman , Arnd Bergmann , Dan Carpenter , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org Subject: [PATCH 2/2] staging: vchiq: Fix bulk transfers on 64-bit builds Date: Mon, 4 Jan 2021 12:09:28 +0000 Message-Id: <20210104120929.294063-3-phil@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210104120929.294063-1-phil@raspberrypi.com> References: <20210104120929.294063-1-phil@raspberrypi.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210104_070956_802256_4FB09984 X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Phil Elwell Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The recent change to the bulk transfer compat function missed the fact the relevant ioctl command is VCHIQ_IOC_QUEUE_BULK_TRANSMIT32, not VCHIQ_IOC_QUEUE_BULK_TRANSMIT, as any attempt to send a bulk block to the VPU would have shown. Fixes: a4367cd2b231 ("staging: vchiq: convert compat bulk transfer") Signed-off-by: Phil Elwell --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 2a8883673ba1..2ca5805b2fce 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1717,7 +1717,7 @@ vchiq_compat_ioctl_queue_bulk(struct file *file, { struct vchiq_queue_bulk_transfer32 args32; struct vchiq_queue_bulk_transfer args; - enum vchiq_bulk_dir dir = (cmd == VCHIQ_IOC_QUEUE_BULK_TRANSMIT) ? + enum vchiq_bulk_dir dir = (cmd == VCHIQ_IOC_QUEUE_BULK_TRANSMIT32) ? VCHIQ_BULK_TRANSMIT : VCHIQ_BULK_RECEIVE; if (copy_from_user(&args32, argp, sizeof(args32)))