On Fri, Apr 26, 2019 at 6:36 PM Sasha Levin <sashal(a)kernel.org> wrote:
>
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v5.0.9, v4.19.36, v4.14.113, v4.9.170, v4.4.178, v3.18.138.
>
> v5.0.9: Build OK!
> v4.19.36: Build OK!
> v4.14.113: Build OK!
> v4.9.170: Failed to apply! Possible dependencies:
> 15dd03811d99 ("scsi: megaraid_sas: NVME Interface detection and prop settings")
> 18103efcacee ("scsi: megaraid-sas: request irqs later")
> 2493c67e518c ("scsi: megaraid_sas: 128 MSIX Support")
> 45f4f2eb3da3 ("scsi: megaraid_sas: Add new pci device Ids for SAS3.5 Generic Megaraid Controllers")
> 69c337c0f8d7 ("scsi: megaraid_sas: SAS3.5 Generic Megaraid Controllers Fast Path for RAID 1/10 Writes")
> 96188a89cc6d ("scsi: megaraid_sas: NVME interface target prop added")
> d0fc91d67c59 ("scsi: megaraid_sas: Send SYNCHRONIZE_CACHE for VD to firmware")
> d889344e4e59 ("scsi: megaraid_sas: Dynamic Raid Map Changes for SAS3.5 Generic Megaraid Controllers")
> fad119b707f8 ("scsi: megaraid_sas: switch to pci_alloc_irq_vectors")
> fdd84e2514b0 ("scsi: megaraid_sas: SAS3.5 Generic Megaraid Controllers Stream Detection and IO Coalescing")
>
> v4.4.178: Failed to apply! Possible dependencies:
> 15dd03811d99 ("scsi: megaraid_sas: NVME Interface detection and prop settings")
> 179ac14291a0 ("megaraid_sas: Reply Descriptor Post Queue (RDPQ) support")
> 18365b138508 ("megaraid_sas: Task management support")
> 2216c30523b0 ("megaraid_sas: Update device queue depth based on interface type")
> 2c048351c8e3 ("megaraid_sas: Syncing request flags macro names with firmware")
> 6d40afbc7d13 ("megaraid_sas: MFI IO timeout handling")
> 96188a89cc6d ("scsi: megaraid_sas: NVME interface target prop added")
> d889344e4e59 ("scsi: megaraid_sas: Dynamic Raid Map Changes for SAS3.5 Generic Megaraid Controllers")
>
> v3.18.138: Failed to apply! Possible dependencies:
> 0b48d12d0365 ("megaraid_sas: Make PI enabled VD 8 byte DMA aligned")
> 0d5b47a724ba ("megaraid_sas: Expose TAPE drives unconditionally")
> 16b8528d2060 ("megaraid_sas: use raw_smp_processor_id()")
> 18365b138508 ("megaraid_sas: Task management support")
> 2216c30523b0 ("megaraid_sas: Update device queue depth based on interface type")
> 2be2a98845e6 ("megaraid_sas : Modify return value of megasas_issue_blocked_cmd() and wait_and_poll() to consider command status returned by firmware")
> 4026e9aac3ff ("megaraid_sas : Use Block layer tag support for internal command indexing")
> 4a5c814d9339 ("megaraid_sas : Add separate functions for building sysPD IOs and non RW LDIOs")
> 5765c5b8b38a ("megaraid_sas : Support for Avago's Single server High Availability product")
> 7497cde883b1 ("megaraid_sas: add support for secure JBOD")
> 8a232bb39917 ("megaraid_sas : add missing __iomem annotations")
> 96188a89cc6d ("scsi: megaraid_sas: NVME interface target prop added")
> aed335eecf8f ("megaraid_sas: Make tape drives visible on PERC5 controllers")
> d009b5760f57 ("megaraid_sas: online Firmware upgrade support for Extended VD feature")
> da0dc9fb4e6b ("megaraid_sas: fix whitespace errors")
>
>
> How should we proceed with this patch?
>
Hi Sasha,
This patch is applicable for 4.11.x and later stable trees only.
I will send out a v2 of this patch with appropriate kernel version requirement
along with the -stable tag.
Thanks,
Shivasharan
> --
> Thanks,
> Sasha
This is a note to let you know that I've just added the patch titled
USB: cdc-acm: fix unthrottle races
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the usb-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
>From 764478f41130f1b8d8057575b89e69980a0f600d Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan(a)kernel.org>
Date: Thu, 25 Apr 2019 18:05:39 +0200
Subject: USB: cdc-acm: fix unthrottle races
Fix two long-standing bugs which could potentially lead to memory
corruption or leave the port throttled until it is reopened (on weakly
ordered systems), respectively, when read-URB completion races with
unthrottle().
First, the URB must not be marked as free before processing is complete
to prevent it from being submitted by unthrottle() on another CPU.
CPU 1 CPU 2
================ ================
complete() unthrottle()
process_urb();
smp_mb__before_atomic();
set_bit(i, free); if (test_and_clear_bit(i, free))
submit_urb();
Second, the URB must be marked as free before checking the throttled
flag to prevent unthrottle() on another CPU from failing to observe that
the URB needs to be submitted if complete() sees that the throttled flag
is set.
CPU 1 CPU 2
================ ================
complete() unthrottle()
set_bit(i, free); throttled = 0;
smp_mb__after_atomic(); smp_mb();
if (throttled) if (test_and_clear_bit(i, free))
return; submit_urb();
Note that test_and_clear_bit() only implies barriers when the test is
successful. To handle the case where the URB is still in use an explicit
barrier needs to be added to unthrottle() for the second race condition.
Also note that the first race was fixed by 36e59e0d70d6 ("cdc-acm: fix
race between callback and unthrottle") back in 2015, but the bug was
reintroduced a year later.
Fixes: 1aba579f3cf5 ("cdc-acm: handle read pipe errors")
Fixes: 088c64f81284 ("USB: cdc-acm: re-write read processing")
Signed-off-by: Johan Hovold <johan(a)kernel.org>
Acked-by: Oliver Neukum <oneukum(a)suse.com>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/class/cdc-acm.c | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index ec666eb4b7b4..c03aa8550980 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -470,12 +470,12 @@ static void acm_read_bulk_callback(struct urb *urb)
struct acm *acm = rb->instance;
unsigned long flags;
int status = urb->status;
+ bool stopped = false;
+ bool stalled = false;
dev_vdbg(&acm->data->dev, "got urb %d, len %d, status %d\n",
rb->index, urb->actual_length, status);
- set_bit(rb->index, &acm->read_urbs_free);
-
if (!acm->dev) {
dev_dbg(&acm->data->dev, "%s - disconnected\n", __func__);
return;
@@ -488,15 +488,16 @@ static void acm_read_bulk_callback(struct urb *urb)
break;
case -EPIPE:
set_bit(EVENT_RX_STALL, &acm->flags);
- schedule_work(&acm->work);
- return;
+ stalled = true;
+ break;
case -ENOENT:
case -ECONNRESET:
case -ESHUTDOWN:
dev_dbg(&acm->data->dev,
"%s - urb shutting down with status: %d\n",
__func__, status);
- return;
+ stopped = true;
+ break;
default:
dev_dbg(&acm->data->dev,
"%s - nonzero urb status received: %d\n",
@@ -505,10 +506,24 @@ static void acm_read_bulk_callback(struct urb *urb)
}
/*
- * Unthrottle may run on another CPU which needs to see events
- * in the same order. Submission has an implict barrier
+ * Make sure URB processing is done before marking as free to avoid
+ * racing with unthrottle() on another CPU. Matches the barriers
+ * implied by the test_and_clear_bit() in acm_submit_read_urb().
*/
smp_mb__before_atomic();
+ set_bit(rb->index, &acm->read_urbs_free);
+ /*
+ * Make sure URB is marked as free before checking the throttled flag
+ * to avoid racing with unthrottle() on another CPU. Matches the
+ * smp_mb() in unthrottle().
+ */
+ smp_mb__after_atomic();
+
+ if (stopped || stalled) {
+ if (stalled)
+ schedule_work(&acm->work);
+ return;
+ }
/* throttle device if requested by tty */
spin_lock_irqsave(&acm->read_lock, flags);
@@ -842,6 +857,9 @@ static void acm_tty_unthrottle(struct tty_struct *tty)
acm->throttle_req = 0;
spin_unlock_irq(&acm->read_lock);
+ /* Matches the smp_mb__after_atomic() in acm_read_bulk_callback(). */
+ smp_mb();
+
if (was_throttled)
acm_submit_read_urbs(acm, GFP_KERNEL);
}
--
2.21.0
Hello,
commit 310ca162d77 "block/loop: Use global lock for ioctl() operation." has
been pushed to multiple stable trees. This patch is a part of larger series
that overhauls the locking inside loopback device upstream and for 4.4,
4.9, and 4.14 stable trees only this patch from the series is applied. Our
testing now has shown [1] that the patch alone makes present deadlocks
inside loopback driver more likely (the openqa test in our infrastructure
didn't hit the deadlock before whereas with the new kernel it hits it
reliably every time). So I would suggest we revert 310ca162d77 from 4.4,
4.9, and 4.14 kernels.
Another option would be to backport other locking fixes for the loop
device but honestly I don't think that's a stable material - never heard
of real users hitting problems, only syzkaller could, and we are still
fixing up some small glitches resulting from that rework...
Honza
[1] https://bugzilla.suse.com/show_bug.cgi?id=1129739
--
Jan Kara <jack(a)suse.com>
SUSE Labs, CR
Hello,
We ran automated tests on a patchset that was proposed for merging into this
kernel tree. The patches were applied to:
Kernel repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
The results of these automated tests are provided below.
Overall result: FAILED (see details below)
Merge: OK
Compile: FAILED
We attempted to compile the kernel for multiple architectures, but the compile
failed on one or more architectures:
s390x: FAILED (see build-s390x.log.xz attachment)
We hope that these logs can help you find the problem quickly. For the full
detail on our testing procedures, please scroll to the bottom of this message.
Please reply to this email if you have any questions about the tests that we
ran or if you have any suggestions on how to make future tests more effective.
,-. ,-.
( C ) ( K ) Continuous
`-',-.`-' Kernel
( I ) Integration
`-'
______________________________________________________________________________
Merge testing
-------------
We cloned this repository and checked out the following commit:
Repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
We then merged the patchset with `git am`:
netfilter-nf_tables-bogus-ebusy-when-deleting-set-af.patch
netfilter-nf_tables-bogus-ebusy-in-helper-removal-fr.patch
intel_th-gth-fix-an-off-by-one-in-output-unassigning.patch
powerpc-vdso32-fix-clock_monotonic-on-ppc64.patch
alsa-hda-realtek-move-to-act_init-state.patch
fs-proc-proc_sysctl.c-fix-a-null-pointer-dereference.patch
block-bfq-fix-use-after-free-in-bfq_bfqq_expire.patch
cifs-fix-memory-leak-in-smb2_read.patch
cifs-fix-page-reference-leak-with-readv-writev.patch
cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch
tracing-fix-a-memory-leak-by-early-error-exit-in-trace_pid_write.patch
tracing-fix-buffer_ref-pipe-ops.patch
crypto-xts-fix-atomic-sleep-when-walking-skcipher.patch
crypto-lrw-fix-atomic-sleep-when-walking-skcipher.patch
gpio-eic-sprd-fix-incorrect-irq-type-setting-for-the-sync-eic.patch
zram-pass-down-the-bvec-we-need-to-read-into-in-the-work-struct.patch
lib-kconfig.debug-fix-build-error-without-config_block.patch
mips-scall64-o32-fix-indirect-syscall-number-load.patch
trace-fix-preempt_enable_no_resched-abuse.patch
mm-do-not-boost-watermarks-to-avoid-fragmentation-for-the-discontig-memory-model.patch
arm64-mm-ensure-tail-of-unaligned-initrd-is-reserved.patch
ib-rdmavt-fix-frwr-memory-registration.patch
rdma-mlx5-do-not-allow-the-user-to-write-to-the-clock-page.patch
rdma-mlx5-use-rdma_user_map_io-for-mapping-bar-pages.patch
rdma-ucontext-fix-regression-with-disassociate.patch
sched-numa-fix-a-possible-divide-by-zero.patch
ceph-only-use-d_name-directly-when-parent-is-locked.patch
ceph-ensure-d_name-stability-in-ceph_dentry_hash.patch
ceph-fix-ci-i_head_snapc-leak.patch
nfsd-don-t-release-the-callback-slot-unless-it-was-actually-held.patch
nfsd-wake-waiters-blocked-on-file_lock-before-deleting-it.patch
nfsd-wake-blocked-file-lock-waiters-before-sending-callback.patch
sunrpc-don-t-mark-uninitialised-items-as-valid.patch
perf-x86-intel-update-kbl-package-c-state-events-to-also-include-pc8-pc9-pc10-counters.patch
input-synaptics-rmi4-write-config-register-values-to-the-right-offset.patch
vfio-type1-limit-dma-mappings-per-container.patch
dmaengine-sh-rcar-dmac-with-cyclic-dma-residue-0-is-valid.patch
dmaengine-sh-rcar-dmac-fix-glitch-in-dmaengine_tx_status.patch
dmaengine-mediatek-cqdma-fix-wrong-register-usage-in-mtk_cqdma_start.patch
arm-8857-1-efi-enable-cp15-dmb-instructions-before-cleaning-the-cache.patch
powerpc-mm-radix-make-radix-require-hugetlb_page.patch
drm-vc4-fix-memory-leak-during-gpu-reset.patch
drm-ttm-fix-re-init-of-global-structures.patch
revert-drm-i915-fbdev-actually-configure-untiled-displays.patch
drm-vc4-fix-compilation-error-reported-by-kbuild-test-bot.patch
usb-add-new-usb-lpm-helpers.patch
usb-consolidate-lpm-checks-to-avoid-enabling-lpm-twice.patch
ext4-fix-some-error-pointer-dereferences.patch
loop-do-not-print-warn-message-if-partition-scan-is-successful.patch
tipc-handle-the-err-returned-from-cmd-header-function.patch
slip-make-slhc_free-silently-accept-an-error-pointer.patch
workqueue-try-to-catch-flush_work-without-init_work.patch
binder-fix-handling-of-misaligned-binder-object.patch
sched-deadline-correctly-handle-active-0-lag-timers.patch
mac80211_hwsim-calculate-if_combination.max_interfaces.patch
nfs-forbid-setting-af_inet6-to-struct-sockaddr_in-sin_family.patch
netfilter-ebtables-config_compat-drop-a-bogus-warn_on.patch
fm10k-fix-a-potential-null-pointer-dereference.patch
tipc-check-bearer-name-with-right-length-in-tipc_nl_compat_bearer_enable.patch
tipc-check-link-name-with-right-length-in-tipc_nl_compat_link_set.patch
net-netrom-fix-error-cleanup-path-of-nr_proto_init.patch
net-rds-check-address-length-before-reading-address-family.patch
rxrpc-fix-race-condition-in-rxrpc_input_packet.patch
pin-iocb-through-aio.patch
aio-fold-lookup_kiocb-into-its-sole-caller.patch
aio-keep-io_event-in-aio_kiocb.patch
aio-store-event-at-final-iocb_put.patch
fix-aio_poll-races.patch
x86-retpolines-raise-limit-for-generating-indirect-calls-from-switch-case.patch
x86-retpolines-disable-switch-jump-tables-when-retpolines-are-enabled.patch
Compile testing
---------------
We compiled the kernel for 4 architectures:
aarch64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
kernel build: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
ppc64le:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
kernel build: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
s390x:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
x86_64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
kernel build: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
Hello,
We ran automated tests on a patchset that was proposed for merging into this
kernel tree. The patches were applied to:
Kernel repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
The results of these automated tests are provided below.
Overall result: FAILED (see details below)
Merge: OK
Compile: FAILED
We attempted to compile the kernel for multiple architectures, but the compile
failed on one or more architectures:
s390x: FAILED (see build-s390x.log.xz attachment)
We hope that these logs can help you find the problem quickly. For the full
detail on our testing procedures, please scroll to the bottom of this message.
Please reply to this email if you have any questions about the tests that we
ran or if you have any suggestions on how to make future tests more effective.
,-. ,-.
( C ) ( K ) Continuous
`-',-.`-' Kernel
( I ) Integration
`-'
______________________________________________________________________________
Merge testing
-------------
We cloned this repository and checked out the following commit:
Repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
We then merged the patchset with `git am`:
netfilter-nf_tables-bogus-ebusy-when-deleting-set-af.patch
netfilter-nf_tables-bogus-ebusy-in-helper-removal-fr.patch
intel_th-gth-fix-an-off-by-one-in-output-unassigning.patch
powerpc-vdso32-fix-clock_monotonic-on-ppc64.patch
alsa-hda-realtek-move-to-act_init-state.patch
fs-proc-proc_sysctl.c-fix-a-null-pointer-dereference.patch
block-bfq-fix-use-after-free-in-bfq_bfqq_expire.patch
cifs-fix-memory-leak-in-smb2_read.patch
cifs-fix-page-reference-leak-with-readv-writev.patch
cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch
tracing-fix-a-memory-leak-by-early-error-exit-in-trace_pid_write.patch
tracing-fix-buffer_ref-pipe-ops.patch
crypto-xts-fix-atomic-sleep-when-walking-skcipher.patch
crypto-lrw-fix-atomic-sleep-when-walking-skcipher.patch
gpio-eic-sprd-fix-incorrect-irq-type-setting-for-the-sync-eic.patch
zram-pass-down-the-bvec-we-need-to-read-into-in-the-work-struct.patch
lib-kconfig.debug-fix-build-error-without-config_block.patch
mips-scall64-o32-fix-indirect-syscall-number-load.patch
trace-fix-preempt_enable_no_resched-abuse.patch
mm-do-not-boost-watermarks-to-avoid-fragmentation-for-the-discontig-memory-model.patch
arm64-mm-ensure-tail-of-unaligned-initrd-is-reserved.patch
ib-rdmavt-fix-frwr-memory-registration.patch
rdma-mlx5-do-not-allow-the-user-to-write-to-the-clock-page.patch
rdma-mlx5-use-rdma_user_map_io-for-mapping-bar-pages.patch
rdma-ucontext-fix-regression-with-disassociate.patch
sched-numa-fix-a-possible-divide-by-zero.patch
ceph-only-use-d_name-directly-when-parent-is-locked.patch
ceph-ensure-d_name-stability-in-ceph_dentry_hash.patch
ceph-fix-ci-i_head_snapc-leak.patch
nfsd-don-t-release-the-callback-slot-unless-it-was-actually-held.patch
nfsd-wake-waiters-blocked-on-file_lock-before-deleting-it.patch
nfsd-wake-blocked-file-lock-waiters-before-sending-callback.patch
sunrpc-don-t-mark-uninitialised-items-as-valid.patch
perf-x86-intel-update-kbl-package-c-state-events-to-also-include-pc8-pc9-pc10-counters.patch
input-synaptics-rmi4-write-config-register-values-to-the-right-offset.patch
vfio-type1-limit-dma-mappings-per-container.patch
dmaengine-sh-rcar-dmac-with-cyclic-dma-residue-0-is-valid.patch
dmaengine-sh-rcar-dmac-fix-glitch-in-dmaengine_tx_status.patch
dmaengine-mediatek-cqdma-fix-wrong-register-usage-in-mtk_cqdma_start.patch
arm-8857-1-efi-enable-cp15-dmb-instructions-before-cleaning-the-cache.patch
powerpc-mm-radix-make-radix-require-hugetlb_page.patch
drm-vc4-fix-memory-leak-during-gpu-reset.patch
drm-ttm-fix-re-init-of-global-structures.patch
revert-drm-i915-fbdev-actually-configure-untiled-displays.patch
drm-vc4-fix-compilation-error-reported-by-kbuild-test-bot.patch
usb-add-new-usb-lpm-helpers.patch
usb-consolidate-lpm-checks-to-avoid-enabling-lpm-twice.patch
ext4-fix-some-error-pointer-dereferences.patch
loop-do-not-print-warn-message-if-partition-scan-is-successful.patch
tipc-handle-the-err-returned-from-cmd-header-function.patch
slip-make-slhc_free-silently-accept-an-error-pointer.patch
workqueue-try-to-catch-flush_work-without-init_work.patch
binder-fix-handling-of-misaligned-binder-object.patch
sched-deadline-correctly-handle-active-0-lag-timers.patch
Compile testing
---------------
We compiled the kernel for 4 architectures:
aarch64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
kernel build: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
ppc64le:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
kernel build: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
s390x:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
x86_64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
kernel build: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
Hello,
We ran automated tests on a patchset that was proposed for merging into this
kernel tree. The patches were applied to:
Kernel repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
The results of these automated tests are provided below.
Overall result: FAILED (see details below)
Merge: OK
Compile: FAILED
We attempted to compile the kernel for multiple architectures, but the compile
failed on one or more architectures:
s390x: FAILED (see build-s390x.log.xz attachment)
We hope that these logs can help you find the problem quickly. For the full
detail on our testing procedures, please scroll to the bottom of this message.
Please reply to this email if you have any questions about the tests that we
ran or if you have any suggestions on how to make future tests more effective.
,-. ,-.
( C ) ( K ) Continuous
`-',-.`-' Kernel
( I ) Integration
`-'
______________________________________________________________________________
Merge testing
-------------
We cloned this repository and checked out the following commit:
Repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
We then merged the patchset with `git am`:
netfilter-nf_tables-bogus-ebusy-when-deleting-set-af.patch
netfilter-nf_tables-bogus-ebusy-in-helper-removal-fr.patch
intel_th-gth-fix-an-off-by-one-in-output-unassigning.patch
powerpc-vdso32-fix-clock_monotonic-on-ppc64.patch
alsa-hda-realtek-move-to-act_init-state.patch
fs-proc-proc_sysctl.c-fix-a-null-pointer-dereference.patch
block-bfq-fix-use-after-free-in-bfq_bfqq_expire.patch
cifs-fix-memory-leak-in-smb2_read.patch
cifs-fix-page-reference-leak-with-readv-writev.patch
cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch
tracing-fix-a-memory-leak-by-early-error-exit-in-trace_pid_write.patch
tracing-fix-buffer_ref-pipe-ops.patch
crypto-xts-fix-atomic-sleep-when-walking-skcipher.patch
crypto-lrw-fix-atomic-sleep-when-walking-skcipher.patch
gpio-eic-sprd-fix-incorrect-irq-type-setting-for-the-sync-eic.patch
zram-pass-down-the-bvec-we-need-to-read-into-in-the-work-struct.patch
lib-kconfig.debug-fix-build-error-without-config_block.patch
mips-scall64-o32-fix-indirect-syscall-number-load.patch
trace-fix-preempt_enable_no_resched-abuse.patch
mm-do-not-boost-watermarks-to-avoid-fragmentation-for-the-discontig-memory-model.patch
arm64-mm-ensure-tail-of-unaligned-initrd-is-reserved.patch
ib-rdmavt-fix-frwr-memory-registration.patch
rdma-mlx5-do-not-allow-the-user-to-write-to-the-clock-page.patch
rdma-mlx5-use-rdma_user_map_io-for-mapping-bar-pages.patch
rdma-ucontext-fix-regression-with-disassociate.patch
sched-numa-fix-a-possible-divide-by-zero.patch
ceph-only-use-d_name-directly-when-parent-is-locked.patch
ceph-ensure-d_name-stability-in-ceph_dentry_hash.patch
ceph-fix-ci-i_head_snapc-leak.patch
nfsd-don-t-release-the-callback-slot-unless-it-was-actually-held.patch
nfsd-wake-waiters-blocked-on-file_lock-before-deleting-it.patch
nfsd-wake-blocked-file-lock-waiters-before-sending-callback.patch
sunrpc-don-t-mark-uninitialised-items-as-valid.patch
perf-x86-intel-update-kbl-package-c-state-events-to-also-include-pc8-pc9-pc10-counters.patch
input-synaptics-rmi4-write-config-register-values-to-the-right-offset.patch
vfio-type1-limit-dma-mappings-per-container.patch
dmaengine-sh-rcar-dmac-with-cyclic-dma-residue-0-is-valid.patch
dmaengine-sh-rcar-dmac-fix-glitch-in-dmaengine_tx_status.patch
dmaengine-mediatek-cqdma-fix-wrong-register-usage-in-mtk_cqdma_start.patch
arm-8857-1-efi-enable-cp15-dmb-instructions-before-cleaning-the-cache.patch
powerpc-mm-radix-make-radix-require-hugetlb_page.patch
drm-vc4-fix-memory-leak-during-gpu-reset.patch
drm-ttm-fix-re-init-of-global-structures.patch
revert-drm-i915-fbdev-actually-configure-untiled-displays.patch
drm-vc4-fix-compilation-error-reported-by-kbuild-test-bot.patch
usb-add-new-usb-lpm-helpers.patch
usb-consolidate-lpm-checks-to-avoid-enabling-lpm-twice.patch
ext4-fix-some-error-pointer-dereferences.patch
loop-do-not-print-warn-message-if-partition-scan-is-successful.patch
tipc-handle-the-err-returned-from-cmd-header-function.patch
slip-make-slhc_free-silently-accept-an-error-pointer.patch
workqueue-try-to-catch-flush_work-without-init_work.patch
binder-fix-handling-of-misaligned-binder-object.patch
sched-deadline-correctly-handle-active-0-lag-timers.patch
mac80211_hwsim-calculate-if_combination.max_interfaces.patch
nfs-forbid-setting-af_inet6-to-struct-sockaddr_in-sin_family.patch
netfilter-ebtables-config_compat-drop-a-bogus-warn_on.patch
fm10k-fix-a-potential-null-pointer-dereference.patch
tipc-check-bearer-name-with-right-length-in-tipc_nl_compat_bearer_enable.patch
tipc-check-link-name-with-right-length-in-tipc_nl_compat_link_set.patch
net-netrom-fix-error-cleanup-path-of-nr_proto_init.patch
net-rds-check-address-length-before-reading-address-family.patch
rxrpc-fix-race-condition-in-rxrpc_input_packet.patch
Compile testing
---------------
We compiled the kernel for 4 architectures:
aarch64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
kernel build: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
ppc64le:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
kernel build: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
s390x:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
x86_64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
kernel build: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
Hi Greg
This series contains backports for a couple of fixes to sch_cake that was just
merged for 5.1. This series backports an earlier refactoring commit, which makes
the fixes themselves apply cleanly from upstream.
-Toke
---
Toke Høiland-Jørgensen (3):
sch_cake: Simplify logic in cake_select_tin()
sch_cake: Use tc_skb_protocol() helper for getting packet protocol
sch_cake: Make sure we can write the IP header before changing DSCP bits
net/sched/sch_cake.c | 57 +++++++++++++++++++++++++-------------------------
1 file changed, 28 insertions(+), 29 deletions(-)
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 0d74e6a3b6421d98eeafbed26f29156d469bc0b5 Mon Sep 17 00:00:00 2001
From: Mikulas Patocka <mpatocka(a)redhat.com>
Date: Wed, 13 Mar 2019 07:56:02 -0400
Subject: [PATCH] dm integrity: change memcmp to strncmp in dm_integrity_ctr
If the string opt_string is small, the function memcmp can access bytes
that are beyond the terminating nul character. In theory, it could cause
segfault, if opt_string were located just below some unmapped memory.
Change from memcmp to strncmp so that we don't read bytes beyond the end
of the string.
Cc: stable(a)vger.kernel.org # v4.12+
Signed-off-by: Mikulas Patocka <mpatocka(a)redhat.com>
Signed-off-by: Mike Snitzer <snitzer(a)redhat.com>
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index d57d997a52c8..33fac437569f 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -3185,7 +3185,7 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
journal_watermark = val;
else if (sscanf(opt_string, "commit_time:%u%c", &val, &dummy) == 1)
sync_msec = val;
- else if (!memcmp(opt_string, "meta_device:", strlen("meta_device:"))) {
+ else if (!strncmp(opt_string, "meta_device:", strlen("meta_device:"))) {
if (ic->meta_dev) {
dm_put_device(ti, ic->meta_dev);
ic->meta_dev = NULL;
@@ -3204,17 +3204,17 @@ static int dm_integrity_ctr(struct dm_target *ti, unsigned argc, char **argv)
goto bad;
}
ic->sectors_per_block = val >> SECTOR_SHIFT;
- } else if (!memcmp(opt_string, "internal_hash:", strlen("internal_hash:"))) {
+ } else if (!strncmp(opt_string, "internal_hash:", strlen("internal_hash:"))) {
r = get_alg_and_key(opt_string, &ic->internal_hash_alg, &ti->error,
"Invalid internal_hash argument");
if (r)
goto bad;
- } else if (!memcmp(opt_string, "journal_crypt:", strlen("journal_crypt:"))) {
+ } else if (!strncmp(opt_string, "journal_crypt:", strlen("journal_crypt:"))) {
r = get_alg_and_key(opt_string, &ic->journal_crypt_alg, &ti->error,
"Invalid journal_crypt argument");
if (r)
goto bad;
- } else if (!memcmp(opt_string, "journal_mac:", strlen("journal_mac:"))) {
+ } else if (!strncmp(opt_string, "journal_mac:", strlen("journal_mac:"))) {
r = get_alg_and_key(opt_string, &ic->journal_mac_alg, &ti->error,
"Invalid journal_mac argument");
if (r)
From: Daniel Borkmann <daniel(a)iogearbox.net>
commit f7bd9e36ee4a4ce38e1cddd7effe6c0d9943285b upstream
Add a bpf_check_basics_ok() and reject filters that are of invalid
size much earlier, so we don't do any useless work such as invoking
bpf_prog_alloc(). Currently, rejection happens in bpf_check_classic()
only, but it's really unnecessarily late and they should be rejected
at earliest point. While at it, also clean up one bpf_prog_size() to
make it consistent with the remaining invocations.
Signed-off-by: Daniel Borkmann <daniel(a)iogearbox.net>
Acked-by: Alexei Starovoitov <ast(a)kernel.org>
Signed-off-by: David S. Miller <davem(a)davemloft.net>
Signed-off-by: Zubin Mithra <zsm(a)chromium.org>
---
Notes:
* Syzkaller reported a kernel BUG related to a kernel paging request in
bpf_prog_create with the following stacktrace when fuzzing a 4.4 kernel.
Call Trace:
[<ffffffff822ac1c8>] bpf_prog_create+0xc8/0x210 net/core/filter.c:1067
[<ffffffff82454699>] bpf_mt_check+0xb9/0x120 net/netfilter/xt_bpf.c:31
[<ffffffff82437db8>] xt_check_match+0x238/0x730 net/netfilter/x_tables.c:409
[<ffffffff82940254>] ebt_check_match net/bridge/netfilter/ebtables.c:380 [inline]
[<ffffffff82940254>] ebt_check_entry+0x844/0x1740 net/bridge/netfilter/ebtables.c:709
[<ffffffff82946842>] translate_table+0xcb2/0x1e80 net/bridge/netfilter/ebtables.c:946
[<ffffffff8294a918>] do_replace_finish+0x6e8/0x1fd0 net/bridge/netfilter/ebtables.c:1002
[<ffffffff8294c419>] do_replace+0x219/0x370 net/bridge/netfilter/ebtables.c:1145
[<ffffffff8294c649>] do_ebt_set_ctl+0xd9/0x110 net/bridge/netfilter/ebtables.c:1492
[<ffffffff8239a87c>] nf_sockopt net/netfilter/nf_sockopt.c:105 [inline]
[<ffffffff8239a87c>] nf_setsockopt+0x6c/0xc0 net/netfilter/nf_sockopt.c:114
[<ffffffff825ddeb6>] ip_setsockopt+0xa6/0xc0 net/ipv4/ip_sockglue.c:1226
[<ffffffff825fd3c7>] tcp_setsockopt+0x87/0xd0 net/ipv4/tcp.c:2701
[<ffffffff8220343a>] sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:2690
[<ffffffff822006ed>] SYSC_setsockopt net/socket.c:1767 [inline]
[<ffffffff822006ed>] SyS_setsockopt+0x15d/0x240 net/socket.c:1746
[<ffffffff82a16f9b>] entry_SYSCALL_64_fastpath+0x18/0x94
* This patch resolves the following conflicts when applying to v4.4.y:
- __get_filter does not exist in v4.4. Instead the checks are moved into
__sk_attach_filter.
* This patch is present in v4.9.y.
* Tests run: Chrome OS tryjobs, Syzkaller reproducer
net/core/filter.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 1a9ded6af138..3c5f51198c41 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -742,6 +742,17 @@ static bool chk_code_allowed(u16 code_to_probe)
return codes[code_to_probe];
}
+static bool bpf_check_basics_ok(const struct sock_filter *filter,
+ unsigned int flen)
+{
+ if (filter == NULL)
+ return false;
+ if (flen == 0 || flen > BPF_MAXINSNS)
+ return false;
+
+ return true;
+}
+
/**
* bpf_check_classic - verify socket filter code
* @filter: filter to verify
@@ -762,9 +773,6 @@ static int bpf_check_classic(const struct sock_filter *filter,
bool anc_found;
int pc;
- if (flen == 0 || flen > BPF_MAXINSNS)
- return -EINVAL;
-
/* Check the filter code now */
for (pc = 0; pc < flen; pc++) {
const struct sock_filter *ftest = &filter[pc];
@@ -1057,7 +1065,7 @@ int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog)
struct bpf_prog *fp;
/* Make sure new filter is there and in the right amounts. */
- if (fprog->filter == NULL)
+ if (!bpf_check_basics_ok(fprog->filter, fprog->len))
return -EINVAL;
fp = bpf_prog_alloc(bpf_prog_size(fprog->len), 0);
@@ -1104,7 +1112,7 @@ int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
int err;
/* Make sure new filter is there and in the right amounts. */
- if (fprog->filter == NULL)
+ if (!bpf_check_basics_ok(fprog->filter, fprog->len))
return -EINVAL;
fp = bpf_prog_alloc(bpf_prog_size(fprog->len), 0);
@@ -1184,7 +1192,6 @@ int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
bool locked)
{
unsigned int fsize = bpf_classic_proglen(fprog);
- unsigned int bpf_fsize = bpf_prog_size(fprog->len);
struct bpf_prog *prog;
int err;
@@ -1192,10 +1199,10 @@ int __sk_attach_filter(struct sock_fprog *fprog, struct sock *sk,
return -EPERM;
/* Make sure new filter is there and in the right amounts. */
- if (fprog->filter == NULL)
+ if (!bpf_check_basics_ok(fprog->filter, fprog->len))
return -EINVAL;
- prog = bpf_prog_alloc(bpf_fsize, 0);
+ prog = bpf_prog_alloc(bpf_prog_size(fprog->len), 0);
if (!prog)
return -ENOMEM;
--
2.21.0.593.g511ec345e18-goog
Hello,
We ran automated tests on a patchset that was proposed for merging into this
kernel tree. The patches were applied to:
Kernel repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
The results of these automated tests are provided below.
Overall result: FAILED (see details below)
Merge: OK
Compile: FAILED
We attempted to compile the kernel for multiple architectures, but the compile
failed on one or more architectures:
s390x: FAILED (see build-s390x.log.xz attachment)
We hope that these logs can help you find the problem quickly. For the full
detail on our testing procedures, please scroll to the bottom of this message.
Please reply to this email if you have any questions about the tests that we
ran or if you have any suggestions on how to make future tests more effective.
,-. ,-.
( C ) ( K ) Continuous
`-',-.`-' Kernel
( I ) Integration
`-'
______________________________________________________________________________
Merge testing
-------------
We cloned this repository and checked out the following commit:
Repo: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Commit: d3da1f09fff2 - Linux 5.0.10
We then merged the patchset with `git am`:
netfilter-nf_tables-bogus-ebusy-when-deleting-set-af.patch
netfilter-nf_tables-bogus-ebusy-in-helper-removal-fr.patch
intel_th-gth-fix-an-off-by-one-in-output-unassigning.patch
powerpc-vdso32-fix-clock_monotonic-on-ppc64.patch
alsa-hda-realtek-move-to-act_init-state.patch
fs-proc-proc_sysctl.c-fix-a-null-pointer-dereference.patch
block-bfq-fix-use-after-free-in-bfq_bfqq_expire.patch
cifs-fix-memory-leak-in-smb2_read.patch
cifs-fix-page-reference-leak-with-readv-writev.patch
cifs-do-not-attempt-cifs-operation-on-smb2-rename-error.patch
tracing-fix-a-memory-leak-by-early-error-exit-in-trace_pid_write.patch
tracing-fix-buffer_ref-pipe-ops.patch
crypto-xts-fix-atomic-sleep-when-walking-skcipher.patch
crypto-lrw-fix-atomic-sleep-when-walking-skcipher.patch
gpio-eic-sprd-fix-incorrect-irq-type-setting-for-the-sync-eic.patch
zram-pass-down-the-bvec-we-need-to-read-into-in-the-work-struct.patch
lib-kconfig.debug-fix-build-error-without-config_block.patch
mips-scall64-o32-fix-indirect-syscall-number-load.patch
trace-fix-preempt_enable_no_resched-abuse.patch
mm-do-not-boost-watermarks-to-avoid-fragmentation-for-the-discontig-memory-model.patch
arm64-mm-ensure-tail-of-unaligned-initrd-is-reserved.patch
ib-rdmavt-fix-frwr-memory-registration.patch
rdma-mlx5-do-not-allow-the-user-to-write-to-the-clock-page.patch
rdma-mlx5-use-rdma_user_map_io-for-mapping-bar-pages.patch
rdma-ucontext-fix-regression-with-disassociate.patch
sched-numa-fix-a-possible-divide-by-zero.patch
ceph-only-use-d_name-directly-when-parent-is-locked.patch
ceph-ensure-d_name-stability-in-ceph_dentry_hash.patch
ceph-fix-ci-i_head_snapc-leak.patch
nfsd-don-t-release-the-callback-slot-unless-it-was-actually-held.patch
nfsd-wake-waiters-blocked-on-file_lock-before-deleting-it.patch
nfsd-wake-blocked-file-lock-waiters-before-sending-callback.patch
sunrpc-don-t-mark-uninitialised-items-as-valid.patch
perf-x86-intel-update-kbl-package-c-state-events-to-also-include-pc8-pc9-pc10-counters.patch
input-synaptics-rmi4-write-config-register-values-to-the-right-offset.patch
vfio-type1-limit-dma-mappings-per-container.patch
dmaengine-sh-rcar-dmac-with-cyclic-dma-residue-0-is-valid.patch
dmaengine-sh-rcar-dmac-fix-glitch-in-dmaengine_tx_status.patch
dmaengine-mediatek-cqdma-fix-wrong-register-usage-in-mtk_cqdma_start.patch
arm-8857-1-efi-enable-cp15-dmb-instructions-before-cleaning-the-cache.patch
powerpc-mm-radix-make-radix-require-hugetlb_page.patch
drm-vc4-fix-memory-leak-during-gpu-reset.patch
drm-ttm-fix-re-init-of-global-structures.patch
revert-drm-i915-fbdev-actually-configure-untiled-displays.patch
drm-vc4-fix-compilation-error-reported-by-kbuild-test-bot.patch
usb-add-new-usb-lpm-helpers.patch
usb-consolidate-lpm-checks-to-avoid-enabling-lpm-twice.patch
ext4-fix-some-error-pointer-dereferences.patch
Compile testing
---------------
We compiled the kernel for 4 architectures:
aarch64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
kernel build: https://artifacts.cki-project.org/builds/aarch64/kernel-stable_queue-aarch6…
ppc64le:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
kernel build: https://artifacts.cki-project.org/builds/ppc64le/kernel-stable_queue-ppc64l…
s390x:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
x86_64:
build options: -j20 INSTALL_MOD_STRIP=1 targz-pkg
configuration: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…
kernel build: https://artifacts.cki-project.org/builds/x86_64/kernel-stable_queue-x86_64-…