Skip to content
Snippets Groups Projects
Commit 61deb9bf authored by Will Deacon's avatar Will Deacon Committed by 谢秀奇
Browse files

arm64: futex: Avoid copying out uninitialised stack in failed cmpxchg()


commit 8e4e0ac0 upstream.

Returning an error code from futex_atomic_cmpxchg_inatomic() indicates
that the caller should not make any use of *uval, and should instead act
upon on the value of the error code. Although this is implemented
correctly in our futex code, we needlessly copy uninitialised stack to
*uval in the error case, which can easily be avoided.

Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent d6e7bc92
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,9 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *_uaddr,
: "memory");
uaccess_disable();
*uval = val;
if (!ret)
*uval = val;
return ret;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment