Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 115669
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo LiveCD Package Maintainers <livecd@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: pharon@gmail.com
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
hwsetup-1.1-dyn_blacklist_bounds_check.patch patch to fix the segfault patch pharon@gmail.com 2005-12-15 11:17 0000 742 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 115669 depends on: Show dependency tree
Bug 115669 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-12-15 09:07 0000
I submitted a patch to implement dynamic blacklist generation in hwsetup using
/etc/hotplug/blacklist to prevent loading of misbehaving drivers from being loaded.

But if the file has more than 200 module names hwsetup will segfault. I attatch
a patch to add primitive bounds checking and reduce the memory footprint of the
function.

The coding is horrible maybe, can someone else who knows better can rewrite it
using malloc and realloc?

Reproducible: Always
Steps to Reproduce:
1.emerge hwsetup
2.fill up /etc/hotplug/blacklist with more than 200 module names
3.run hwsetup
3.segfault

Actual Results:  
Segfault

Expected Results:  
Doesn't segfault

The bug description on my blog http://www.phaeronix.net/node/74 with the patch
http://phaeronix.net/files/hwsetup-1.1-dyn_blacklist_bounds_check.patch.txt

------- Comment #1 From pharon@gmail.com 2005-12-15 11:17:23 0000 -------
Created an attachment (id=74814) [details]
patch to fix the segfault

this is primitive bounds checking. Someone with better skills could make this
using array of pointers to strings and use malloc and realloc, but I am too
lazy.

------- Comment #2 From Chris Gianelloni (RETIRED) 2005-12-16 08:16:30 0000 -------
Thanks for the patch... currently my machines are down so I can't get this done
until after I get back power.  I had gotten your email, but haven't had much
time to do anything with the local ice storms.

------- Comment #3 From pharon@gmail.com 2005-12-16 14:21:14 0000 -------
no problem beware of the frost bite :)

------- Comment #4 From Chris Gianelloni (RETIRED) 2005-12-20 14:27:23 0000 -------
Fixed in CVS...

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug