Now that we have the appropriate save/restore position mechanism for
error handling in place, we can handle page faults on copy-from-user by
skipping the offending captured field entirely rather than relying on an
empty string.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ibe1e818f57f8218d2b83281a572895884fc28b86
}
if (lttng_copy_from_user_check_nofault(writer->write_pos, ubuf, length)) {
- /*
- * After a successful strlen user, a page fault on copy is handled by
- * considering the string as empty, returning a success.
- */
+ ret = -1;
goto end;
}
writer->write_pos += length;
goto end;
}
- /*
- * Handle empty string and strlen user page fault as empty string.
- */
- if (length == 1)
- return lttng_msgpack_write_str(writer, "");
-
if (length <= MSGPACK_FIXSTR_MAX_LENGTH)
ret = lttng_msgpack_encode_user_fixstr(writer, ustr, length);
else