Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14783748rwb; Mon, 28 Nov 2022 05:04:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf5+B/xTTzTt/u7YqsV+qFcwRi6Ne259Q1VGqs8tYFX50FBP3eldHHNKeplhzuMkev0S03cw X-Received: by 2002:a17:902:7b96:b0:186:9890:97cd with SMTP id w22-20020a1709027b9600b00186989097cdmr33256042pll.104.1669640692479; Mon, 28 Nov 2022 05:04:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669640692; cv=pass; d=google.com; s=arc-20160816; b=QNk+v4Cx5NoN4ko9j2CFH9hyTcQd18cqODq4EIlWLCl1gqD00/e4Buvu1TIyvsdvM6 pN4dyF8Zql1SKt4UlfY5BXWTVwov+rp4/oPxexAhp9oKNj8NxotwOVd2Cx8U7N+wGanQ j+yt7X6ikrRra2p7w1uEji2V6eS+LcB9maZKtkYn4neKGmiiSRLdh2tTo+d1nHl0d/Q6 vZ6Cjz6HuoRDPuZQ17a01v3+PL21vboKmklfFVHD00K3NaOX4fM5QuIu1r1VadpKvkaz ufoBO15Ozf54561EkRgVNO5whl3TQibRL5xLBrVn2/nIkCOTn8F3DcSPoJTle1Yn4CiE XdRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=4EbpFA7RMaCtROAnEWYDN69iJMuZ2r8XKziUTpDmfM0=; b=Vu/VkvyzKnqv20Nt/sK54yitEcRz6+Ev2ExARFWuM0eIFyBaTl0yJjTT+ihucICJ4t 8Dt5Q7ehKwQyCb9vNT9VMC+8f9kBYyvnKAI5cgfHlygEFfwy0nS+RWRYonlikxP3w7xb l6hSkwQzgtkzPuci0ZT3S7r+S70kh7gk1MsihKtztxIeWNfZfkp92LpyM2IEHvcakVrG m3yMAS9G0/be6BlQ4HjwkhQFi0ysq5iaKj5ff77XuhJjuzzaCZ8yHXHWX3my6jN9Mvrs DIpk08RZ0OADoosMuFFEYG4dyDsv5Al7v/gcNAp0tQL0MdIYZnKUle+TkujH0q2UsArO Wq+A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=da+1k3A+; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lxE9tTuE; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a170902e88300b0017c0d822437si12797413plg.82.2022.11.28.05.04.41; Mon, 28 Nov 2022 05:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=da+1k3A+; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=lxE9tTuE; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230410AbiK1Mfv (ORCPT + 84 others); Mon, 28 Nov 2022 07:35:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbiK1Mfs (ORCPT ); Mon, 28 Nov 2022 07:35:48 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AEB11A069 for ; Mon, 28 Nov 2022 04:35:45 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ASAfFtx015015; Mon, 28 Nov 2022 12:35:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=4EbpFA7RMaCtROAnEWYDN69iJMuZ2r8XKziUTpDmfM0=; b=da+1k3A+myApLE/o1qCovAnRkIWa2lnHXLMPuz9vbwtep+Do+zFvi6pUimO1LqxKgxbi k3pea5K41TJF86+AvJL0gR3i7rOPvM7pOefIbk3dlUR9jGct3sO6n7gTqe8xk1nzAEOz f4ov0B/xC7cckZdvbG0Q1+JUYWIu+4gx/2U0e9gRVDZLJCS2FbV1rxSt28323lFS5FwK fJFzV3iS51YOAMlqAsVBPcE/RGd7Bu3WUgIaFaS8Ydbzti0O7Ape57vYK043UoLenG0y eYQIg5aT3AZkGkjt0plWRg1HhgIGyMjr3YHnm4EcTTsDso68mwPoOZ7vIr+PiTB2n2N4 bg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3m40y3t57q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 12:35:37 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ASAKU4L022543; Mon, 28 Nov 2022 12:35:36 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3m3c1t7gw1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 12:35:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R/poaSM5l7fLpWBVxgWkgUXbF2GAvDO2TkSVOX/yu2FgJNBxW8Bi9UzFKngMfDUUmSPDQZfFk4jibieUR2XgrFCl250iqIULaBbqfyxUwQUcIsun6qw0blB2/Ga+7xkkQLTgpVQ1xyPQ/P3P2Gt638F+LlchxqSyR6gbVhJzrvjF2Y5teKOYaUh2VeFDdINgmAgB7XA3pDiiQ1DQUrcdyVwIKyjcvToKB5RfF8nmSB4mz7/seQ5OE3++CrXYh5+jARiXLEnJ/7Y3uClm6AONTFd5vExJg2fgzEufauFbuQFtzEGJaDqoyTWCiQZt2FKV1u8TjQSqBbfnCeewfi5mug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4EbpFA7RMaCtROAnEWYDN69iJMuZ2r8XKziUTpDmfM0=; b=XcuvLkcdFHwF/86ycQMomNE4pUA3oRcAR3BX3pZireqH+isOEABOuaQ21f9zRKfsGFo3F8NY0ZAX2tqbc8v+pqJk87fLKDcVakqwOan93UDcY0hLeMEu1iu733a8YSymkXShm9jqD0iRvwLRdep3RLNW4//8eehL6KuOu4IOqr/YMNL8G0gujuxhexFaXl6nXVGfuU2crT30i/1BLXI0kXZuVs54ReNDIRyPXX41WUYdWzx3c7e4Bx/SYTfDTolPY6+2ZcGqRUET7nnqjiJin9xleRZk8y0ywadGrOTptWuSBGh43tipnR7otzQCLTRnO13t0TckEwLNXCWcjJ7Lqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4EbpFA7RMaCtROAnEWYDN69iJMuZ2r8XKziUTpDmfM0=; b=lxE9tTuETHOfNT9LJjkhTrUGp+Vmd7JtT3AutQirI+kPY71jj8ekADm97zgZCRIDPKEqTj44/eH+c0Wf/SN5kwOqfMo9zAC7Ercw3Mggkq3Z1es/8BbFC0QVcliwc8JC0Ya5PqYTgBo0nyDewKYp603pXxeJDFms8jNWdajfyKQ= Received: from PH8PR10MB6290.namprd10.prod.outlook.com (2603:10b6:510:1c1::7) by SA1PR10MB5823.namprd10.prod.outlook.com (2603:10b6:806:235::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20; Mon, 28 Nov 2022 12:35:34 +0000 Received: from PH8PR10MB6290.namprd10.prod.outlook.com ([fe80::1717:5a07:63ca:fdab]) by PH8PR10MB6290.namprd10.prod.outlook.com ([fe80::1717:5a07:63ca:fdab%9]) with mapi id 15.20.5857.023; Mon, 28 Nov 2022 12:35:33 +0000 Message-ID: <7dc11da9-ddd5-d73e-ce76-7ecbd78b946a@oracle.com> Date: Mon, 28 Nov 2022 18:05:22 +0530 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v2] vduse: Validate vq_num in vduse_validate_config() Content-Language: en-US To: Stefano Garzarella , Dan Carpenter Cc: harshit.m.mogalapalli@gmail.com, "Michael S . Tsirkin" , Jason Wang , Xie Yongji , Gautam Dawar , Parav Pandit , Eli Cohen , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20221128083627.1199512-1-harshit.m.mogalapalli@oracle.com> <20221128105312.3ajursuudvmysiie@sgarzare-redhat> <20221128111310.6exrqi26grwspqcz@sgarzare-redhat> From: Harshit Mogalapalli In-Reply-To: <20221128111310.6exrqi26grwspqcz@sgarzare-redhat> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR04CA0180.apcprd04.prod.outlook.com (2603:1096:4:14::18) To PH8PR10MB6290.namprd10.prod.outlook.com (2603:10b6:510:1c1::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH8PR10MB6290:EE_|SA1PR10MB5823:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a4e95b2-f3ba-48b2-289f-08dad13d0b16 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wsS7NyTEw3suxNh0lzIfrOiKUiHRHx+OpwgOVgJ6nLO5gLFAQgBbh/y5MVz0TeTfsYY9f7wXpkQy+ICXPo6Oy6CwWuRX7fBKClJPN0/u0KVKVdt8sy3fFHVddGnZLWPRMXH7qpCx26/ZqTCiWbctBT7jc3FI0TOhjIrujnpAwDvOeavbcb8s2mRi9eQibg+ejYzaGhnKbpOGCCYjtiEJJ35a4AdCjbhAmw6VKcmaYbu5AQvSfvoTvUHJ9XXc9jzEqBSWkhME3KowbtaD06FIBIlxktEZ+2Xe8uVAng9Hy4WI3Z0jHblG7ebAPhrnj8IB4n50kReh8YmSBPAR1D9M73Nspqtf+nNYMx/KUO2ciHTcVoH+3xGKdkY2/VFAagGyDaibde1Qf+qRYDNoMcJZ0UrqLgIDjg8FGP/xGcvIgPL2mhhbHkM0C6p+NC8GlRb4QEL0aZ/tASxkMpylXmrTXfjqfsdSKRPKII5L3DqnD+qNpvqd9/4fO7R0jbj3spt7tUCkVvO00soQMy67QBP2eB9ZotjM/8tNDwmaVRr0EnxlxHyaRHjNDYxUceR657UFLgt3iTpnUNjS1ZoPDBr1k68ze0vNCyMDC5jnAR/wxt0wp3Tx76tTcXUzRR05s5ioYGCSrUlwo6MzOBYKJ0nWvERO8JDHHbylXi1fvZ7FMUDZpOB3ZhLxjYu4gh7Dxy5gdxdiNoiAu2A4ALoS+SHkACE0Dv5FkOoFrr6/FFyZL6L7yknVSf9FtaBkdj94QFOA X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR10MB6290.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(366004)(376002)(136003)(39860400002)(346002)(451199015)(15650500001)(316002)(478600001)(2906002)(186003)(6506007)(86362001)(36756003)(8676002)(66556008)(66476007)(31696002)(4326008)(83380400001)(66946007)(53546011)(26005)(6512007)(54906003)(6666004)(2616005)(110136005)(6486002)(966005)(38100700002)(31686004)(41300700001)(8936002)(7416002)(5660300002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eWpTN0hmRFFPU3BVM3E4TWhMbEZRWkJrQUxWU1JpSFljaHJtL3piMjU4ZG1F?= =?utf-8?B?cHE1VTVZL280RkVGQUorK1JpaW5tU3BzTHZSR0Jtb29hOEREVGZnaUpHamV3?= =?utf-8?B?TG0vVjB2RElqSGtOR1ppVHRxQmUvbmgwQU1ZQ3QzUkJwcXlWRDh0ZWlDN2Jk?= =?utf-8?B?dkNOcmZ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lZN1I1b29NQllEYmp6UFFBbDdmbmNrZlBxUkZJQnNC?= =?utf-8?Q?O6DUbU=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a4e95b2-f3ba-48b2-289f-08dad13d0b16 X-MS-Exchange-CrossTenant-AuthSource: PH8PR10MB6290.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2022 12:35:33.8381 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CxQyPMZUhVWRVN7ZPuCGZW7+AvXcvJizwRjLOxvuqljbz/vV68zTBj3ZBalC7I6Q38INp20cBLykhZMUVGtFcJfPGaZW9uCmNOClUIIOClTst7GDGa4q7rJlRDjSxrmU X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR10MB5823 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_10,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 suspectscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211280096 X-Proofpoint-GUID: -_T4VMPrgebqVfUMeL_XysUALASxWWe6 X-Proofpoint-ORIG-GUID: -_T4VMPrgebqVfUMeL_XysUALASxWWe6 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/11/22 4:43 pm, Stefano Garzarella wrote: > On Mon, Nov 28, 2022 at 01:58:00PM +0300, Dan Carpenter wrote: >> On Mon, Nov 28, 2022 at 11:53:12AM +0100, Stefano Garzarella wrote: >>> On Mon, Nov 28, 2022 at 12:36:26AM -0800, Harshit Mogalapalli wrote: >>> > Add a limit to 'config->vq_num' which is user controlled data which >>> > comes from an vduse_ioctl to prevent large memory allocations. >>> > >>> > This is found using static analysis with smatch. >>> > >>> > Suggested-by: Michael S. Tsirkin >>> > Signed-off-by: Harshit Mogalapalli >>> > --- >>> > v1->v2: Change title of the commit and description, add a limit to >>> >     vq_num. >>> > >>> > Note: I think here 0xffff is the max size of vring =  no: of vqueues. >>> > Only compile and boot tested. >>> > --- >>> > drivers/vdpa/vdpa_user/vduse_dev.c | 3 +++ >>> > 1 file changed, 3 insertions(+) >>> > >>> > diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c >>> b/drivers/vdpa/vdpa_user/vduse_dev.c >>> > index 35dceee3ed56..31017ebc4d7c 100644 >>> > --- a/drivers/vdpa/vdpa_user/vduse_dev.c >>> > +++ b/drivers/vdpa/vdpa_user/vduse_dev.c >>> > @@ -1440,6 +1440,9 @@ static bool vduse_validate_config(struct >>> vduse_dev_config *config) >>> >     if (config->config_size > PAGE_SIZE) >>> >         return false; >>> > >>> > +    if (config->vq_num > 0xffff) >>> >>> What about using U16_MAX here? >> >> Where is the ->vq_num stored in a u16?  I looked for this but didn't >> see it. > > I thought vq_num referred to the number of elements in the vq (like > .get_vq_num_max), since this patch wants to limit to 0xffff. > > But it actually refers to the number of virtqueue, so @Harshit why do we > limit it to 0xffff? > Hi Stefano, I may be incorrect about the details of this driver, my v1 was purely based on static analysis, Micheal suggested me to put a limit of 0xffff on vq_num. I really don't know about the driver, while I was searching other parts of code, I thought 0xffff is based vring size, I have asked the same question on v1 today. Ref to v1: https://lore.kernel.org/all/82e8ce27-0743-59bf-fbe8-a25093167451@oracle.com/ > Maybe we should explain it in the commit message or in a comment. > yeah, we should clarify the limit in commit message, once Micheal shares about the limit '0xffff), I will add those details and send a next version if that's okay. Thanks, Harshit > Thanks, > Stefano >