#include "smbd/smbd.h"
#include "smbd/globals.h"
#include "lib/util/tevent_unix.h"
+#include "lib/util/sys_rw.h"
#include "smbprofile.h"
#include <liburing.h>
struct tevent_req *req = NULL;
struct vfs_io_uring_pread_state *state = NULL;
struct vfs_io_uring_config *config = NULL;
+ bool ok;
SMB_VFS_HANDLE_GET_DATA(handle, config,
struct vfs_io_uring_config,
state->ur.profile_bytes, n);
SMBPROFILE_BYTES_ASYNC_SET_IDLE(state->ur.profile_bytes);
+ ok = sys_valid_io_range(offset, n);
+ if (!ok) {
+ tevent_req_error(req, EINVAL);
+ return tevent_req_post(req, ev);
+ }
+
state->iov.iov_base = (void *)data;
state->iov.iov_len = n;
io_uring_prep_readv(&state->ur.sqe,