lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 26 Sep 2019 00:34:58 +0000
From:   Anson Huang <anson.huang@....com>
To:     Leonard Crestez <leonard.crestez@....com>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        Aisheng Dong <aisheng.dong@....com>
CC:     "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH] firmware: imx: Skip return value check for some special
 SCU firmware APIs

Hi, Leonard

> On 25.09.2019 13:09, Anson Huang wrote:
> > The SCU firmware does NOT always have return value stored in message
> > header's function element even the API has response data, those
> > special APIs are defined as void function in SCU firmware, so they
> > should be treated as return success always.
> >
> > Signed-off-by: Anson Huang <Anson.Huang@....com>
> > ---
> > 	- This patch is based on the patch of
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
> >
> hwork.kernel.org%2Fpatch%2F11129553%2F&amp;data=02%7C01%7Cleonar
> d.cres
> >
> tez%40nxp.com%7Cc0ced6cd07f04023977008d741a07367%7C686ea1d3bc2b
> 4c6fa92
> >
> cd99c5c301635%7C0%7C0%7C637050029712216472&amp;sdata=Ccq%2Fb2R
> JdMqmnL7
> > VXrl8YhOlUwC7bWiUG%2BNmiw4OsSM%3D&amp;reserved=0
> > ---
> >   drivers/firmware/imx/imx-scu.c | 34
> ++++++++++++++++++++++++++++++++--
> >   1 file changed, 32 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/firmware/imx/imx-scu.c
> > b/drivers/firmware/imx/imx-scu.c index 869be7a..ced5b12 100644
> > --- a/drivers/firmware/imx/imx-scu.c
> > +++ b/drivers/firmware/imx/imx-scu.c
> > @@ -78,6 +78,11 @@ static int imx_sc_linux_errmap[IMX_SC_ERR_LAST] =
> {
> >   	-EIO,	 /* IMX_SC_ERR_FAIL */
> >   };
> >
> > +static const struct imx_sc_rpc_msg whitelist[] = {
> > +	{ .svc = IMX_SC_RPC_SVC_MISC, .func =
> IMX_SC_MISC_FUNC_UNIQUE_ID },
> > +	{ .svc = IMX_SC_RPC_SVC_MISC, .func =
> > +IMX_SC_MISC_FUNC_GET_BUTTON_STATUS }, };
> 
> Until now this low level IPC code didn't treat any svc/func specially and this
> seems good.
> 
> The imx_scu_call_rpc function already has an have_resp argument and
> callers are responsible to fill it. Can't we deal with this by adding an
> additional err_ret flag passed by the caller?

Can you make it more detail? The have_resp is a bool, so where to add the flag?
The caller ONLY passes imx_sc_ipc, imx_sc_rpc_msg and have_resp, ONLY
imx_sc_ipc can add a flag, is it what you meant? 

imx_scu_call_rpc(struct imx_sc_ipc *sc_ipc, void *msg, bool have_resp)

> 
> We can add wrapper functions to avoid tree-wide changes for all callers.

I agree, maybe we can add a new imx_scu_call_rpc function for those special APIs?
The new API will be ONLY for those APIs with response but without return value check,
then other callers will NOT be impacted, what do you think?

Thanks,
Anson

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ