This is the start of the stable review cycle for the 4.9.270 release.
There are 36 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 26 May 2021 15:23:11 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.270-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.270-rc1
Colin Ian King <colin.king(a)canonical.com>
iio: tsl2583: Fix division by a zero lux_val
Tetsuo Handa <penguin-kernel(a)I-love.SAKURA.ne.jp>
tty: vt: always invoke vc->vc_sw->con_resize callback
Maciej W. Rozycki <macro(a)orcam.me.uk>
vt: Fix character height handling with VT_RESIZEX
Maciej W. Rozycki <macro(a)orcam.me.uk>
vgacon: Record video mode changes with VT_RESIZEX
Igor Matheus Andrade Torrente <igormtorrente(a)gmail.com>
video: hgafb: fix potential NULL pointer dereference
Tom Seewald <tseewald(a)gmail.com>
qlcnic: Add null check after calling netdev_alloc_skb
Phillip Potter <phil(a)philpotter.co.uk>
leds: lp5523: check return value of lp5xx_read and jump to cleanup code
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
net: rtlwifi: properly check for alloc_workqueue() failure
Anirudh Rayabharam <mail(a)anirudhrb.com>
net: stmicro: handle clk_prepare() failure during init
Du Cheng <ducheng2(a)gmail.com>
ethernet: sun: niu: fix missing checks of niu_pci_eeprom_read()
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "niu: fix missing checks of niu_pci_eeprom_read"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "qlcnic: Avoid potential NULL pointer dereference"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "rtlwifi: fix a potential NULL pointer dereference"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
cdrom: gdrom: initialize global variable at init time
Atul Gopinathan <atulgopinathan(a)gmail.com>
cdrom: gdrom: deallocate struct gdrom_unit fields in remove_gdrom
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "gdrom: fix a memory leak bug"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "ecryptfs: replace BUG_ON with error handling code"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "video: imsttfb: fix potential NULL pointer dereferences"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "hwmon: (lm80) fix a missing check of bus read in lm80 probe"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "leds: lp5523: fix a missing check of return value of lp55xx_read"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "net: stmicro: fix a missing check of clk_prepare"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "video: hgafb: fix potential NULL pointer dereference"
Mikulas Patocka <mpatocka(a)redhat.com>
dm snapshot: fix crash with transient storage and zero chunk size
Mikulas Patocka <mpatocka(a)redhat.com>
dm snapshot: fix a crash when an origin has no snapshots
Jan Beulich <jbeulich(a)suse.com>
xen-pciback: reconfigure also from backend watch handler
Anirudh Rayabharam <mail(a)anirudhrb.com>
rapidio: handle create_workqueue() failure
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "rapidio: fix a NULL pointer dereference when create_workqueue() fails"
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Revert "ALSA: sb8: add a check for request_region"
Takashi Sakamoto <o-takashi(a)sakamocchi.jp>
ALSA: bebob/oxfw: fix Kconfig entry for Mackie d.2 Pro
Takashi Iwai <tiwai(a)suse.de>
ALSA: usb-audio: Validate MS endpoint descriptors
Takashi Iwai <tiwai(a)suse.de>
ALSA: line6: Fix racy initialization of LINE6 MIDI
Ronnie Sahlberg <lsahlber(a)redhat.com>
cifs: fix memory leak in smb2_copychunk_range
Oleg Nesterov <oleg(a)redhat.com>
ptrace: make ptrace() fail if the tracee changed its pid unexpectedly
Zhen Lei <thunder.leizhen(a)huawei.com>
scsi: qla2xxx: Fix error return code in qla82xx_write_flash_dword()
Leon Romanovsky <leonro(a)nvidia.com>
RDMA/rxe: Clear all QP fields if creation failed
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
openrisc: Fix a memory leak
-------------
Diffstat:
Makefile | 4 +-
arch/openrisc/kernel/setup.c | 2 +
drivers/cdrom/gdrom.c | 13 +++--
drivers/hwmon/lm80.c | 11 +----
drivers/infiniband/sw/rxe/rxe_qp.c | 7 +++
drivers/leds/leds-lp5523.c | 2 +-
drivers/md/dm-snap.c | 6 +--
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 3 +-
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c | 8 ++--
drivers/net/ethernet/sun/niu.c | 32 ++++++++-----
drivers/net/wireless/realtek/rtlwifi/base.c | 19 ++++----
drivers/rapidio/rio_cm.c | 17 ++++---
drivers/scsi/qla2xxx/qla_nx.c | 3 +-
drivers/staging/iio/light/tsl2583.c | 9 ++++
drivers/tty/vt/vt.c | 2 +-
drivers/tty/vt/vt_ioctl.c | 6 +--
drivers/video/console/fbcon.c | 2 +-
drivers/video/console/vgacon.c | 56 ++++++++++++----------
drivers/video/fbdev/hgafb.c | 21 ++++----
drivers/video/fbdev/imsttfb.c | 5 --
drivers/xen/xen-pciback/xenbus.c | 22 +++++++--
fs/cifs/smb2ops.c | 2 +
fs/ecryptfs/crypto.c | 6 +--
include/linux/console_struct.h | 1 +
kernel/ptrace.c | 18 ++++++-
sound/firewire/Kconfig | 4 +-
sound/firewire/bebob/bebob.c | 2 +-
sound/firewire/oxfw/oxfw.c | 1 -
sound/isa/sb/sb8.c | 4 --
sound/usb/line6/driver.c | 4 ++
sound/usb/line6/pod.c | 5 --
sound/usb/line6/variax.c | 6 ---
sound/usb/midi.c | 4 ++
33 files changed, 180 insertions(+), 127 deletions(-)
Error injection testing uncovered a pretty severe problem where we could
end up committing a super that pointed to the wrong tree roots,
resulting in transid mismatch errors.
The way we commit the transaction is we update the super copy with the
current generations and bytenrs of the important roots, and then copy
that into our super_for_commit. Then we allow transactions to continue
again, we write out the dirty pages for the transaction, and then we
write the super. If the write out fails we'll bail and skip writing the
supers.
However since we've allowed a new transaction to start, we can have a
log attempting to sync at this point, which would be blocked on
fs_info->tree_log_mutex. Once the commit fails we're allowed to do the
log tree commit, which uses super_for_commit, which now points at fs
tree's that were not written out.
Fix this by checking BTRFS_FS_STATE_ERROR once we acquire the
tree_log_mutex. This way if the transaction commit fails we're sure to
see this bit set and we can skip writing the super out. This patch
fixes this specific transid mismatch error I was seeing with this
particular error path.
cc: stable(a)vger.kernel.org
Signed-off-by: Josef Bacik <josef(a)toxicpanda.com>
---
fs/btrfs/tree-log.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 0278f489e7d9..83e8f105869b 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -3302,6 +3302,22 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
* begins and releases it only after writing its superblock.
*/
mutex_lock(&fs_info->tree_log_mutex);
+
+ /*
+ * The transaction writeout phase could have failed, and thus marked the
+ * fs in an error state. We must not commit here, as we could have
+ * updated our generation in the super_for_commit and writing the super
+ * here would result in transid mismatches. If there is an error here
+ * just bail.
+ */
+ if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
+ ret = -EIO;
+ btrfs_set_log_full_commit(trans);
+ btrfs_abort_transaction(trans, ret);
+ mutex_unlock(&fs_info->tree_log_mutex);
+ goto out_wake_log_root;
+ }
+
btrfs_set_super_log_root(fs_info->super_for_commit, log_root_start);
btrfs_set_super_log_root_level(fs_info->super_for_commit, log_root_level);
ret = write_all_supers(fs_info, 1);
--
2.26.3