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:
parent
da8f9c86bd
commit
6e28d80927
|
@ -1563,6 +1563,8 @@ writev_port_etc(port_id id, int32 msgCode, const iovec* msgVecs,
|
|||
if (bufferSize > PORT_MAX_MESSAGE_SIZE)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
bool userCopy = (flags & PORT_FLAG_USE_USER_MEMCPY) != 0;
|
||||
|
||||
// mask irrelevant flags (for acquire_sem() usage)
|
||||
flags &= B_CAN_INTERRUPT | B_KILL_CAN_INTERRUPT | B_RELATIVE_TIMEOUT
|
||||
| B_ABSOLUTE_TIMEOUT;
|
||||
|
@ -1574,8 +1576,6 @@ writev_port_etc(port_id id, int32 msgCode, const iovec* msgVecs,
|
|||
timeout += system_time();
|
||||
}
|
||||
|
||||
bool userCopy = (flags & PORT_FLAG_USE_USER_MEMCPY) > 0;
|
||||
|
||||
status_t status;
|
||||
port_message* message = NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue