diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-02 14:47:29 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-02 14:47:29 -0500 |
| commit | e7c42a89e9f16039684418dfe3c43b068734ff8f (patch) | |
| tree | e619c1436f99893a0a7643b021a8ec568fe11882 | |
| parent | df49fd0ff83a0c20c5ce68a790a4f43601ecdc4a (diff) | |
| parent | 9cd05ad2910b55238e3c720c99ad896dc538301b (diff) | |
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner:
"Two last minute fixes:
- Prevent value evaluation via functions happening in the user access
enabled region of __put_user() (put another way: make sure to
evaluate the value to be stored in user space _before_ enabling
user space accesses)
- Correct the definition of a Hyper-V hypercall constant"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/hyper-v: Fix definition of HV_MAX_FLUSH_REP_COUNT
x86/uaccess: Don't leak the AC flag into __put_user() value evaluation
| -rw-r--r-- | arch/x86/include/asm/hyperv-tlfs.h | 2 | ||||
| -rw-r--r-- | arch/x86/include/asm/uaccess.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 705dafc2d11a..2bdbbbcfa393 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h | |||
| @@ -841,7 +841,7 @@ union hv_gpa_page_range { | |||
| 841 | * count is equal with how many entries of union hv_gpa_page_range can | 841 | * count is equal with how many entries of union hv_gpa_page_range can |
| 842 | * be populated into the input parameter page. | 842 | * be populated into the input parameter page. |
| 843 | */ | 843 | */ |
| 844 | #define HV_MAX_FLUSH_REP_COUNT (PAGE_SIZE - 2 * sizeof(u64) / \ | 844 | #define HV_MAX_FLUSH_REP_COUNT ((PAGE_SIZE - 2 * sizeof(u64)) / \ |
| 845 | sizeof(union hv_gpa_page_range)) | 845 | sizeof(union hv_gpa_page_range)) |
| 846 | 846 | ||
| 847 | struct hv_guest_mapping_flush_list { | 847 | struct hv_guest_mapping_flush_list { |
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h index 780f2b42c8ef..c1334aaaa78d 100644 --- a/arch/x86/include/asm/uaccess.h +++ b/arch/x86/include/asm/uaccess.h | |||
| @@ -284,7 +284,7 @@ do { \ | |||
| 284 | __put_user_goto(x, ptr, "l", "k", "ir", label); \ | 284 | __put_user_goto(x, ptr, "l", "k", "ir", label); \ |
| 285 | break; \ | 285 | break; \ |
| 286 | case 8: \ | 286 | case 8: \ |
| 287 | __put_user_goto_u64((__typeof__(*ptr))(x), ptr, label); \ | 287 | __put_user_goto_u64(x, ptr, label); \ |
| 288 | break; \ | 288 | break; \ |
| 289 | default: \ | 289 | default: \ |
| 290 | __put_user_bad(); \ | 290 | __put_user_bad(); \ |
| @@ -431,8 +431,10 @@ do { \ | |||
| 431 | ({ \ | 431 | ({ \ |
| 432 | __label__ __pu_label; \ | 432 | __label__ __pu_label; \ |
| 433 | int __pu_err = -EFAULT; \ | 433 | int __pu_err = -EFAULT; \ |
| 434 | __typeof__(*(ptr)) __pu_val; \ | ||
| 435 | __pu_val = x; \ | ||
| 434 | __uaccess_begin(); \ | 436 | __uaccess_begin(); \ |
| 435 | __put_user_size((x), (ptr), (size), __pu_label); \ | 437 | __put_user_size(__pu_val, (ptr), (size), __pu_label); \ |
| 436 | __pu_err = 0; \ | 438 | __pu_err = 0; \ |
| 437 | __pu_label: \ | 439 | __pu_label: \ |
| 438 | __uaccess_end(); \ | 440 | __uaccess_end(); \ |
