2004-03-13 11:46:11

by Fredrik Noring

[permalink] [raw]
Subject: [PATCH] Fix for broken hcid signal handler

Hi Marcel

I believe that the signal handler for the SIGHUP signal is broken for
all versions of hcid. It's broken because the functions called from
the signal handler are very much not reentrant (problems with malloc,
errno and global variables).

Sending SIGHUP to hcid can therefore lead to memory/state corruption,
segmentation fault etc.

Attached patch fixes this by delaying the signal until it can be
delivered safely.

Fredrik

Makefile.am | 6 +-
main.c | 62 ++++++++++++------------------
sig.c | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
sig.h | 14 ++++++
watch.c | 9 +++-
5 files changed, 174 insertions(+), 41 deletions(-)


Attachments:
bluez-utils-2.4-fn10.patch (7.75 kB)

2004-03-15 23:33:51

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] Fix for broken hcid signal handler

Hi Fredrik,

> Any chance of accepting the fix as well as DBus interface patches?

sorry, I don't found the time to review your patch and understand why it
is needed.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2004-03-15 23:08:46

by Fredrik Noring

[permalink] [raw]
Subject: Re: [Bluez-devel] [PATCH] Fix for broken hcid signal handler

Marcel,

Any chance of accepting the fix as well as DBus interface patches?

Fredrik