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]
Message-ID: <000801d6cd29$635534d0$29ff9e70$@samsung.com>
Date:   Tue, 8 Dec 2020 11:44:26 +0530
From:   "Pankaj Dubey" <pankaj.dubey@...sung.com>
To:     "'Krzysztof Kozlowski'" <krzk@...nel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-samsung-soc@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Cc:     "'Sylwester Nawrocki'" <snawrocki@...nel.org>,
        "'Marek Szyprowski'" <m.szyprowski@...sung.com>,
        "'Bartlomiej Zolnierkiewicz'" <b.zolnierkie@...sung.com>,
        "'Arnd Bergmann'" <arnd@...db.de>,
        "'Chanwoo Choi'" <cw00.choi@...sung.com>,
        "'Alim Akhtar'" <alim.akhtar@...sung.com>, <stable@...r.kernel.org>
Subject: RE: [PATCH v2 2/4] soc: samsung: exynos-asv: handle reading
 revision register error



> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@...nel.org>
> Sent: Tuesday, December 8, 2020 12:35 AM
> To: Krzysztof Kozlowski <krzk@...nel.org>; linux-arm-
> kernel@...ts.infradead.org; linux-samsung-soc@...r.kernel.org; linux-
> kernel@...r.kernel.org
> Cc: Sylwester Nawrocki <snawrocki@...nel.org>; Marek Szyprowski
> <m.szyprowski@...sung.com>; Bartlomiej Zolnierkiewicz
> <b.zolnierkie@...sung.com>; Arnd Bergmann <arnd@...db.de>; Chanwoo
> Choi <cw00.choi@...sung.com>; Alim Akhtar <alim.akhtar@...sung.com>;
> Pankaj Dubey <pankaj.dubey@...sung.com>; stable@...r.kernel.org
> Subject: [PATCH v2 2/4] soc: samsung: exynos-asv: handle reading revision
> register error
> 
> If regmap_read() fails, the product_id local variable will contain random
value
> from the stack.  Do not try to parse such value and fail the ASV driver
probe.
> 
> Fixes: 5ea428595cc5 ("soc: samsung: Add Exynos Adaptive Supply Voltage
> driver")
> Cc: <stable@...r.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
> ---
>  drivers/soc/samsung/exynos-asv.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/samsung/exynos-asv.c
> b/drivers/soc/samsung/exynos-asv.c
> index f653e3533f0f..5daeadc36382 100644
> --- a/drivers/soc/samsung/exynos-asv.c
> +++ b/drivers/soc/samsung/exynos-asv.c
> @@ -129,7 +129,13 @@ static int exynos_asv_probe(struct platform_device
> *pdev)
>  		return PTR_ERR(asv->chipid_regmap);
>  	}
> 
> -	regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PRO_ID,
> &product_id);
> +	ret = regmap_read(asv->chipid_regmap,
> EXYNOS_CHIPID_REG_PRO_ID,
> +			  &product_id);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "Cannot read revision from
> ChipID: %d\n",
> +			ret);
> +		return -ENODEV;
> +	}
> 
>  	switch (product_id & EXYNOS_MASK) {
>  	case 0xE5422000:
> --
> 2.25.1

Reviewed-by: Pankaj Dubey <pankaj.dubey@...sung.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ