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:   Fri, 5 Mar 2021 18:11:20 +0100
From:   Loic Poulain <loic.poulain@...aro.org>
To:     Bhaumik Bhatt <bbhatt@...eaurora.org>
Cc:     Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        Hemant Kumar <hemantk@...eaurora.org>,
        Jeffrey Hugo <jhugo@...eaurora.org>,
        open list <linux-kernel@...r.kernel.org>,
        Carl Yin(殷张成) <carl.yin@...ctel.com>,
        Naveen Kumar <naveen.kumar@...ctel.com>
Subject: Re: [PATCH v2] bus: mhi: core: Add missing checks for MMIO register entries

On Thu, 4 Mar 2021 at 23:14, Bhaumik Bhatt <bbhatt@...eaurora.org> wrote:
>
> As per documentation, fields marked as (required) in an MHI
> controller structure need to be populated by the controller driver
> before calling mhi_register_controller(). Ensure all required
> pointers and non-zero fields are present in the controller before
> proceeding with registration.
>
> Signed-off-by: Bhaumik Bhatt <bbhatt@...eaurora.org>
> ---
>  drivers/bus/mhi/core/init.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bus/mhi/core/init.c b/drivers/bus/mhi/core/init.c
> index 272f350..fed8a25 100644
> --- a/drivers/bus/mhi/core/init.c
> +++ b/drivers/bus/mhi/core/init.c
> @@ -879,10 +879,9 @@ int mhi_register_controller(struct mhi_controller *mhi_cntrl,
>         u32 soc_info;
>         int ret, i;
>
> -       if (!mhi_cntrl)
> -               return -EINVAL;
> -
> -       if (!mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put ||
> +       if (!mhi_cntrl || !mhi_cntrl->cntrl_dev || !mhi_cntrl->regs ||
> +           !mhi_cntrl->fw_image || !mhi_cntrl->irq ||

Can we make fw_image optional, not all MHI devices are flashless, some
directly boot into AMSS without firmware loading.

> +           !mhi_cntrl->runtime_get || !mhi_cntrl->runtime_put ||
>             !mhi_cntrl->status_cb || !mhi_cntrl->read_reg ||
>             !mhi_cntrl->write_reg || !mhi_cntrl->nr_irqs)
>                 return -EINVAL;
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ