From: Greg Kroah-Hartman Date: Mon, 27 May 2019 12:10:07 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.1.6~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f5cc11bc247cded8780e868204d70ad91a7deb4;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: bio-fix-improper-use-of-smp_mb__before_atomic.patch crypto-vmx-ctr-always-increment-iv-as-quadword.patch kvm-x86-fix-return-value-for-reserved-efer.patch revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch --- diff --git a/queue-4.4/bio-fix-improper-use-of-smp_mb__before_atomic.patch b/queue-4.4/bio-fix-improper-use-of-smp_mb__before_atomic.patch new file mode 100644 index 00000000000..537ecd5c415 --- /dev/null +++ b/queue-4.4/bio-fix-improper-use-of-smp_mb__before_atomic.patch @@ -0,0 +1,43 @@ +From f381c6a4bd0ae0fde2d6340f1b9bb0f58d915de6 Mon Sep 17 00:00:00 2001 +From: Andrea Parri +Date: Mon, 20 May 2019 19:23:56 +0200 +Subject: bio: fix improper use of smp_mb__before_atomic() + +From: Andrea Parri + +commit f381c6a4bd0ae0fde2d6340f1b9bb0f58d915de6 upstream. + +This barrier only applies to the read-modify-write operations; in +particular, it does not apply to the atomic_set() primitive. + +Replace the barrier with an smp_mb(). + +Fixes: dac56212e8127 ("bio: skip atomic inc/dec of ->bi_cnt for most use cases") +Cc: stable@vger.kernel.org +Reported-by: "Paul E. McKenney" +Reported-by: Peter Zijlstra +Signed-off-by: Andrea Parri +Reviewed-by: Ming Lei +Cc: Jens Axboe +Cc: Ming Lei +Cc: linux-block@vger.kernel.org +Cc: "Paul E. McKenney" +Cc: Peter Zijlstra +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/bio.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/bio.h ++++ b/include/linux/bio.h +@@ -290,7 +290,7 @@ static inline void bio_cnt_set(struct bi + { + if (count != 1) { + bio->bi_flags |= (1 << BIO_REFFED); +- smp_mb__before_atomic(); ++ smp_mb(); + } + atomic_set(&bio->__bi_cnt, count); + } diff --git a/queue-4.4/crypto-vmx-ctr-always-increment-iv-as-quadword.patch b/queue-4.4/crypto-vmx-ctr-always-increment-iv-as-quadword.patch new file mode 100644 index 00000000000..aab2d42c870 --- /dev/null +++ b/queue-4.4/crypto-vmx-ctr-always-increment-iv-as-quadword.patch @@ -0,0 +1,57 @@ +From 009b30ac7444c17fae34c4f435ebce8e8e2b3250 Mon Sep 17 00:00:00 2001 +From: Daniel Axtens +Date: Wed, 15 May 2019 20:24:50 +1000 +Subject: crypto: vmx - CTR: always increment IV as quadword + +From: Daniel Axtens + +commit 009b30ac7444c17fae34c4f435ebce8e8e2b3250 upstream. + +The kernel self-tests picked up an issue with CTR mode: +alg: skcipher: p8_aes_ctr encryption test failed (wrong result) on test vector 3, cfg="uneven misaligned splits, may sleep" + +Test vector 3 has an IV of FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD, so +after 3 increments it should wrap around to 0. + +In the aesp8-ppc code from OpenSSL, there are two paths that +increment IVs: the bulk (8 at a time) path, and the individual +path which is used when there are fewer than 8 AES blocks to +process. + +In the bulk path, the IV is incremented with vadduqm: "Vector +Add Unsigned Quadword Modulo", which does 128-bit addition. + +In the individual path, however, the IV is incremented with +vadduwm: "Vector Add Unsigned Word Modulo", which instead +does 4 32-bit additions. Thus the IV would instead become +FFFFFFFFFFFFFFFFFFFFFFFF00000000, throwing off the result. + +Use vadduqm. + +This was probably a typo originally, what with q and w being +adjacent. It is a pretty narrow edge case: I am really +impressed by the quality of the kernel self-tests! + +Fixes: 5c380d623ed3 ("crypto: vmx - Add support for VMS instructions by ASM") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Axtens +Acked-by: Nayna Jain +Tested-by: Nayna Jain +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/crypto/vmx/aesp8-ppc.pl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/vmx/aesp8-ppc.pl ++++ b/drivers/crypto/vmx/aesp8-ppc.pl +@@ -1298,7 +1298,7 @@ Loop_ctr32_enc: + addi $idx,$idx,16 + bdnz Loop_ctr32_enc + +- vadduwm $ivec,$ivec,$one ++ vadduqm $ivec,$ivec,$one + vmr $dat,$inptail + lvx $inptail,0,$inp + addi $inp,$inp,16 diff --git a/queue-4.4/kvm-x86-fix-return-value-for-reserved-efer.patch b/queue-4.4/kvm-x86-fix-return-value-for-reserved-efer.patch new file mode 100644 index 00000000000..b74e40bc1a7 --- /dev/null +++ b/queue-4.4/kvm-x86-fix-return-value-for-reserved-efer.patch @@ -0,0 +1,36 @@ +From 66f61c92889ff3ca365161fb29dd36d6354682ba Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 24 May 2019 21:52:46 +0200 +Subject: KVM: x86: fix return value for reserved EFER + +From: Paolo Bonzini + +commit 66f61c92889ff3ca365161fb29dd36d6354682ba upstream. + +Commit 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for +host-initiated writes", 2019-04-02) introduced a "return false" in a +function returning int, and anyway set_efer has a "nonzero on error" +conventon so it should be returning 1. + +Reported-by: Pavel Machek +Fixes: 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes") +Cc: Sean Christopherson +Cc: stable@vger.kernel.org +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kvm/x86.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/kvm/x86.c ++++ b/arch/x86/kvm/x86.c +@@ -1026,7 +1026,7 @@ static int set_efer(struct kvm_vcpu *vcp + u64 efer = msr_info->data; + + if (efer & efer_reserved_bits) +- return false; ++ return 1; + + if (!msr_info->host_initiated) { + if (!__kvm_valid_efer(vcpu, efer)) diff --git a/queue-4.4/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch b/queue-4.4/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch new file mode 100644 index 00000000000..a2d5a210843 --- /dev/null +++ b/queue-4.4/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch @@ -0,0 +1,51 @@ +From 8acf608e602f6ec38b7cc37b04c80f1ce9a1a6cc Mon Sep 17 00:00:00 2001 +From: "Martin K. Petersen" +Date: Mon, 20 May 2019 10:57:18 -0400 +Subject: Revert "scsi: sd: Keep disk read-only when re-reading partition" + +From: Martin K. Petersen + +commit 8acf608e602f6ec38b7cc37b04c80f1ce9a1a6cc upstream. + +This reverts commit 20bd1d026aacc5399464f8328f305985c493cde3. + +This patch introduced regressions for devices that come online in +read-only state and subsequently switch to read-write. + +Given how the partition code is currently implemented it is not +possible to persist the read-only flag across a device revalidate +call. This may need to get addressed in the future since it is common +for user applications to proactively call BLKRRPART. + +Reverting this commit will re-introduce a regression where a +device-initiated revalidate event will cause the admin state to be +forgotten. A separate patch will address this issue. + +Fixes: 20bd1d026aac ("scsi: sd: Keep disk read-only when re-reading partition") +Cc: +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/sd.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/scsi/sd.c ++++ b/drivers/scsi/sd.c +@@ -2396,7 +2396,6 @@ sd_read_write_protect_flag(struct scsi_d + int res; + struct scsi_device *sdp = sdkp->device; + struct scsi_mode_data data; +- int disk_ro = get_disk_ro(sdkp->disk); + int old_wp = sdkp->write_prot; + + set_disk_ro(sdkp->disk, 0); +@@ -2437,7 +2436,7 @@ sd_read_write_protect_flag(struct scsi_d + "Test WP failed, assume Write Enabled\n"); + } else { + sdkp->write_prot = ((data.device_specific & 0x80) != 0); +- set_disk_ro(sdkp->disk, sdkp->write_prot || disk_ro); ++ set_disk_ro(sdkp->disk, sdkp->write_prot); + if (sdkp->first_scan || old_wp != sdkp->write_prot) { + sd_printk(KERN_NOTICE, sdkp, "Write Protect is %s\n", + sdkp->write_prot ? "on" : "off"); diff --git a/queue-4.4/series b/queue-4.4/series index c4161be0842..e479b95dc34 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -75,3 +75,7 @@ md-raid-raid5-preserve-the-writeback-action-after-the-parity-check.patch btrfs-honour-fitrim-range-constraints-during-free-space-trim.patch fbdev-sm712fb-fix-memory-frequency-by-avoiding-a-switch-case-fallthrough.patch ext4-do-not-delete-unlinked-inode-from-orphan-list-on-failed-truncate.patch +kvm-x86-fix-return-value-for-reserved-efer.patch +bio-fix-improper-use-of-smp_mb__before_atomic.patch +revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch +crypto-vmx-ctr-always-increment-iv-as-quadword.patch