diff options
author | Nicolas Lacasse <nlacasse@google.com> | 2018-06-27 14:30:45 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-27 14:31:35 -0700 |
commit | 99afc982f1f0e40059e1446ea6f3cb725b1fbde7 (patch) | |
tree | eb34c666d0c1a736af382095379304c15c604680 /pkg/sentry/kernel/pipe | |
parent | 4215e059e24c5ed6298060769444b0eeaa03da8a (diff) |
Call mm.CheckIORange() when copying in IOVecs.
CheckIORange is analagous to Linux's access_ok() method, which is checked when
copying in IOVecs in both lib/iov_iter.c:import_single_range() and
lib/iov_iter.c:import_iovec() => fs/read_write.c:rw_copy_check_uvector().
gVisor copies in IOVecs via Task.SingleIOSequence() and Task.CopyInIovecs().
We were checking the address range bounds, but not whether the address is
valid. To conform with linux, we should also check that the address is valid.
For usual preadv/pwritev syscalls, the effect of this change is not noticeable,
since we find out that the address is invalid before the syscall completes.
For vectorized async-IO operations, however, this change is necessary because
Linux returns EFAULT when the operation is submitted, but before it executes.
Thus, we must validate the iovecs when copying them in.
PiperOrigin-RevId: 202370092
Change-Id: I8759a63ccf7e6b90d90d30f78ab8935a0fcf4936
Diffstat (limited to 'pkg/sentry/kernel/pipe')
0 files changed, 0 insertions, 0 deletions