Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp380455lqz; Sat, 30 Mar 2024 00:10:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUlz86n9NUXTsMJN8c0kCbKAkRshc4DDnyrMrZuHJUJ0Oc1DBXxw7uK0JwFudV1YgsrfKIfqlBOiSQooe87sbpeWmgNZOfsWe1bYWrzbQ== X-Google-Smtp-Source: AGHT+IHPMRm8pEeBvqk+QpB3UmpIuGvJ+VkWQ9mHvZD3dbVKx9G51nBCc7DBKuArooJkFosl/y7S X-Received: by 2002:a17:902:c394:b0:1e1:a53:c366 with SMTP id g20-20020a170902c39400b001e10a53c366mr3484230plg.22.1711782629531; Sat, 30 Mar 2024 00:10:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711782629; cv=pass; d=google.com; s=arc-20160816; b=XY9yAVHMK4jegDsPk6/NIU17UqfEAveEc1HjvoKN7nMTpgkr6Plpn4cKqTWnIxwKiz g7s4ybMeMz7M5cZBI2fATQAfkVyuYmwEm4jYPLlFn7Z5DG+AyxooASPci6xRd/ogA//e 2L6tLfjDhzQhHkU8uG/KRZkozv51DCpW6Hp5WCLJAOycKH5U56zKKwSiPbE4PLk6uRgi PdQS+PQylWAOOK0laXqM5VQsZYtAskAHveiFNlNNU/71frxA09AJo05R1Rur6zdC6Sqx JkZgmGvw/awj4E1g1GHu/I0Imp98DHYOzm+pdD+nGcGq6i1wPet/cIduzIdK2H7wYTBI jupw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id; bh=xUImwFsojbxHV0RIwVfnM7xnU2Mq4v40ek7XsbZtWmI=; fh=oXvSNGWNQYP0vlfjoQ2ivWamSEYAfnSP1rjJ9qi7mdY=; b=bl4ftA5x3skKk6hVBTcM/FBqSyljZf32Wu67KfWslaXb7iDjOyeqU+Ali/uXnADdwl 9O4YGz5zsDHLzVEYhd8B1n+PdRFcz4BBlEh58EhvvA1T0NoVMVcXmHgW+iOeQKyxjjkq l2ZjYZxDNbrW+0WsVpRO9Tl9YKcvFC7zBmH1+/53FmJBWyIwRIPYFJicrjN43x2wWlL+ 2IJut/n7uVhTcWmO890zrHqun7I70/tpAOduK//5Hu8hoX6Qp7sjYrUNXFMZLLC+DwJl xPgNOary0zbg1KeJc/7WVVmWr4hgBjuCD7Hx3OHmDHj4ms9a+eaYzI7+7PzQWr4XcVJX fYGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-125613-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e3-20020a170902ef4300b001db45912e79si5287202plx.594.2024.03.30.00.10.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 00:10:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125613-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-125613-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125613-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 38C3E28372E for ; Sat, 30 Mar 2024 07:10:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B3BA79ED; Sat, 30 Mar 2024 07:10:21 +0000 (UTC) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) (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 A829B7FB; Sat, 30 Mar 2024 07:10:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711782621; cv=none; b=sLVUoNhemXUF3SqdS0UKOvPLPwVDzqr8ea0lgFcIrND2ojig2D2ENOpqmX1F6NtUb+ZCcdJXl112j9r+K+MqRDC3sQoiwR94/dKvTBy/FJU0ME3cO43NRwbw7SoMUgNXx/sV5T++T9CtmZl5rdDO9bgP230bDSSCaZzY635+epI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711782621; c=relaxed/simple; bh=r4Oy+hqcgYLrYbY0rLIagGI+zMskFwfr1KTW2NYfuyY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=bFUOqHscGoQX5QLi+WgIL9sCpgSU6WHC7q27XESWGWVD5HMqNeFoUP0Enmz2tpMoEjCXzyW95N5Y6zrwD5hpJ8pxNH4qPYwBVx4eGjmdWwcSKDWd11W8mslP6Ojk71M6KDF2aETf1GGDetJrVWd79Iez7acvN0NxrwK5SeFesRQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4V67f256PbzNmnP; Sat, 30 Mar 2024 15:08:10 +0800 (CST) Received: from dggpemd200003.china.huawei.com (unknown [7.185.36.122]) by mail.maildlp.com (Postfix) with ESMTPS id B1FD514010C; Sat, 30 Mar 2024 15:10:14 +0800 (CST) Received: from [10.67.120.171] (10.67.120.171) by dggpemd200003.china.huawei.com (7.185.36.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Sat, 30 Mar 2024 15:10:14 +0800 Message-ID: <2251e63b-01f9-415f-bae3-9c64b7d7a7ac@huawei.com> Date: Sat, 30 Mar 2024 15:10:14 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] misc: uacce - add the null check for the input pointer and its pointer members To: Greg KH CC: , , , , , , , References: <20240329062655.3055646-1-huangchenghai2@huawei.com> <2024032946-supernova-unstaffed-63ec@gregkh> <2024033032-catalyze-clip-cc53@gregkh> From: huangchenghai In-Reply-To: <2024033032-catalyze-clip-cc53@gregkh> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemd200003.china.huawei.com (7.185.36.122) 在 2024/3/30 15:01, Greg KH 写道: > 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 I get it, thank you very much. thanks, Chenghai