open-power / libekb_p10

Apache License 2.0
0 stars 12 forks source link

stack smashing issue during HWP execution #15

Open devenrao opened 2 years ago

devenrao commented 2 years ago

Noticing stack smashing issue during HWP exection.

Jun 01 15:01:28 xxx openpower-dump-manager[22238]: Adding handler for id(30000001), type(10), path(/xyz/openbmc_project/dump/sbe/entry/30000001), pid(29203)
Jun 01 15:01:28 xxx dump-collect[29171]: dump requested (waiting)
Jun 01 15:01:29 xxx openpower-dump-manager[29203]: *** stack smashing detected ***: terminated            <<=========== Dac
Jun 01 15:01:29 xxx systemd[1]: Started Process Core Dump (PID 29208/UID 0).

libekb-p10 is built by default with -fstack-protector-strong flag due to this any buffer access or invalid size will result in stack smashing issue.

At present disabling stack protection using recipe level patch, but we need to revisit after fixing the compiler warnings during the ekb hardware procedure build.

devenrao commented 2 years ago

This is the code change done which we need to revert

-bash-4.2$ diff Makefile.am Makefile.am.mod 
207c207
<       -fpermissive -fno-exceptions -fno-rtti \
---
>       -fpermissive -fno-exceptions -fno-stack-protector -fno-rtti \
devenrao commented 2 years ago

busctl --verbose call org.open_power.Dump.Manager /org/openpower/dump xyz.openbmc_project.Dump.Create CreateDump a{sv} 3 "com.ibm.Dump.Create.CreateParameters.DumpType" s "com.ibm.Dump.Create.DumpType.Hardware" "com.ibm.Dump.Create.CreateParameters.ErrorLogId" t 0xDEADBEEF "com.ibm.Dump.Create.CreateParameters.FailingUnitId" t 3

run this command at istep 8.4