]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 May 2019 12:10:07 +0000 (14:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 May 2019 12:10:07 +0000 (14:10 +0200)
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

queue-4.4/bio-fix-improper-use-of-smp_mb__before_atomic.patch [new file with mode: 0644]
queue-4.4/crypto-vmx-ctr-always-increment-iv-as-quadword.patch [new file with mode: 0644]
queue-4.4/kvm-x86-fix-return-value-for-reserved-efer.patch [new file with mode: 0644]
queue-4.4/revert-scsi-sd-keep-disk-read-only-when-re-reading-partition.patch [new file with mode: 0644]
queue-4.4/series

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 (file)
index 0000000..537ecd5
--- /dev/null
@@ -0,0 +1,43 @@
+From f381c6a4bd0ae0fde2d6340f1b9bb0f58d915de6 Mon Sep 17 00:00:00 2001
+From: Andrea Parri <andrea.parri@amarulasolutions.com>
+Date: Mon, 20 May 2019 19:23:56 +0200
+Subject: bio: fix improper use of smp_mb__before_atomic()
+
+From: Andrea Parri <andrea.parri@amarulasolutions.com>
+
+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" <paulmck@linux.ibm.com>
+Reported-by: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Cc: Jens Axboe <axboe@kernel.dk>
+Cc: Ming Lei <ming.lei@redhat.com>
+Cc: linux-block@vger.kernel.org
+Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..aab2d42
--- /dev/null
@@ -0,0 +1,57 @@
+From 009b30ac7444c17fae34c4f435ebce8e8e2b3250 Mon Sep 17 00:00:00 2001
+From: Daniel Axtens <dja@axtens.net>
+Date: Wed, 15 May 2019 20:24:50 +1000
+Subject: crypto: vmx - CTR: always increment IV as quadword
+
+From: Daniel Axtens <dja@axtens.net>
+
+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 <dja@axtens.net>
+Acked-by: Nayna Jain <nayna@linux.ibm.com>
+Tested-by: Nayna Jain <nayna@linux.ibm.com>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..b74e40b
--- /dev/null
@@ -0,0 +1,36 @@
+From 66f61c92889ff3ca365161fb29dd36d6354682ba Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <pbonzini@redhat.com>
+Date: Fri, 24 May 2019 21:52:46 +0200
+Subject: KVM: x86: fix return value for reserved EFER
+
+From: Paolo Bonzini <pbonzini@redhat.com>
+
+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 <pavel@denx.de>
+Fixes: 11988499e62b ("KVM: x86: Skip EFER vs. guest CPUID checks for host-initiated writes")
+Cc: Sean Christopherson <sean.j.christopherson@intel.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 (file)
index 0000000..a2d5a21
--- /dev/null
@@ -0,0 +1,51 @@
+From 8acf608e602f6ec38b7cc37b04c80f1ce9a1a6cc Mon Sep 17 00:00:00 2001
+From: "Martin K. Petersen" <martin.petersen@oracle.com>
+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 <martin.petersen@oracle.com>
+
+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: <stable@vger.kernel.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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");
index c4161be0842256f0eac90ed6555cf6757c23d787..e479b95dc34274ada4b879708d4c378dcaea68da 100644 (file)
@@ -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