kernel: port: check USE_USER_COPY flag before masking it.
writev_port_etc() used memcpy() instead of user_memcpy() for user buffers. The branch was even left out silently as an optimization on gcc5.
This commit is contained in:
@@ -1563,6 +1563,8 @@ writev_port_etc(port_id id, int32 msgCode, const iovec* msgVecs,
|
|||||||
if (bufferSize > PORT_MAX_MESSAGE_SIZE)
|
if (bufferSize > PORT_MAX_MESSAGE_SIZE)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
bool userCopy = (flags & PORT_FLAG_USE_USER_MEMCPY) != 0;
|
||||||
|
|
||||||
// mask irrelevant flags (for acquire_sem() usage)
|
// mask irrelevant flags (for acquire_sem() usage)
|
||||||
flags &= B_CAN_INTERRUPT | B_KILL_CAN_INTERRUPT | B_RELATIVE_TIMEOUT
|
flags &= B_CAN_INTERRUPT | B_KILL_CAN_INTERRUPT | B_RELATIVE_TIMEOUT
|
||||||
| B_ABSOLUTE_TIMEOUT;
|
| B_ABSOLUTE_TIMEOUT;
|
||||||
@@ -1574,8 +1576,6 @@ writev_port_etc(port_id id, int32 msgCode, const iovec* msgVecs,
|
|||||||
timeout += system_time();
|
timeout += system_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool userCopy = (flags & PORT_FLAG_USE_USER_MEMCPY) > 0;
|
|
||||||
|
|
||||||
status_t status;
|
status_t status;
|
||||||
port_message* message = NULL;
|
port_message* message = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user