Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp518417lqt; Thu, 6 Jun 2024 10:00:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXcDwdMbx/nQ9MDlfybDI7Lj3oiq/Gxl6DcvDpJnqrfuuQ2zud6/J4yK5/YKATUw9x9A0owWBIMq+NrYKVFFeDVnqP45TNG3ZvxZBNAg== X-Google-Smtp-Source: AGHT+IEoyfceJ4M08hSXeFjZkN48g8184NzQH6WbIylzH/crV/crudOml9w5HstzPGoO28+3EUFL X-Received: by 2002:a25:db81:0:b0:dfa:4adc:e91c with SMTP id 3f1490d57ef6-dfacad043fcmr6471385276.48.1717693253903; Thu, 06 Jun 2024 10:00:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717693253; cv=pass; d=google.com; s=arc-20160816; b=vV65f5xw0ZNO6bG+XrYwEtukHbmqgsgPPTeKR1sKgrT0HHrqyJFOZyXKVotptomPlV exqzdrsAKZUZRYh9fKyOQjAqzIc6cBVd0EIlxrkY3yaBtOs11Dut8YEVDhUm3b1pIOeR nvftY1T1uaBylOm92OaDjHXgemFtdV6OHltSPeOOCdncj7i8PWR88B5E7xldn9L9rw3J oRMCbRtbXB8XgmVFP1tu53oh6u0hChkMPuMc+7N2/fH6j6nPsEPFBRQEb333PHuXFbYg V91IgGzeDIOw6QSL3Khj++q1/5EbPrNwVxYPPhIofUQEPQ43vHcgyJNFHf6i4ICQd3ie oxDg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=JeGmrY8OXnZ3YVEIn1zPLWxZ7SRciUEFKi3FPZ4j1ss=; fh=diZmGYJcu01zmNbcPcyhEp2Q9qdQcYqGq04YRZeL26M=; b=HWO1mb+2/7YkaqW3trLznqdZDFnHk109JrqF19aZQLh7rl+TJdvjFIRvc5EOSL4WcG AZHxqx+yikKYwuCvsH2/yRXjtUQrmGP/CFQTsoNKGFFZYlLg9a7BPv/1wyPraeu4QsLQ 8q+WNSDvpPleSBSidHZj8BS9+8cQaVonB68NngWAMFxwtq58yYxfT/ct+kwxJE7/rjT7 TBxn96QH2iXIssT9V15qSGVlj+31A/rf2FgfVGUclseMDSGk9NIukZEUcOZ0SMS5uJMr Fp8NDStDH8YazYMsaBkKFkbZ/STdmfI3DA8pihDk8uglOn+mo0T1bjKWPecUxoAi8jqb AEjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bTHMBH2W; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-204751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 3f1490d57ef6-dfae53cbeb9si850642276.349.2024.06.06.10.00.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:00:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bTHMBH2W; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-204751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E2B71C2257C for ; Thu, 6 Jun 2024 17:00:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4791B199225; Thu, 6 Jun 2024 17:00:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="bTHMBH2W" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CA8A1991B5; Thu, 6 Jun 2024 17:00:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717693206; cv=none; b=sLhJhsx8W2bC1R+FJ5HWspgj5Z8Wa0IWXNk6AN8izoWMC8C5t75iswmHTZinguDkeJxAsqNWW5T+EeeoutjWlfGHknRi3t7C72gkDTt8P+Ogqt9W/Iphz/TCwBg4BdE22ayCPPOYWqCJLfo4unWnbVS2vzVz6SKEcwXezT73Q3M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717693206; c=relaxed/simple; bh=RvbKEsTYGjqaQhxET2/jnVy4gPowJaUvtUs85qFJ5kI=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FOswSmAwwKVRHa5HFBsIRt2QhxNmmO3p7/cXmc5ZQcmifnV72urr8M22vcDEZqdYfO3tq8WKc4kGNnxzm6DTnUMECc9vWJKytrq8nhFIHjAWIoc730K5brqjABWRsDBgblhdoDljUY9Fr555E32QIjmuIgFyLAwKd2BWQjE7OBc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=bTHMBH2W; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45684lfB013970; Thu, 6 Jun 2024 16:59:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JeGmrY8OXnZ3YVEIn1zPLWxZ7SRciUEFKi3FPZ4j1ss=; b=bTHMBH2WlUMPzBA8 Y5q9C3VO2jHmk67GIGBfAQzgEbaGQRqPnVLO4LnyXwEKnhePlp0PbaPVet66W8CV fDU8Uc4wNEoDttNU6+aDOMGyf4yzqPIviX3mu63eAPs/XUK6CnIHBAhqqP14vpzX 8LATyB/GFHehigze5WDA4NOQueCcMLNFuoGFupq2GxPt20bpdg4l3ps++mZUdOqH oU1BQ9a+7qU/sGr3QbRVyB97VyV532kEmO1OgRx5gZEy/d11ooXAdOHtIYRPadPi A3U0JPw/FnU9VA2WLCJIA5/56XxYP9HmaJGHb1uwwrNydjJVyQjS40hDA1SDRf6m TQo7rQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yjvxyarcm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jun 2024 16:59:59 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 456Gxwl9014715 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 6 Jun 2024 16:59:58 GMT Received: from hu-ekangupt-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 6 Jun 2024 09:59:55 -0700 From: Ekansh Gupta To: , CC: , , , , stable Subject: [PATCH v4 03/11] misc: fastrpc: Copy the complete capability structure to user Date: Thu, 6 Jun 2024 22:29:23 +0530 Message-ID: <20240606165939.12950-4-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240606165939.12950-1-quic_ekangupt@quicinc.com> References: <20240606165939.12950-1-quic_ekangupt@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 4Ja9e8xeU_YMcEYpH_V0JaNTLkJl-bO5 X-Proofpoint-GUID: 4Ja9e8xeU_YMcEYpH_V0JaNTLkJl-bO5 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-06_13,2024-06-06_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 spamscore=0 mlxscore=0 adultscore=0 bulkscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406060120 User is passing capability ioctl structure(argp) to get DSP capabilities. This argp is copied to a local structure to get domain and attribute_id information. After getting the capability, only capability value is getting copied to user argp which will not be useful if the use is trying to get the capability by checking the capability member of fastrpc_ioctl_capability structure. Add changes to copy the complete capability structure so that user can get the capability value from the expected member of the structure. Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities") Cc: stable Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index abf7df7c0c85..f64781c3012f 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -1784,7 +1784,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))) return -EFAULT; return 0; -- 2.43.0