segfault in configuring linux-restricted modules

Bug #67763 reported by MaxNegro
8
Affects Status Importance Assigned to Milestone
module-init-tools
Unknown
Unknown
module-init-tools (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

I upgraded to edgy a couple of days ago, and on one of my machines, apt-get is unable to configure linux-restricted-modules due to a segfault in executing depmod -a -F "System.map-2.6.17-10-generic" "2.6.17-generic".

Can't say why it's acting like that, anyway I recompiled module-init-tools with debugging symbols and obtained the following:

(gdb) handle SIG33 pass nostop noprint
Signal Stop Print Pass to program Description
SIG33 No No Yes Real-time event 33
(gdb) run -a -q -F /boot/System.map-"2.6.17-10-generic" "2.6.17-10-generic"
Starting program: /sbin/depmod -a -q -F /boot/System.map-"2.6.17-10-generic" "2.6.17-10-generic"

Program received signal SIGSEGV, Segmentation fault.
0x0804a1e4 in main (argc=6, argv=0xbfca9fd4) at ../depmod.c:151
151 ptr = strchr(line, '\n');
(gdb) thread apply all bt
(gdb)
(gdb) backtrace
#0 0x0804a1e4 in main (argc=6, argv=0xbfca9fd4) at ../depmod.c:151

Hope it helps.

Revision history for this message
MaxNegro (maxnegro) wrote :

Ok, found the cause. I misconfigured lilo.conf and so System.map got corrupted. Anyway I think assigning a char to a pointer that could be null is still a bug. (maybe using strchrnul could be the case?) :)

Changed in module-init-tools:
importance: Undecided → Low
status: Unconfirmed → Confirmed
Changed in module-init-tools:
status: Unknown → Confirmed
Revision history for this message
Alan Jenkins (aj504) wrote :

When module-init-tools was checked into the git repo, two months after you hit this bug, it looked like this

175 ptr = strchr(line, '\n');
176 *ptr = '\0';

So I guess gdb got the line number off by one.

But the current code checks ptr is non-NULL before assigning to it, so this shouldn't happen any more :-).

Changed in module-init-tools:
status: Confirmed → Fix Released
importance: Unknown → Undecided
status: Confirmed → New
importance: Undecided → Unknown
status: New → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.