From: Greg KH <gregkh@linuxfoundation.org>
To: huangchenghai <huangchenghai2@huawei.com>
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
Date: Sat, 30 Mar 2024 08:01:58 +0100 [thread overview]
Message-ID: <2024033032-catalyze-clip-cc53@gregkh> (raw)
In-Reply-To: <d6890b98-2f75-4077-b7bc-e995e9901574@huawei.com>
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
next prev parent reply other threads:[~2024-03-30 7:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-29 6:26 [PATCH] misc: uacce - add the null check for the input pointer and its pointer members Chenghai Huang
2024-03-29 6:34 ` Greg KH
[not found] ` <d6890b98-2f75-4077-b7bc-e995e9901574@huawei.com>
2024-03-30 7:01 ` Greg KH [this message]
2024-03-30 7:10 ` huangchenghai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024033032-catalyze-clip-cc53@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=fanghao11@huawei.com \
--cc=huangchenghai2@huawei.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=qianweili@huawei.com \
--cc=shenyang39@huawei.com \
--cc=wangzhou1@hisilicon.com \
--cc=zhangfei.gao@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox