diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2016-05-10 07:51:54 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-06-10 06:07:26 -0400 |
commit | c427c42cd612719e8fb8b5891cc9761e7770024e (patch) | |
tree | 425457f6b7c1d1cbaa97f5e2b894c1db34523db0 | |
parent | dcc98ea6146e4da27eee2f3e9983500e9618cc23 (diff) |
s390/mm: don't drop errors in get_guest_storage_key
Commit 1e133ab296f3 ("s390/mm: split arch/s390/mm/pgtable.c") changed
the return value of get_guest_storage_key to an unsigned char, resulting
in -EFAULT getting interpreted as a valid storage key.
Cc: stable@vger.kernel.org # 4.6+
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/pgtable.h | 2 | ||||
-rw-r--r-- | arch/s390/mm/pgtable.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 18d2beb89340..42b968a85863 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -893,7 +893,7 @@ void ptep_zap_key(struct mm_struct *mm, unsigned long addr, pte_t *ptep); | |||
893 | bool test_and_clear_guest_dirty(struct mm_struct *mm, unsigned long address); | 893 | bool test_and_clear_guest_dirty(struct mm_struct *mm, unsigned long address); |
894 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, | 894 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, |
895 | unsigned char key, bool nq); | 895 | unsigned char key, bool nq); |
896 | unsigned char get_guest_storage_key(struct mm_struct *mm, unsigned long addr); | 896 | unsigned long get_guest_storage_key(struct mm_struct *mm, unsigned long addr); |
897 | 897 | ||
898 | /* | 898 | /* |
899 | * Certain architectures need to do special things when PTEs | 899 | * Certain architectures need to do special things when PTEs |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 4324b87f9398..2a23ca96f9c2 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -543,7 +543,7 @@ int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, | |||
543 | } | 543 | } |
544 | EXPORT_SYMBOL(set_guest_storage_key); | 544 | EXPORT_SYMBOL(set_guest_storage_key); |
545 | 545 | ||
546 | unsigned char get_guest_storage_key(struct mm_struct *mm, unsigned long addr) | 546 | unsigned long get_guest_storage_key(struct mm_struct *mm, unsigned long addr) |
547 | { | 547 | { |
548 | unsigned char key; | 548 | unsigned char key; |
549 | spinlock_t *ptl; | 549 | spinlock_t *ptl; |