[haiku-bugs] Re: [Haiku] #15094: KDL when booting anyboot image hrev53173

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Fri, 12 Jul 2019 00:09:05 -0000

#15094: KDL when booting anyboot image hrev53173
-----------------------------+----------------------
   Reporter:  MelanieFox     |      Owner:  korli
       Type:  bug            |     Status:  assigned
   Priority:  blocker        |  Milestone:  R1/beta2
  Component:  System/Kernel  |    Version:
 Resolution:                 |   Keywords:
 Blocked By:                 |   Blocking:
Has a Patch:  0              |   Platform:  x86-64
-----------------------------+----------------------

Comment (by simonsouth):

 I've added a proposed fix for review here: https://review.haiku-
 os.org/c/haiku/+/1582

 The issue turned to be a pair of calls to ioctl() that passed in a buffer
 but omitted the optional parameter specifying its length, causing
 [https://git.haiku-
 os.org/haiku/tree/src/system/libroot/posix/unistd/ioctl.c?h=hrev53168#n26
 a garbage value from va_arg()] to be passed to _kern_ioctl() in its place.

 With korli's changes in hrev53168 scsi_periph's periph_ioctl() actually
 does check this length value, meaning these calls would normally fail
 whenever they were directed at a SCSI device---like a CD-ROM drive. As a
 result, when Haiku was booted from CD KDiskDeviceManager would find the
 CD-ROM drive but later drop it from its list, removing it from
 consideration as a boot device and eventually leading to the kernel panic.

 Once booted, the same issue in partitioning_system's Disc.cpp caused the
 desktop to hang with no Tracker.

 For completeness my commit updates all the relevant ioctl calls in the
 affected modules (file_systems/cdda, partitioning_systems and
 disk_device_manager).

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15094#comment:9>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: