Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp377822lqz; Sat, 30 Mar 2024 00:02:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXuBG46FK/U1rEy0bMddSavGXXWd0J8PVsOyknew/+2y42/k09L1JhOHI9y7ip5hvKwHca9EIMHspzRl72fIpTHhpTMgDHcZx1qL9//4g== X-Google-Smtp-Source: AGHT+IGY+WIYzGZb9aU4NEK+7Ht54k08phKtqjpiNurT1w1X2RLtEkQGDz5AnwvRVwxihV3oqrSI X-Received: by 2002:a17:902:c408:b0:1de:f82b:4c53 with SMTP id k8-20020a170902c40800b001def82b4c53mr5275534plk.12.1711782128435; Sat, 30 Mar 2024 00:02:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711782128; cv=pass; d=google.com; s=arc-20160816; b=diB/2bPt8Y7HlCMwjRHTW7uxfK8P9NTEdY0+l0kAN4rC/R0YZth68gaZ5I8r5DJ0Pv giNGdY8h8VluEkOt9XqlTBaIygcIBcp7mC7pKikVZkaoexTRPZkpweJycWSJPyz5KFhg cuBFiVJfKx0vl6Zmhzt5W1COe3h7jr4LTVvdjYk7O6AxbiJzJIfNQpoQxEWJrvsaiyQL gCRsT1Zvn+UWm1/xmmlkQABz6YtVpUTkhVLblLWGC5N1Yv689PAQ4iDI1jtXDzJmfI2L uwwcc1nHvEwoNILmtO6psYdRNM9i8bxCel3Lh15pmJuUSR1WTLmaAhxi8V0I0SE6y14P OPfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nAac9q+rh4Nn+uqHygW1ZVTwRVZwplNXjlpCW2AbvfI=; fh=0ZwglZVn0rRPoj85FxoF1yZz8XoOmwxqWLSv050CrGI=; b=JjBGlE6wIj2D6omDMuEHERQaakMCE6CHA+r3EDz7Ev092kSF7EOP0n66/f1MPY7fby 6cByaYwkVWJy9mVtUcqxmJn7GuwfsSrZGpIyw87SbNqmMgF0NzWN8KTHoyZBHROb+gZg qEZIWzFPT4pljy0DnV+DvyZqWjb08o9rhdByBYkr2d4Mg1ex0cyBVzT+/JRvfDOENS6E muKqrA17AqYVKpD1WeQsGNhmYcIXD4FQ44Ahbm0s8oXAlweWbN7PTHDAZKdC3mIBLYQM L6i9gIr4gWOLrv/qt6tODemvKNZ6iRFEMUtrqg8vhXjg5MPx/sIhSHaREx6B670NWfbY OBWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hsmzPOv9; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-crypto+bounces-3117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x1-20020a170902a38100b001e0334705cbsi4854047pla.597.2024.03.30.00.02.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 00:02:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3117-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=@linuxfoundation.org header.s=korg header.b=hsmzPOv9; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-crypto+bounces-3117-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3117-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 E21252832A1 for ; Sat, 30 Mar 2024 07:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84DCD1C2E; Sat, 30 Mar 2024 07:02:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hsmzPOv9" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 27E9C15C9; Sat, 30 Mar 2024 07:02:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711782122; cv=none; b=aYEnm2lRH7GefgRv9/vGa7UdE4oimmT18SjFkzzIVuuNdfqxSvJ+1pLXixAmaptRwvI43JgQKDkzBhtCMsnoJr2tPULpx99DIsRWwbu2dg/geRy0p2pE0ov7eFEo29VlUTuH643Pqfnor/1aknBDx7o+6oZRkNzKjrc24EirpuA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711782122; c=relaxed/simple; bh=O4wckmnDJN6tmHm/co3JNjiGRyBlU/oyI7RcHQ5Ak6w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E0+L1WxEOspsHuos912Zl1KYlOZlRrerg8Y4m/olYU2JB1u+bePzP8gDvxTBPHBYnPKqe9wpyqLzEYcrg6I/2hmjVBNM4oe3xgfAS2NULkJ80IiZ71BZR70ICTuyWkLrUv9uxcETI22QdFkfTxzQasa66tqvQv2SHkgNHLegQls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hsmzPOv9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A319C433C7; Sat, 30 Mar 2024 07:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711782121; bh=O4wckmnDJN6tmHm/co3JNjiGRyBlU/oyI7RcHQ5Ak6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hsmzPOv9su16zl407BXCQi1S18XVGnKG4dLtikfKI7oobxpHk13sQDub3szzO7sk1 A6wGiHkn+y/lcOVXTWjFNjz6P5mlcE2VVbxhu4LrxpxDL6nT3tlsJhh35K8HdezNJk 28V8JsVegoWOGlBpnEqHX32F3CLXFyIFqHcydH9A= Date: Sat, 30 Mar 2024 08:01:58 +0100 From: Greg KH To: huangchenghai Cc: zhangfei.gao@linaro.org, wangzhou1@hisilicon.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, fanghao11@huawei.com, shenyang39@huawei.com, liulongfang@huawei.com, qianweili@huawei.com Subject: Re: [PATCH] misc: uacce - add the null check for the input pointer and its pointer members Message-ID: <2024033032-catalyze-clip-cc53@gregkh> References: <20240329062655.3055646-1-huangchenghai2@huawei.com> <2024032946-supernova-unstaffed-63ec@gregkh> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Mar 30, 2024 at 11:34:24AM +0800, huangchenghai wrote: > > On Fri, Mar 29, 2024 at2:34PM, Greg KH wrote: > > > On Fri, Mar 29, 2024 at 02:26:55PM +0800, Chenghai Huang wrote: > > > The uacce_alloc() is the member of the EXPORT_SYMBOL_GPL. Therefore, null > > > pointer verification is added on the pointer type input parameter and its > > > pointer members. > > I do not understand, why does the export type matter? Just fix any > > callers to use this properly and send proper parameters. What in-tree > > caller needs this? > > > > thanks, > > > > greg k-h > > The interface defined by the export type seems important and the input > parameters need to be verified. The export type does not matter at all. > But I understand from your mail that this is the job of the caller. Exactly. > By the way, I still have a confusion. Interfaces like ioctrl, debugfs, read, > or write require parameter validation. so what kind of kernel interfaces require > parameter validation? Is there a definition? Some do, some do not, it depends on the situation. If data comes from an untrusted source (i.e. outside the kernel), then it MUST be validated (remember "all input is evil"), but if it's from within the kernel, usually it does not. thanks, greg k-h