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, 12 Nov 2021 09:17:28 +0800
From:   Yong Wu <yong.wu@...iatek.com>
To:     AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
CC:     Krzysztof Kozlowski <krzk@...nel.org>,
        Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>,
        Robin Murphy <robin.murphy@....com>,
        "Tomasz Figa" <tfiga@...omium.org>,
        <linux-mediatek@...ts.infradead.org>,
        <srv_heupstream@...iatek.com>, <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <iommu@...ts.linux-foundation.org>, <youlin.pei@...iatek.com>,
        <anan.sun@...iatek.com>, <yi.kuo@...iatek.com>,
        <anthony.huang@...iatek.com>, Ikjoon Jang <ikjn@...omium.org>,
        Hsin-Yi Wang <hsinyi@...omium.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Matthias Brugger <matthias.bgg@...il.com>
Subject: Re: [PATCH v2] memory: mtk-smi: Fix a null dereference for the ostd

Hi AngeloGioacchino,

Thanks very much for your help review.

On Thu, 2021-11-11 at 14:41 +0100, AngeloGioacchino Del Regno wrote:
> Il 08/11/21 09:24, Yong Wu ha scritto:
> > We add the ostd setting for mt8195. It introduces a KE for the
> > previous SoC which doesn't have ostd setting. This is the log:
> > 
> > Unable to handle kernel NULL pointer dereference at virtual address
> > 0000000000000080
> > ...
> > pc : mtk_smi_larb_config_port_gen2_general+0x64/0x130
> > lr : mtk_smi_larb_resume+0x54/0x98
> > ...
> > Call trace:
> >   mtk_smi_larb_config_port_gen2_general+0x64/0x130
> >   pm_generic_runtime_resume+0x2c/0x48
> >   __genpd_runtime_resume+0x30/0xa8
> >   genpd_runtime_resume+0x94/0x2c8
> >   __rpm_callback+0x44/0x150
> >   rpm_callback+0x6c/0x78
> >   rpm_resume+0x310/0x558
> >   __pm_runtime_resume+0x3c/0x88
> > 
> > In the code: larbostd = larb->larb_gen->ostd[larb->larbid],
> > if "larb->larb_gen->ostd" is null, the "larbostd" is the
> > offset(e.g.
> > 0x80 above), it's also a valid value, then accessing "larbostd[i]"
> > in the
> > "for" loop will cause the KE above. To avoid this issue, initialize
> > "larbostd" to NULL when the SoC doesn't have ostd setting.
> > 
> > Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> > ---
> > change note: Reword the commit message to show why it KE. and
> > update the
> > solution via initializing "larbostd" is NULL explicitly in the non-
> > ostd
> > case.
> > ---
> >   drivers/memory/mtk-smi.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> 
> This commit needs a Fixes tag. Please add the proper one.

This should fix this one:

fe6dd2a4017d ("memory: mtk-smi: mt8195: Add initial setting for smi-
larb")

But the commit id comes from linux-next. I'm not sure if the sha-id
will be changed again when enter mainline. so I didn't add it.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ