[Skiboot] [PATCH v3] hdata: Prevent NULL dereference on duplicate entries in TPMREL section

Mahesh J Salgaonkar mahesh at linux.ibm.com
Fri Apr 4 04:19:26 AEDT 2025


On 2025-03-28 18:22:07 Fri, Dan Horák wrote:
> On Thu, 27 Mar 2025 10:44:54 +0530
> Mahesh Salgaonkar <mahesh at linux.ibm.com> wrote:
> 
> > Currently if you encounter duplicate entries in TPMREL section while
> > parsing HDAT, opal crashes with bellow back trace:
> > 
> > [  119.205498180,3] DT: dt_attach_root failed, duplicate ibm,cvc-service at 40
> > [  119.206975658,3] ***********************************************
> > [  119.208669044,3] Fatal MCE at 000000003003729c
> > .dt_find_property+0x30  MSR 9000000000001002
> > [  119.210355268,3] Cause: unknown error
> > [  119.211273270,3] CFAR : 0000000030037288 MSR  : 9000000000001002
> > [  119.212502638,3] SRR0 : 000000003003729c SRR1 : 9000000000001002
> > [  119.214037362,3] HSRR0: 0000000030020024 HSRR1: 9000000000001000
> > [  119.215266730,3] DSISR: 40000000         DAR  : a600607d01006b79
> > [...]
> > CPU 0008 Backtrace:
> >  S: 0000000031c53980 R: 0000000030026b0c   .__memalign+0x58
> >  S: 0000000031c53a10 R: 0000000030037378   .new_property+0xb0
> >  S: 0000000031c53aa0 R: 0000000030037778   .__dt_add_property_strings+0x58
> >  S: 0000000031c53b40 R: 000000003010bf74   .node_stb_parse+0x414
> >  S: 0000000031c53c30 R: 0000000030102ee4   .parse_hdat+0x20cc
> >  S: 0000000031c53e30 R: 0000000030022c04   .main_cpu_entry+0x1d0
> >  S: 0000000031c53f00 R: 000000003000321c   go_primary+0x10c
> >  --- OPAL boot ---
> > 
> > fix the null pointer deref and proceed with warning message instead of
> > crashing. Also add debug prints to display all entries.
> > 
> > Signed-off-by: Mahesh Salgaonkar <mahesh at linux.ibm.com>
> > Reviewed-by: Madhavan Srinivasan <maddy at linux.ibm.com>
> 
> thanks, TPM vs TMP is easy to swap and confusing :-)

Yes it is :-) Thanks for catching it.

> 
> Reviewed-by: Dan Horák <dan at danny.cz>

Thanks for your review.
-Mahesh



More information about the Skiboot mailing list