Bug 44150

Summary: Diskless kernel may crash, depends on the root fs name
Product: Base System Reporter: Phungte Ha <phungte>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Phungte Ha 2002-10-16 21:20:00 UTC
    depends on the name of the root device, for instance:
"nfs:phungte2:/local/diskless_root" the kernel can returns 1 from setrootbyname() in vfs_conf.c or can crash.

Fix: 

in setrootbyname(), the line parsing the name is currently like this:
      while (cp != '\0' && (*cp < '0' || *cp > '9'))
              cp++;

      it should rather be:

      while (cp != NULL && *cp != 0 || (*cp < '0' || *cp > '9'))
              cp++;

The problem seems to be there still in 4.6.2 in getdiskbyname().

PS: Sorry for mistakenly submitting this report several times 
by typing TAB and CR while coping the source in...
Comment 1 K. Macy freebsd_committer freebsd_triage 2007-11-16 04:37:11 UTC
State Changed
From-To: open->feedback


Need to confirm that this is still an issue.
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2008-01-20 14:15:15 UTC
I don't understand the claim, if you use "nfs:phungte2" as your root 
device then how is the kernel supposed to resolve phungte2 into an IP 
address?

Kris
Comment 3 Volker Werth freebsd_committer freebsd_triage 2008-05-07 22:53:14 UTC
State Changed
From-To: feedback->closed


We're sorry to not see any feedback received for quite some time. 
If you think this is still an issue that should be worked on, 
please provide the requested information and we'll be happy to 
re-open this ticket. 
Thank you for bringing this problem to attention!