diff options
| author | Wenwen Wang <[email protected]> | 2018-04-30 17:56:10 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2018-05-06 18:44:47 -0700 |
| commit | dc487321b1e6ab27f545fd8826ce3f76b01b63c2 (patch) | |
| tree | 0fb5707daad74c5cba8f6fd7b27ed0ddacf2f60d /tools/perf/scripts/python | |
| parent | 648ae363628c84faa8d8861e3246e096b8c0a392 (diff) | |
staging: lustre: llite: fix potential missing-check bug when copying lumv
In ll_dir_ioctl(), the object lumv3 is firstly copied from the user space
using Its address, i.e., lumv1 = &lumv3. If the lmm_magic field of lumv3 is
LOV_USER_MAGIC_V3, lumv3 will be modified by the second copy from the user
space. The second copy is necessary, because the two versions (i.e.,
lov_user_md_v1 and lov_user_md_v3) have different data formats and lengths.
However, given that the user data resides in the user space, a malicious
user-space process can race to change the data between the two copies. By
doing so, the attacker can provide a data with an inconsistent version,
e.g., v1 version + v3 data. This can lead to logical errors in the
following execution in ll_dir_setstripe(), which performs different actions
according to the version specified by the field lmm_magic.
This patch rechecks the version field lmm_magic in the second copy. If the
version is not as expected, i.e., LOV_USER_MAGIC_V3, an error code will be
returned: -EINVAL.
Signed-off-by: Wenwen Wang <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions