Menu

#1907 Fix double free in sysfs

3.7.0
closed-fixed
dr_mohan
Sysfs Plugin
5
2016-04-05
2015-12-08
No

If you enable libsysfs2hpi plugin in the conf file, run openhpid and stop it with no i2c devices, the following happens:

sysfs: CRIT: sysfs2hpi.c:572: no i2c devices found
[...]

*** Error in `/tmp/sbin/openhpid': double free or corruption (out):
0x00007ffff0024440 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x77e35)[0x7ffff624ae35]
/lib64/libc.so.6(+0x8051a)[0x7ffff625351a]
/lib64/libc.so.6(cfree+0x4c)[0x7ffff6256ccc]
/tmp/lib/openhpi/libsysfs2hpi.so(oh_close+0x19)[0x7ffff5b76ad9]
/tmp/sbin/openhpid(oh_close_handlers+0x45)[0x4134b5]
/tmp/sbin/openhpid(oh_finit+0xe)[0x41281e]
/tmp/sbin/openhpid(main+0x3ea)[0x407aaa]
/lib64/libc.so.6(__libc_start_main+0xf0)[0x7ffff61f3580]
/tmp/sbin/openhpid(_start+0x29)[0x407c19]

the attached patch fix the issue.

1 Attachments

Discussion

  • Rafael Fonseca

    Rafael Fonseca - 2016-04-05

    Any comments on this?

     
  • Hemantha Beecherla

    Patch looks good for me.

     
  • dr_mohan

    dr_mohan - 2016-04-05
    • labels: --> Sysfs plugin
    • status: open --> closed-fixed
    • assigned_to: dr_mohan
     
  • dr_mohan

    dr_mohan - 2016-04-05

    Fixed with checkin #7666