Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp860201lqj; Mon, 3 Jun 2024 03:08:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWS66VZ7+9nb8hCsQsm8ummZ6h7aKXLOoqR7908kiU9e+0NcJMGZs+XyvTCIu7+5iyMy5DL25hN9uvCUZh9edalSmCbUJGciG4Twb0k3g== X-Google-Smtp-Source: AGHT+IEK7OX6ZtGScyGZTBSvz/OTgeCr4X1sqbT++2OEQQKLeqm/joDNuZDYMRbAjevI92jfeWdb X-Received: by 2002:a05:6870:4141:b0:250:79e2:b94a with SMTP id 586e51a60fabf-2508bc2c42cmr9417205fac.51.1717409326574; Mon, 03 Jun 2024 03:08:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717409326; cv=pass; d=google.com; s=arc-20160816; b=Hy2h112GcWA2ehqVKOr12nbxpeMVvjspANHJ83xFWymYDOoJwbwxJL+GvUtDxG1Ih+ sitx8QvKgEt+1xbEQijsnO/JU6GChnIMyWyOlbklumzShw0Ll55beIaiLmyWG+uYnpcy b4PqPzDZHA0Bi4tsjsvliQ9CkgeYDTdG6XqEGhEHkYa+feEx80dAPgEnn0K3MspudKjy JGSlw8JQt8+ZQ+y6FvSbAkLI2r+gH2XY38ozlqjIFm1b6p76gswlBBNH+X8sl8fFxd+o s+WSe3r5Oa3uspJZZ1dJ4G548iA2HWmZB/31EPv/0etkgimUKeZDbnmlX+f19tA3pBBw JQnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6mTx7uYu4uJ3l4mrzFi9l5SnvCCSSuUrVpO+YQxuP+o=; fh=EWMrb5uz3gWsdeAL/77OCVu8dBaDLU07Fr1RjNbwXY4=; b=aP+/uaSO9121fje/PP80Ibq8RyJxmbWH8M7mUdYAZAVieas+rA0VfPvwDUC9v9Ln6J tlN7QkEviHXes/vBR7VkYyVj+AwmsLWQ+PMuHUxdl0njhbqDsm6mBiOGfMm87ckxpuCa kItAn1CjF/KUzyCWBVT4i9PYPnJl31mLIsiZDlfJc7pFeJIGaeS1CJahGy8Zxnm8brej /2guE6niDer3/Dw1HhZcIPhQFqL7lEOaO6RVARruLmiWau57m3vPL8qt+YNV4V5l/g64 n/7WmFCV/D+/1P5fx9QYqju5TO7YIAcnC2J9QDVhtzSGWjaaEwPis5/Z/3I4yI8hZT3T o2Xg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ls5yTesZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-198943-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70248c7b105si5818923b3a.5.2024.06.03.03.08.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 03:08:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198943-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ls5yTesZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-198943-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198943-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4BCEC289A16 for ; Mon, 3 Jun 2024 09:56:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AEC3182487; Mon, 3 Jun 2024 09:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ls5yTesZ" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AA237FBBE for ; Mon, 3 Jun 2024 09:56:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717408586; cv=none; b=bjVxhrTy5KUHHCFaNdL56bl0uy+xdLgjj8+lYMwwdjJPmhb9D/yQU9LI9ZYZocglpanI8Mph4Ixw1fZR26Uf+moShcqzAERdyPgOI79tu/ATuQ+Btogs4rMpsvZh7NLMZQhcnZVHUsV3TBoMLUprU5v9kuHZLflTCLEQgNyBnf8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717408586; c=relaxed/simple; bh=bZUi/bPPjZgfedSE6wxqW2H8bc6Pp8KMu+hHEjG8Lhg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gOGzSs8dZ0DdVy4dciCW6LPh7OOCaqQBtScYS7bbUcZPTBWiOi4ybIDmvA3MspC2IY0REwQICoDb3O7k2qlwsJXLfTjBHybe1LkLSF4KO5tXtI/a+6e+f/5LXmsCyjk3G5TJI/wRsieTi7MU6bhukV6Iivt7PYpx/WwOqoGCOCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ls5yTesZ; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2eaa80cb4d3so23731281fa.1 for ; Mon, 03 Jun 2024 02:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717408582; x=1718013382; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=6mTx7uYu4uJ3l4mrzFi9l5SnvCCSSuUrVpO+YQxuP+o=; b=Ls5yTesZBBW4LluHqpLYjVFrY5l84rcHuU0emvN3RKEiaMjFydB9KHd9MnhVXxizB5 ZiLXC81KLCcZv11yRO77QmqTMWLxuv33v5/8EdPmb4p515vfizU8jnH17lxAmL6U+U9G LmL5J8B+r5Lbh12CBJf7guDCCJ112ETLR6nH4SJ4KTVBhGQ94gqAvo2VGlRNnl9mUlmD vYAcGRTlv4q8F4Iuk0b1ppf6UOuScSBbZ23czlq4LQzXLUhta7vYEJ0/heMCI+2ldHR8 OV2N364WBnq8Hwr0y81LwFIgzdWWcV2eH3cF4oUg/eGqj5BdyPezFyqX06w/zECXTZCK UiaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717408582; x=1718013382; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6mTx7uYu4uJ3l4mrzFi9l5SnvCCSSuUrVpO+YQxuP+o=; b=XCs1EsDeb1iQ+qCikb+vWHotFUcbXrapPL41sxzILKsbW1uqawORMBvKtdkaIROcJ/ bUE4gENEIjYTZJ4Oc3xpSHETUQyIoai5cl7Md1Scp7LmZPdc70lEwZfytLpTeu0m72Tc wkJp+R5PO35DR0Ggh2+5d+NzRvoPnqmTTGC8fXJylpvnGOW4e32QiZ1aquFOdM/EdkHU 1v4SQzw/UB3BRRWrQAtNudZLL7wNfssiGkM67jEgPlzNNia9SxvKJP4J7uaH/oD+o+mE 4bISwoxu/DuU6KeCFyab/vm3lub9eDNbn+EKV3MSeuGrw+yJ0AtZiIOyV1Q9w8XL8rAI MVGQ== X-Forwarded-Encrypted: i=1; AJvYcCV/s0IPSXNRjEdfGCH0JD4qcfEtYmeqXDfhx9ee627jc9NhuJEk4pmO/HmYmVZzjmveOvpil77k2a9zoGHkl2UIVAe58qidcrFM+yzq X-Gm-Message-State: AOJu0YxDtw3ziCDE7yn5Ux8ywJoG/4Mg44YyqSQukbJ3MFO48L+3zsdu cXM0nlqVnwqdCywAjPiwY9QN/yX1DFBLhMNNh3mzoanq4WoXjRGzWCSBTsaeVT0= X-Received: by 2002:a05:651c:61f:b0:2ea:8201:4a10 with SMTP id 38308e7fff4ca-2ea951de6b0mr59670731fa.42.1717408582459; Mon, 03 Jun 2024 02:56:22 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::227]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ea91bb4c07sm11243601fa.45.2024.06.03.02.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 02:56:22 -0700 (PDT) Date: Mon, 3 Jun 2024 12:56:20 +0300 From: Dmitry Baryshkov To: Ekansh Gupta Cc: Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org, quic_bkumar@quicinc.com, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, stable Subject: Re: [PATCH v3 2/9] misc: fastrpc: Fix DSP capabilities request Message-ID: References: <20240530102032.27179-1-quic_ekangupt@quicinc.com> <20240530102032.27179-3-quic_ekangupt@quicinc.com> <32750882-2e4c-44b7-af6d-a1ec0857b69a@linaro.org> <7e316c16-47a3-4a87-81da-529bb857f4db@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7e316c16-47a3-4a87-81da-529bb857f4db@quicinc.com> On Mon, Jun 03, 2024 at 12:35:40PM +0530, Ekansh Gupta wrote: > > > On 5/31/2024 3:03 PM, Srinivas Kandagatla wrote: > > > > > > On 30/05/2024 11:20, Ekansh Gupta wrote: > >> Incorrect remote arguments are getting passed when requesting for > >> capabilities from DSP. Also there is no requirement to update the > >> PD type as it might cause problems for any PD other than user PD. > >> In addition to this, the collected capability information is not > >> getting copied properly to user. Add changes to address these > >> problems and get correct DSP capabilities. > >> > >> Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities") > >> Cc: stable > >> Signed-off-by: Ekansh Gupta > >> --- > >> ? drivers/misc/fastrpc.c | 7 +++---- > >> ? 1 file changed, 3 insertions(+), 4 deletions(-) > > > > > >> ????? if (err == DSP_UNSUPPORTED_API) { > >> ????????? dev_info(&cctx->rpdev->dev, > >> ?????????????? "Warning: DSP capabilities not supported on domain: %d\n", domain); > >> @@ -1783,7 +1782,7 @@ static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp) > >> ????? if (err) > >> ????????? return err; > >> ? -??? if (copy_to_user(argp, &cap.capability, sizeof(cap.capability))) > >> +??? if (copy_to_user(argp, &cap, sizeof(cap))) > > > > Why are we copying the full struct here? All that user needs is cap.capability? > as argp sent from user during ioctl is the capability structure, the > same argp is copied to a local fastrpc_ioctl_capability structure(cap) > to get the domain and attribute_id information. Copying just the > capability member to argp will cause problem when the user tries to > read the capability. While testing the capability, I was observing > this failure and it is resolved once we copy the information properly. What kind of failure? Which problems? Why do we need to get all the details from you by asking for more and more details. All this information must be explained in the commit message. [please wrap your lines in a some sensible way, I had to do that for you] > > > > > > > > --srini > > > > > >> ????????? return -EFAULT; > >> ? ????? return 0; > > > -- With best wishes Dmitry