| Anonymous | Login | Signup for a new account | 11-10-2008 11:14 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0001320 | [BusyBox] Documentation | minor | always | 04-20-07 02:12 | 04-21-07 16:13 | ||||
| Reporter | rockeychu | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | |||||||
| Summary | 0001320: Patch for "libbb/find_root_device.c" to solve possible of endless loop | ||||||||
| Description |
libbb/find_root_device.c REV 18435 introduced a potential bug, which could cause 'df' hung, such as when '/dev/fd' is symlink of '/proc/self/fd'. Symbolic link device is very dangerous when dealing with /dev/ subdir (it may point to itself), so just omit it. Patch as following: Index: libbb/find_root_device.c =================================================================== --- libbb/find_root_device.c (revision 18501) +++ libbb/find_root_device.c (working copy) @@ -41,12 +41,14 @@ while ((entry = readdir(dir)) != NULL) { safe_strncpy(ap->devpath + len, entry->d_name, rem); - if (stat(ap->devpath, &ap->st) != 0) + if (lstat(ap->devpath, &ap->st) != 0) continue; if (S_ISBLK(ap->st.st_mode) && ap->st.st_rdev == ap->dev) { retpath = xstrdup(ap->devpath); break; } + if (S_ISLNK(ap->st.st_mode)) + continue; if (S_ISDIR(ap->st.st_mode)) { /* Do not recurse for '.' and '..' */ if (DOT_OR_DOTDOT(entry->d_name)) |
||||||||
| Additional Information | |||||||||
| Attached Files | |||||||||
|
|
|||||||||
Notes |
|
|
(0002327) vda 04-21-07 16:13 |
Fixed in svn, thanks! (ISLNK check is not needed, thus not added) |
| Copyright © 2000 - 2006 Mantis Group |