From mboxrd@z Thu Jan 1 00:00:00 1970 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,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 282FEC433E0 for ; Tue, 5 Jan 2021 16:22:36 +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 C70F322C9D for ; Tue, 5 Jan 2021 16:22:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C70F322C9D 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=kqmUEY9u4w4Ug76mFZD/K/bssaflnXIcRK/UzPqew50=; b=r4SsML8HKgoK/9vj/WsSkbZXZ TGhVPiWxob3GiyILojT0ZcP+5zXYhpCxoSbNCG9niL4JD2LpEPCrNjUsZqXnsHosU4rPPBLVCikqc 4T6qQvU/YsCrvxoQSeGv1B1/unKS3CAXvX3wqFAJsjkxXVs6IIe1mV9xJ5hQgMjC+OlxUy8JiGf0D 2WOjq03LA/it/jcjOncR1CnmsdXgXFlc7v1DMJ1JQ43wYqPSt/glXNe3shAtuFi+e4DtG3ly4+v+9 kUHDy2iYxtptJcgxw+gzmHBLoEViZVWq88cBg4X8wnztcs+Y0ktjIEliLfUQHek2tNVJu2QJMhWF3 FiQv4JneQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwp4g-0000Db-G7; Tue, 05 Jan 2021 16:20:46 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwp4d-0000CV-50 for linux-arm-kernel@lists.infradead.org; Tue, 05 Jan 2021 16:20:44 +0000 Received: by mail-wr1-x42e.google.com with SMTP id y17so36730469wrr.10 for ; Tue, 05 Jan 2021 08:20:42 -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=31WFzOSKmhxLpwB1rhJjCKmLgA51L1dzh5S2ypQ2fbA=; b=oVwoUPH0zFhrsWDYXv3FK0nym+VJOpUOX6S3lqL+MgyxSgopOsuTb4dCX+d64QjSZ3 eiucYsrbG8xP7joxz1UaPbUAKXVXXNxDK0jb+mBkcQor5fRkhZZqq04uLmH5K/TID4Tj f3O+xd/EEi5vnctLFkJdtyL/PmazRAN1iial6Xt0gY0tlZJ/LlSS32iNYFFLNDEyYM5d iQNsjNbpdbF1bMap46zXDvhHhCvBZ4QoFLaAb0lusFnm90RIu1XUJ6thtPbT9mUJIhUC xh+SWaxrp4HuYlcvg3kfX3IS908WUn7w3TmRtY8CK3eJooXlkuzyitbZF6GSXuFMQPSc acTA== 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=31WFzOSKmhxLpwB1rhJjCKmLgA51L1dzh5S2ypQ2fbA=; b=XZcSZ71JfL7J+p5HFhw7TMJ6Vgt0BLmHEf2WETJ9HUht6eit4tjt9ZCmWkbDDZqQdL 7zbP5oeA7QCLOaNHtQrYx0wQKeOo4VqzG31AF2VSgzmvyrxQw5V9+rDz9tjMV99h9Gv1 JZb1Kv0BpKSZBUrR+p9RZfsoiGbRJy4kCTOeelxK7w8wb2Ho0gG7fxtHYISUy3m4XAZ0 Y2kcpPEFDzPUppYuaH/2PcFn2F29jdirGNEweK3wAbYA8SPMuGPD1FujTTfG6FvvV1oI IbaRG2JOxYZK25Bmv9GadUkSPL50ejH77DkPIDfDqXvplKgHLNKIBpn9cviRI1aOw7S6 Fz2w== X-Gm-Message-State: AOAM531Zl1bt7B9zeYJa3V928aO4ImCsjGB95XaMOk8ZynShT9GqXFn/ 49qvIlVNopsp8YyHpUl3zXR0Bcw9Ws0Nkg== X-Google-Smtp-Source: ABdhPJzY39igqV3VJCJtIiuRebqqId1DxcdoUxPlf7vThovnNfWjEMZLXqTNUGEgODC9wrP0xZAogw== X-Received: by 2002:adf:a3c3:: with SMTP id m3mr346384wrb.105.1609863641916; Tue, 05 Jan 2021 08:20:41 -0800 (PST) Received: from buildbot.pitowers.org ([2a00:1098:3142:14:ae1f:6bff:fedd:de54]) by smtp.gmail.com with ESMTPSA id r82sm6654wma.18.2021.01.05.08.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 08:20:41 -0800 (PST) From: Phil Elwell To: Nicolas Saenz Julienne , Greg Kroah-Hartman , Arnd Bergmann , Dan Carpenter , Stefan Wahren , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org Subject: [PATCH v2 1/3] staging: vchiq: Fix bulk userdata handling Date: Tue, 5 Jan 2021 16:20:28 +0000 Message-Id: <20210105162030.1415213-2-phil@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210105162030.1415213-1-phil@raspberrypi.com> References: <20210105162030.1415213-1-phil@raspberrypi.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210105_112043_219020_44A5364F X-CRM114-Status: GOOD ( 15.13 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 not returned to them as expected, but instead it is replaced with a NULL. This lack of a suitable context may cause the application to crash or otherwise malfunction. 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; } /* -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel