[haiku-bugs] Re: [Haiku] #17283: SMAP violation on usb_disk

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Sat, 25 Sep 2021 11:37:43 -0000

#17283: SMAP violation on usb_disk
--------------------------+-------------------------
  Reporter:  Coldfirex    |      Owner:  mmlr
      Type:  bug          |     Status:  new
  Priority:  normal       |  Milestone:  Unscheduled
 Component:  Drivers/USB  |    Version:  R1/beta3
Resolution:               |   Keywords:  smap
Blocked By:               |   Blocking:
  Platform:  All          |
--------------------------+-------------------------
Comment (by korli):

 Coldfirex, please see https://git.haiku-os.org/haiku/tree/src/add-
 ons/kernel/drivers/disk/usb/usb_disk/usb_disk.cpp#n1802

 basically it should be like: https://git.haiku-os.org/haiku/tree/src/add-
 ons/kernel/generic/scsi_periph/io.cpp#n406

 {{{
                         if (IS_USER_ADDRESS(buffer)) {
                                 if (user_memcpy(buffer, &ready,
 sizeof(status_t)) != B_OK)
                                         return B_BAD_ADDRESS;
                         } else if (is_called_via_syscall()) {
                                 return B_BAD_ADDRESS;
                         } else
                                 *(status_t *)buffer = ready;
 }}}
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/17283#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: