Re: Symbol Collision between ulogd and jansson

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



조홍식/책임연구원/SW Security개발실 SW Security TP <hongsik.jo@xxxxxxx> wrote:
> The issue I would like to bring to your attention is as follows:
> We are using the JSON feature in the PACKAGECONFIG of ulogd, and we have discovered that both ulogd and jansson have methods with the same name, which can lead to a symbol reference error resulting in a segmentation fault.
> The method in question is hashtable_del(). 
> Based on our backtrace analysis, it appears that when ulogd's hashtable_del() is executed instead of jansson's hashtable_del(), it leads to a segmentation fault (SEGV).
> To avoid this symbol collision, I modified ulogd's hashtable_del() to hashtable_delete(), and I have confirmed that this resolves the issue. 
> 
> For your reference, 
> 1. Our backtrace analysis
> (gdb) bt
> #0  0x000000558ed47730 in __llist_del (next=0x3433326335357830, prev=0x30623663) at /usr/src/debug/ulogd2/2.0.8+git/include/ulogd/linuxlist.h:107
> #1  llist_del (entry=0x7fc5c38460) at /usr/src/debug/ulogd2/2.0.8+git/include/ulogd/linuxlist.h:119
> #2  hashtable_del (table=table@entry=0x7fc5c38530, n=n@entry=0x7fc5c38460) at /usr/src/debug/ulogd2/2.0.8+git/src/hash.c:96
> #3  0x0000007f95234600 in do_dump (json=0x55c234c6b0, flags=0, depth=0, parents=0x7fc5c38530, dump=0x7f95233ad0 <dump_to_strbuffer>, data=0x7fc5c385b0) at /usr/src/debug/jansson/2.14/src/dump.c:416
> #4  0x0000007f952348e4 in json_dump_callback (json=json@entry=0x55c234c6b0, callback=callback@entry=0x7f95233ad0 <dump_to_strbuffer>, data=data@entry=0x7fc5c385b0, flags=flags@entry=0) at /usr/src/debug/jansson/2.14/src/dump.c:486
> #5  0x0000007f952349a0 in json_dumps (json=json@entry=0x55c234c6b0, flags=flags@entry=0) at /usr/src/debug/jansson/2.14/src/dump.c:433
> #6  0x0000007f95271934 in json_interp (upi=0x55c2358690) at /usr/src/debug/ulogd2/2.0.8+git/output/ulogd_output_JSON.c:399
> 
> I think this hashtable_del() should be 
> https://github.com/akheron/jansson/blob/v2.14/src/hashtable.c#L275  ( jansson's hashtable_del )
> But #2 says that the hashtable_del() is ulogd2's one. https://github.com/inliniac/ulogd2/blob/master/src/hash.c#L94  ( ulogd's hashtable_del )
>

Uhm.  What jansson version are you using?

commit 7c707a73a2251c20afaecc028267b99d0ee60184
Author: Petri Lehtinen <petri@xxxxxxxxx>
Date:   Sun Nov 29 13:04:00 2009 +0200

    Only export symbols starting with "json_" in libjansson.la

    This way we don't pollute the symbol namespace with internal symbols.




[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux