3.18.108-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 3.18.108-stable review
This is the start of the stable review cycle for the 3.18.108 release. There are 25 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 May 2 18:39:02 UTC 2018. 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/v3.x/stable-review/patch-3.18.108-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.18.108-rc1
Greg Kroah-Hartman <[email protected]>
Revert "perf tests: Decompress kernel module before objdump"
Ilya Dryomov <[email protected]>
libceph: validate con->state at the top of try_write()
Nicolin Chen <[email protected]>
ASoC: fsl_esai: Fix divisor calculation failure at lower ratio
Mahesh Rajashekhara <[email protected]>
scsi: sd: Defer spinning up drive while SANITIZE is in progress
Dmitry Vyukov <[email protected]>
kobject: don't use WARN for registration failures
Joakim Tjernlund <[email protected]>
mtd: cfi: cmdset_0002: Do not allow read/write to suspend erase block.
Joakim Tjernlund <[email protected]>
mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug.
Joakim Tjernlund <[email protected]>
mtd: cfi: cmdset_0001: Do not allow read/write to suspend erase block.
Takashi Iwai <[email protected]>
ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device
David Henningsson <[email protected]>
ALSA: core: Report audio_tstamp in snd_pcm_sync_ptr
Tetsuo Handa <[email protected]>
tty: Use __GFP_NOFAIL for tty_ldisc_get()
Tony Lindgren <[email protected]>
tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set
Tony Lindgren <[email protected]>
tty: n_gsm: Fix long delays with control frame timeouts in ADM mode
Michael S. Tsirkin <[email protected]>
virtio_console: free buffers after reset
Michael S. Tsirkin <[email protected]>
virtio: add ability to iterate over vqs
Takashi Iwai <[email protected]>
ALSA: usb-audio: Skip broken EU on Dell dock USB-audio
Ravi Chandra Sadineni <[email protected]>
USB: Increment wakeup count on remote wakeup.
Kamil Lulko <[email protected]>
usb: core: Add quirk for HP v222w 16GB Mini
Kyle Roeschley <[email protected]>
USB: serial: cp210x: add ID for NI USB serial console
Vasyl Vavrychuk <[email protected]>
USB: serial: ftdi_sio: use jtag quirk for Arrow USB Blaster
Shuah Khan <[email protected]>
usbip: vhci_hcd: Fix usb device and sockfd leaks
Shuah Khan <[email protected]>
usbip: usbip_host: fix to hold parent lock for device_attach() calls
Lukas Czerner <[email protected]>
ext4: fix bitmap position validation
Theodore Ts'o <[email protected]>
ext4: add validity checks for bitmap block numbers
Theodore Ts'o <[email protected]>
ext4: set h_journal if there is a failure starting a reserved handle
-------------
Diffstat:
Makefile | 4 +-- drivers/char/virtio_console.c | 49 ++++++++++++++++++------------------- drivers/mtd/chips/cfi_cmdset_0001.c | 33 +++++++++++++++++++++---- drivers/mtd/chips/cfi_cmdset_0002.c | 9 ++++--- drivers/scsi/sd.c | 2 ++ drivers/tty/n_gsm.c | 23 ++++++++++++++++- drivers/tty/tty_ldisc.c | 11 ++++----- drivers/usb/core/hcd.c | 1 + drivers/usb/core/hub.c | 10 +++++++- drivers/usb/core/quirks.c | 3 +++ drivers/usb/serial/cp210x.c | 1 + drivers/usb/serial/ftdi_sio.c | 3 ++- drivers/usb/usbip/stub_main.c | 5 ++++ drivers/usb/usbip/usbip_common.h | 2 +- fs/ext4/balloc.c | 17 +++++++++++-- fs/ext4/ialloc.c | 8 +++++- fs/jbd2/transaction.c | 1 + include/linux/mtd/flashchip.h | 1 + include/linux/virtio.h | 3 +++ lib/kobject.c | 12 ++++----- net/ceph/messenger.c | 7 ++++++ sound/core/pcm_native.c | 1 + sound/core/seq/oss/seq_oss_synth.c | 12 ++++++--- sound/soc/fsl/fsl_esai.c | 7 ++++++ sound/usb/mixer_maps.c | 3 +++ tools/perf/tests/code-reading.c | 20 +-------------- 26 files changed, 170 insertions(+), 78 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/25 ext4: set h_journal if there is a failure starting a reserved handle
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit b2569260d55228b617bd82aba6d0db2faeeb4116 upstream.
If ext4 tries to start a reserved handle via jbd2_journal_start_reserved(), and the journal has been aborted, this can result in a NULL pointer dereference. This is because the fields h_journal and h_transaction in the handle structure share the same memory, via a union, so jbd2_journal_start_reserved() will clear h_journal before calling start_this_handle(). If this function fails due to an aborted handle, h_journal will still be NULL, and the call to jbd2_journal_free_reserved() will pass a NULL journal to sub_reserve_credits().
This can be reproduced by running "kvm-xfstests -c dioread_nolock generic/475".
--- fs/jbd2/transaction.c | 1 + 1 file changed, 1 insertion(+)
fs/jbd2/transaction.c +1 -0
@@ -515,6 +515,7 @@ int jbd2_journal_start_reserved(handle_t*/ ret =start_this_handle (journal, handle,GFP_NOFS );if (ret <0 ) { + handle->h_journal = journal;jbd2_journal_free_reserved (handle);return ret; }
Greg Kroah-Hartman
maintainerPATCH 2/25 ext4: add validity checks for bitmap block numbers
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Theodore Ts'o <[email protected]>
commit 7dac4a1726a9c64a517d595c40e95e2d0d135f6f upstream.
An privileged attacker can cause a crash by mounting a crafted ext4 image which triggers a out-of-bounds read in the function ext4_valid_block_bitmap() in fs/ext4/balloc.c.
This issue has been assigned CVE-2018-1093.
Backport notes:
3.18.y is missing commit 6a797d273783 ("ext4: call out CRC and corruption errors with specific error codes") so the EFSCORRUPTED label doesn't exist. Replaced
all instances of EFSCORRUPTED with EUCLEAN since that's
what 6a797d273783 defined it as.
--- fs/ext4/balloc.c | 16 ++++++++++++++-- fs/ext4/ialloc.c | 8 +++++++- 2 files changed, 21 insertions(+), 3 deletions(-)
fs/ext4/balloc.c +14 -2
@@ -338,20 +338,25 @@ static ext4_fsblk_t ext4_valid_block_bit/* check whether block bitmap block number is set */ blk =ext4_block_bitmap (sb, desc); offset = blk - group_first_block; -if (!ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data)) +if (offset <0 ||EXT4_B2C (sbi, offset) >= sb->s_blocksize || + !ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data))/* bad block bitmap */ return blk;/* check whether the inode bitmap block number is set */ blk =ext4_inode_bitmap (sb, desc); offset = blk - group_first_block; -if (!ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data)) +if (offset <0 ||EXT4_B2C (sbi, offset) >= sb->s_blocksize || + !ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data))/* bad block bitmap */ return blk;/* check whether the inode table block number is set */ blk =ext4_inode_table (sb, desc); offset = blk - group_first_block; +if (offset <0 ||EXT4_B2C (sbi, offset) >= sb->s_blocksize || +EXT4_B2C (sbi, offset + sbi->s_itb_per_group) >= sb->s_blocksize) +return blk; next_zero_bit =ext4_find_next_zero_bit (bh->b_data,EXT4_B2C (sbi, offset +EXT4_SB (sb)->s_itb_per_group),EXT4_B2C (sbi, offset));
@@ -414,6 +419,7 @@ struct buffer_head * ext4_read_block_bitmap_nowait(struct super_block *sb, ext4_group_t block_group) {struct ext4_group_desc *desc; +struct ext4_sb_info *sbi =EXT4_SB (sb);struct buffer_head *bh;ext4_fsblk_t bitmap_blk;
@@ -421,6 +427,12 @@ ext4_read_block_bitmap_nowait(struct supif (!desc)return NULL ; bitmap_blk =ext4_block_bitmap (sb, desc); +if ((bitmap_blk <=le32_to_cpu (sbi->s_es->s_first_data_block)) || + (bitmap_blk >=ext4_blocks_count (sbi->s_es))) { +ext4_error (sb,"Invalid block bitmap block %llu in " +"block_group %u" , bitmap_blk, block_group); +return ERR_PTR (-EUCLEAN ); + } bh =sb_getblk (sb, bitmap_blk);if (unlikely (!bh)) { ext4_error(sb, "Cannot get buffer for block bitmap - "
fs/ext4/ialloc.c +7 -1
@@ -84,16 +84,22 @@ static struct buffer_head * ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) {struct ext4_group_desc *desc; +struct ext4_sb_info *sbi =EXT4_SB (sb);struct buffer_head *bh =NULL ;ext4_fsblk_t bitmap_blk;struct ext4_group_info *grp; -struct ext4_sb_info *sbi =EXT4_SB (sb); desc =ext4_get_group_desc (sb, block_group,NULL );if (!desc)return NULL ; bitmap_blk =ext4_inode_bitmap (sb, desc); +if ((bitmap_blk <=le32_to_cpu (sbi->s_es->s_first_data_block)) || + (bitmap_blk >=ext4_blocks_count (sbi->s_es))) { +ext4_error (sb,"Invalid inode bitmap blk %llu in " +"block_group %u" , bitmap_blk, block_group); +return ERR_PTR (-EUCLEAN ); + } bh =sb_getblk (sb, bitmap_blk);if (unlikely (!bh)) { ext4_error(sb, "Cannot read inode bitmap - "
Greg Kroah-Hartman
maintainerPATCH 3/25 ext4: fix bitmap position validation
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Czerner <[email protected]>
commit 22be37acce25d66ecf6403fc8f44df9c5ded2372 upstream.
Currently in ext4_valid_block_bitmap() we expect the bitmap to be positioned anywhere between 0 and s_blocksize clusters, but that's wrong because the bitmap can be placed anywhere in the block group. This causes false positives when validating bitmaps on perfectly valid file system layouts. Fix it by checking whether the bitmap is within the group boundary.
The problem can be reproduced using the following
mkfs -t ext3 -E stride=256 /dev/vdb1
mount /dev/vdb1 /mnt/test
cd /mnt/test
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.3.tar.xz
tar xf linux-4.16.3.tar.xz
This will result in the warnings in the logs
EXT4-fs error (device vdb1): ext4_validate_block_bitmap:399: comm tar: bg 84: block 2774529: invalid block bitmap
[ Changed slightly for clarity and to not drop a overflow test -- TYT ]
--- fs/ext4/balloc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
fs/ext4/balloc.c +5 -4
@@ -321,6 +321,7 @@ static ext4_fsblk_t ext4_valid_block_bitstruct ext4_sb_info *sbi =EXT4_SB (sb);ext4_grpblk_t offset;ext4_grpblk_t next_zero_bit; +ext4_grpblk_t max_bit =EXT4_CLUSTERS_PER_GROUP (sb);ext4_fsblk_t blk;ext4_fsblk_t group_first_block;
@@ -338,7 +339,7 @@ static ext4_fsblk_t ext4_valid_block_bit/* check whether block bitmap block number is set */ blk =ext4_block_bitmap (sb, desc); offset = blk - group_first_block; -if (offset <0 ||EXT4_B2C (sbi, offset) >= sb->s_blocksize || +if (offset <0 ||EXT4_B2C (sbi, offset) >= max_bit || !ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data))/* bad block bitmap */ return blk;
@@ -346,7 +347,7 @@ static ext4_fsblk_t ext4_valid_block_bit/* check whether the inode bitmap block number is set */ blk =ext4_inode_bitmap (sb, desc); offset = blk - group_first_block; -if (offset <0 ||EXT4_B2C (sbi, offset) >= sb->s_blocksize || +if (offset <0 ||EXT4_B2C (sbi, offset) >= max_bit || !ext4_test_bit (EXT4_B2C (sbi, offset), bh->b_data))/* bad block bitmap */ return blk;
@@ -354,8 +355,8 @@ static ext4_fsblk_t ext4_valid_block_bit/* check whether the inode table block number is set */ blk =ext4_inode_table (sb, desc); offset = blk - group_first_block; -if (offset <0 ||EXT4_B2C (sbi, offset) >= sb->s_blocksize || -EXT4_B2C (sbi, offset + sbi->s_itb_per_group) >= sb->s_blocksize) +if (offset <0 ||EXT4_B2C (sbi, offset) >= max_bit || +EXT4_B2C (sbi, offset + sbi->s_itb_per_group) >= max_bit)return blk; next_zero_bit = ext4_find_next_zero_bit(bh->b_data, EXT4_B2C(sbi, offset + EXT4_SB(sb)->s_itb_per_group),
Greg Kroah-Hartman
maintainerPATCH 4/25 usbip: usbip_host: fix to hold parent lock for device_attach() calls
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
commit 4bfb141bc01312a817d36627cc47c93f801c216d upstream.
usbip_host calls device_attach() without holding dev->parent lock. Fix it.
--- drivers/usb/usbip/stub_main.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/usbip/stub_main.c +5 -0
@@ -201,7 +201,12 @@ static ssize_t rebind_store(struct devicif (!bid)return -ENODEV ; +/* device_attach() callers should hold parent lock for USB */ +if (bid->udev->dev.parent) +device_lock (bid->udev->dev.parent); ret =device_attach (&bid->udev->dev); +if (bid->udev->dev.parent) +device_unlock (bid->udev->dev.parent);if (ret <0 ) {dev_err (&bid->udev->dev,"rebind failed\n" );return ret;
Greg Kroah-Hartman
maintainerPATCH 5/25 usbip: vhci_hcd: Fix usb device and sockfd leaks
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuah Khan <[email protected]>
commit 9020a7efe537856eb3e826ebebdf38a5d07a7857 upstream.
vhci_hcd fails to do reset to put usb device and sockfd in the module remove/stop paths. Fix the leak.
--- drivers/usb/usbip/usbip_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/usbip/usbip_common.h +1 -1
@@ -248,7 +248,7 @@ enum usbip_side {#define SDEV_EVENT_ERROR_SUBMIT (USBIP_EH_SHUTDOWN | USBIP_EH_RESET)#define SDEV_EVENT_ERROR_MALLOC (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE) -#define VDEV_EVENT_REMOVED (USBIP_EH_SHUTDOWN | USBIP_EH_BYE) +#define VDEV_EVENT_REMOVED (USBIP_EH_SHUTDOWN | USBIP_EH_RESET | USBIP_EH_BYE)#define VDEV_EVENT_DOWN (USBIP_EH_SHUTDOWN | USBIP_EH_RESET)#define VDEV_EVENT_ERROR_TCP (USBIP_EH_SHUTDOWN | USBIP_EH_RESET)#define VDEV_EVENT_ERROR_MALLOC (USBIP_EH_SHUTDOWN | USBIP_EH_UNUSABLE)
Greg Kroah-Hartman
maintainerPATCH 6/25 USB: serial: ftdi_sio: use jtag quirk for Arrow USB Blaster
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vasyl Vavrychuk <[email protected]>
commit 470b5d6f0cf4674be2d1ec94e54283a1770b6a1a upstream.
Arrow USB Blaster integrated on MAX1000 board uses the same vendor ID (0x0403) and product ID (0x6010) as the "original" FTDI device.
This patch avoids picking up by ftdi_sio of the first interface of this USB device. After that this device can be used by Arrow user-space JTAG driver.
--- drivers/usb/serial/ftdi_sio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/ftdi_sio.c +2 -1
@@ -1908,7 +1908,8 @@ static int ftdi_8u2232c_probe(struct usbreturn ftdi_jtag_probe (serial);if (udev->product && - (!strcmp (udev->product,"BeagleBone/XDS100V2" ) || + (!strcmp (udev->product,"Arrow USB Blaster" ) || + !strcmp (udev->product,"BeagleBone/XDS100V2" ) || !strcmp (udev->product,"SNAP Connect E10" )))return ftdi_jtag_probe (serial);
Greg Kroah-Hartman
maintainerPATCH 7/25 USB: serial: cp210x: add ID for NI USB serial console
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kyle Roeschley <[email protected]>
commit 1e23aace21515a8f7615a1de016c0ea8d4e0cc6e upstream.
Added the USB VID and PID for the USB serial console on some National Instruments devices.
--- drivers/usb/serial/cp210x.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/cp210x.c +1 -0
@@ -207,6 +207,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */ { USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */ { USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */ + { USB_DEVICE(0x3923, 0x7A0B) }, /* National Instruments USB Serial Console */ { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ { } /* Terminating Entry */ };
Greg Kroah-Hartman
maintainerPATCH 8/25 usb: core: Add quirk for HP v222w 16GB Mini
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamil Lulko <[email protected]>
commit 3180dabe08e3653bf0a838553905d88f3773f29c upstream.
Add DELAY_INIT quirk to fix the following problem with HP v222w 16GB Mini:
usb 1-3: unable to read config index 0 descriptor/start: -110 usb 1-3: can't read configurations, error -110
usb 1-3: can't set config #1, error -110
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -41,6 +41,9 @@ static const struct usb_device_id usb_qu { USB_DEVICE(0x03f0, 0x0701), .driver_info = USB_QUIRK_STRING_FETCH_255 }, + /* HP v222w 16GB Mini USB Drive */ + { USB_DEVICE(0x03f0, 0x3f40), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Creative SB Audigy 2 NX */ { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
Greg Kroah-Hartman
maintainerPATCH 9/25 USB: Increment wakeup count on remote wakeup.
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ravi Chandra Sadineni <[email protected]>
commit 83a62c51ba7b3c0bf45150c4eac7aefc6c785e94 upstream.
On chromebooks we depend on wakeup count to identify the wakeup source. But currently USB devices do not increment the wakeup count when they trigger the remote wake. This patch addresses the same.
Resume condition is reported differently on USB 2.0 and USB 3.0 devices.
On USB 2.0 devices, a wake capable device, if wake enabled, drives resume signal to indicate a remote wake (USB 2.0 spec section 7.1.7.7). The upstream facing port then sets C_PORT_SUSPEND bit and reports a port change event (USB 2.0 spec section 11.24.2.7.2.3). Thus if a port has resumed before driving the resume signal from the host and C_PORT_SUSPEND is set, then the device attached to the given port might be the reason for the last system wakeup. Increment the wakeup count for the same.
On USB 3.0 devices, a function may signal that it wants to exit from device suspend by sending a Function Wake Device Notification to the host (USB3.0 spec section 8.5.6.4) Thus on receiving the Function Wake, increment the wakeup count.
--- drivers/usb/core/hcd.c | 1 + drivers/usb/core/hub.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-)
drivers/usb/core/hcd.c +1 -0
@@ -2289,6 +2289,7 @@ void usb_hcd_resume_root_hub (struct usbspin_lock_irqsave (&hcd_root_hub_lock, flags);if (hcd->rh_registered) { +pm_wakeup_event (&hcd->self.root_hub->dev,0 );set_bit (HCD_FLAG_WAKEUP_PENDING , &hcd->flags);queue_work (pm_wq, &hcd->wakeup_work); }
drivers/usb/core/hub.c +9 -1
@@ -633,12 +633,17 @@ void usb_wakeup_notification(struct usb_ unsigned int portnum) {struct usb_hub *hub; +struct usb_port *port_dev;if (!hdev)return ; hub =usb_hub_to_struct_hub (hdev);if (hub) { + port_dev = hub->ports[portnum -1 ]; +if (port_dev && port_dev->child) +pm_wakeup_event (&port_dev->child->dev,0 ); +set_bit (portnum, hub->wakeup_bits);kick_hub_wq (hub); }
@@ -3363,8 +3368,11 @@ int usb_port_resume(struct usb_device *u/* Skip the initial Clear-Suspend step for a remote wakeup */ status =hub_port_status (hub, port1, &portstatus, &portchange); -if (status ==0 && !port_is_suspended (hub, portstatus)) +if (status ==0 && !port_is_suspended (hub, portstatus)) { +if (portchange &USB_PORT_STAT_C_SUSPEND ) +pm_wakeup_event (&udev->dev,0 ); goto SuspendCleared; + }/* see 7.1.7.7; affects power usage, but not budgeting */ if (hub_is_superspeed (hub->hdev))
Greg Kroah-Hartman
maintainerPATCH 10/25 ALSA: usb-audio: Skip broken EU on Dell dock USB-audio
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit 1d8d6428d1da642ddd75b0be2d1bb1123ff8e017 upstream.
The Dell Dock USB-audio device with 0bda:4014 is behaving notoriously bad, and we have already applied some workaround to avoid the firmware hiccup. Yet we still need to skip one thing, the Extension Unit at ID 4, which doesn't react correctly to the mixer ctl access.
Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1090658
--- sound/usb/mixer_maps.c | 3 +++ 1 file changed, 3 insertions(+)
sound/usb/mixer_maps.c +3 -0
@@ -353,8 +353,11 @@ static struct usbmix_name_map dragonfly_/* * Dell usb dock with ALC4020 codec had a firmware problem where it got * screwed up when zero volume is passed; just skip it as a workaround +* +* Also the extension unit gives an access error, so skip it as well. */ static const struct usbmix_name_map dell_alc4020_map[] = { + {4 ,NULL },/* extension unit */ {16 ,NULL }, {19 ,NULL }, {0 }
Greg Kroah-Hartman
maintainerPATCH 11/25 virtio: add ability to iterate over vqs
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael S. Tsirkin <[email protected]>
commit 24a7e4d20783c0514850f24a5c41ede46ab058f0 upstream.
For cleanup it's helpful to be able to simply scan all vqs and discard all data. Add an iterator to do that.
--- include/linux/virtio.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/virtio.h +3 -0
@@ -122,6 +122,9 @@ int virtio_device_freeze(struct virtio_dint virtio_device_restore (struct virtio_device *dev);#endif +#define virtio_device_for_each_vq (vdev, vq) \ + list_for_each_entry(vq, &vdev->vqs, list) +/** * virtio_driver - operations for a virtio I/O driver * @driver: underlying device driver (populate name and owner).
Greg Kroah-Hartman
maintainerPATCH 12/25 virtio_console: free buffers after reset
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael S. Tsirkin <[email protected]>
commit a7a69ec0d8e4a58be7db88d33cbfa2912807bb2b upstream.
Console driver is out of spec. The spec says:
A driver MUST NOT decrement the available idx on a live virtqueue (ie. there is no way to “unexpose” buffers).
and it does exactly that by trying to detach unused buffers without doing a device reset first.
Defer detaching the buffers until device unplug.
Of course this means we might get an interrupt for a vq without an attached port now. Handle that by discarding the consumed buffer.
--- drivers/char/virtio_console.c | 49 ++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-)
drivers/char/virtio_console.c +24 -25
@@ -1398,7 +1398,6 @@ static int add_port(struct ports_device {char debugfs_name[16 ];struct port *port; -struct port_buffer *buf;dev_t devt;unsigned int nr_added_bufs;int err;
@@ -1509,8 +1508,6 @@ static int add_port(struct ports_devicereturn 0 ; free_inbufs: -while ((buf =virtqueue_detach_unused_buf (port->in_vq))) -free_buf (buf, true); free_device:device_destroy (pdrvdata.class, port->dev->devt); free_cdev:
@@ -1535,34 +1532,14 @@ static void remove_port(struct kref *krestatic void remove_port_data (struct port *port) { -struct port_buffer *buf; -spin_lock_irq (&port->inbuf_lock);/* Remove unused data this port might have received. */ discard_port_data (port);spin_unlock_irq (&port->inbuf_lock); -/* Remove buffers we queued up for the Host to send us data in. */ -do { -spin_lock_irq (&port->inbuf_lock); - buf =virtqueue_detach_unused_buf (port->in_vq); -spin_unlock_irq (&port->inbuf_lock); -if (buf) -free_buf (buf, true); - }while (buf); -spin_lock_irq (&port->outvq_lock);reclaim_consumed_buffers (port);spin_unlock_irq (&port->outvq_lock); - -/* Free pending buffers from the out-queue. */ -do { -spin_lock_irq (&port->outvq_lock); - buf =virtqueue_detach_unused_buf (port->out_vq); -spin_unlock_irq (&port->outvq_lock); -if (buf) -free_buf (buf, true); - }while (buf); }/*
@@ -1783,13 +1760,24 @@ static void control_work_handler(structspin_unlock (&portdev->c_ivq_lock); } +static void flush_bufs (struct virtqueue *vq,bool can_sleep) +{ +struct port_buffer *buf; +unsigned int len; + +while ((buf =virtqueue_get_buf (vq, &len))) +free_buf (buf, can_sleep); +} +static void out_intr (struct virtqueue *vq) {struct port *port; port =find_port_by_vq (vq->vdev->priv, vq); -if (!port) +if (!port) { +flush_bufs (vq, false);return ; + }wake_up_interruptible (&port->waitqueue); }
@@ -1800,8 +1788,10 @@ static void in_intr(struct virtqueue *vqunsigned long flags; port =find_port_by_vq (vq->vdev->priv, vq); -if (!port) +if (!port) { +flush_bufs (vq, false);return ; + }spin_lock_irqsave (&port->inbuf_lock, flags); port->inbuf =get_inbuf (port);
@@ -1976,6 +1966,15 @@ static const struct file_operations portstatic void remove_vqs (struct ports_device *portdev) { +struct virtqueue *vq; + +virtio_device_for_each_vq (portdev->vdev, vq) { +struct port_buffer *buf; + +flush_bufs (vq, true); +while ((buf =virtqueue_detach_unused_buf (vq))) +free_buf (buf, true); + } portdev->vdev->config->del_vqs (portdev->vdev);kfree (portdev->in_vqs);kfree (portdev->out_vqs);
Greg Kroah-Hartman
maintainerPATCH 13/25 tty: n_gsm: Fix long delays with control frame timeouts in ADM mode
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
commit e9ec22547986dd32c5c70da78107ce35dbff1344 upstream.
Commit ea3d8465ab9b ("tty: n_gsm: Allow ADM response in addition to UA for control dlci") added support for DLCI to stay in Asynchronous Disconnected Mode (ADM). But we still get long delays waiting for commands to other DLCI to complete:
--> 5) C: SABM(P)
Q> 0) C: UIH(F) Q> 0) C: UIH(F) Q> 0) C: UIH(F)
...
This happens because gsm_control_send() sets cretries timer to T2 that is by default set to 34. This will cause resend for T2 times for the control frame. In ADM mode, we will never get a response so the control frame, so retries are just delaying all the commands.
Let's fix the issue by setting DLCI_MODE_ADM flag after detecting the ADM mode for the control DLCI. Then we can use that in gsm_control_send() to set retries to 1. This means the control frame will be sent once allowing the other end at an opportunity to switch from ADM to ABM mode.
Note that retries will be decremented in gsm_control_retransmit() so we don't want to set it to 0 here.
--- drivers/tty/n_gsm.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/tty/n_gsm.c +11 -1
@@ -137,6 +137,9 @@ struct gsm_dlci {struct mutex mutex;/* Link layer */ +int mode; +#define DLCI_MODE_ABM 0/* Normal Asynchronous Balanced Mode */ +#define DLCI_MODE_ADM 1/* Asynchronous Disconnected Mode */ spinlock_t lock;/* Protects the internal state */ struct timer_list t1;/* Retransmit timer for SABM and UA */ int retries;
@@ -1380,7 +1383,13 @@ retry: ctrl->data = data; ctrl->len = clen; gsm->pending_cmd = ctrl; - gsm->cretries = gsm->n2; + +/* If DLCI0 is in ADM mode skip retries, it won't respond */ +if (gsm->dlci[0 ]->mode ==DLCI_MODE_ADM ) + gsm->cretries =1 ; +else + gsm->cretries = gsm->n2; +mod_timer (&gsm->t2_timer, jiffies + gsm->t2 *HZ /100 );gsm_control_transmit (gsm, ctrl);spin_unlock_irqrestore (&gsm->control_lock, flags);
@@ -1488,6 +1497,7 @@ static void gsm_dlci_t1(unsigned long daif (debug &8 )pr_info ("DLCI %d opening in ADM mode.\n" , dlci->addr); + dlci->mode =DLCI_MODE_ADM ;gsm_dlci_open (dlci); }else {gsm_dlci_close (dlci);
Greg Kroah-Hartman
maintainerPATCH 14/25 tty: n_gsm: Fix DLCI handling for ADM mode if debug & 2 is not set
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
commit b2d89ad9c9682e795ed6eeb9ed455789ad6cedf1 upstream.
At least on droid 4 with control channel in ADM mode, there is no response to Modem Status Command (MSC). Currently gsmtty_modem_update() expects to have data in dlci->modem_rx unless debug & 2 is set. This means that on droid 4, things only work if debug & 2 is set.
Let's fix the issue by ignoring empty dlci->modem_rx for ADM mode. In the AMD mode, CMD_MSC will never respond and gsm_process_modem() won't get called to set dlci->modem_rx.
And according to ts_127010v140000p.pdf, MSC is only relevant if basic option is chosen, so let's test for that too.
--- drivers/tty/n_gsm.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/tty/n_gsm.c +11 -0
@@ -2892,11 +2892,22 @@ static int gsmtty_modem_update(struct gsstatic int gsm_carrier_raised (struct tty_port *port) { struct gsm_dlci *dlci = container_of(port, struct gsm_dlci, port); +struct gsm_mux *gsm = dlci->gsm; +/* Not yet open so no carrier info */ if (dlci->state !=DLCI_OPEN )return 0 ;if (debug &2 )return 1 ; + +/* +* Basic mode with control channel in ADM mode may not respond +* to CMD_MSC at all and modem_rx is empty. +*/ +if (gsm->encoding ==0 && gsm->dlci[0 ]->mode ==DLCI_MODE_ADM && + !dlci->modem_rx) +return 1 ; +return dlci->modem_rx &TIOCM_CD ; }
Greg Kroah-Hartman
maintainerPATCH 15/25 tty: Use __GFP_NOFAIL for tty_ldisc_get()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tetsuo Handa <[email protected]>
commit bcdd0ca8cb8730573afebcaae4138f8f4c8eaa20 upstream.
syzbot is reporting crashes triggered by memory allocation fault injection at tty_ldisc_get() [1]. As an attempt to handle OOM in a graceful way, we have tried commit 5362544bebe85071 ("tty: don't panic on OOM in tty_set_ldisc()"). But we reverted that attempt by commit a8983d01f9b7d600 ("Revert "tty: don't panic on OOM in tty_set_ldisc()"") due to reproducible crash. We should spend resource for finding and fixing race condition bugs rather than complicate error paths for 2 * sizeof(void *) bytes allocation failure.
[1] https://syzkaller.appspot.com/bug?id=489d33fa386453859ead58ff5171d43772b13aa3
--- drivers/tty/tty_ldisc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/tty/tty_ldisc.c +5 -6
@@ -171,12 +171,11 @@ static struct tty_ldisc *tty_ldisc_get(sreturn ERR_CAST (ldops); } - ld =kmalloc (sizeof (struct tty_ldisc ),GFP_KERNEL ); -if (ld ==NULL ) { -put_ldops (ldops); -return ERR_PTR (-ENOMEM ); - } - +/* +* There is no way to handle allocation failure of only 16 bytes. +* Let's simplify error handling and save more memory. +*/ + ld =kmalloc (sizeof (struct tty_ldisc ),GFP_KERNEL | __GFP_NOFAIL); ld->ops = ldops; ld->tty = tty;
Greg Kroah-Hartman
maintainerPATCH 16/25 ALSA: core: Report audio_tstamp in snd_pcm_sync_ptr
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <[email protected]>
commit f853dcaae2f5bbe021161e421bd1576845bae8f6 upstream.
It looks like a simple mistake that this struct member was forgotten.
Audio_tstamp isn't used much, and on some archs (such as x86) this ioctl is not used by default, so that might be the reason why this has slipped for so long.
--- sound/core/pcm_native.c | 1 + 1 file changed, 1 insertion(+)
sound/core/pcm_native.c +1 -0
@@ -2695,6 +2695,7 @@ static int snd_pcm_sync_ptr(struct snd_p sync_ptr.s.status.hw_ptr = status->hw_ptr; sync_ptr.s.status.tstamp = status->tstamp; sync_ptr.s.status.suspended_state = status->suspended_state; + sync_ptr.s.status.audio_tstamp = status->audio_tstamp;snd_pcm_stream_unlock_irq (substream);if (copy_to_user (_sync_ptr, &sync_ptr,sizeof (sync_ptr)))return -EFAULT ;
Greg Kroah-Hartman
maintainerPATCH 17/25 ALSA: seq: oss: Fix unbalanced use lock for synth MIDI device
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
commit f5e94b4c6ebdabe0f602d796e0430180927521a0 upstream.
When get_synthdev() is called for a MIDI device, it returns the fixed midi_synth_dev without the use refcounting. OTOH, the caller is supposed to unreference unconditionally after the usage, so this would lead to unbalanced refcount.
This patch corrects the behavior and keep up the refcount balance also for the MIDI synth device.
--- sound/core/seq/oss/seq_oss_synth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
sound/core/seq/oss/seq_oss_synth.c +8 -4
@@ -363,10 +363,14 @@ get_synthdev(struct seq_oss_devinfo *dp,return NULL ;if (! dp->synths[dev].opened)return NULL ; -if (dp->synths[dev].is_midi) -return &midi_synth_dev; -if ((rec =get_sdev (dev)) ==NULL ) -return NULL ; +if (dp->synths[dev].is_midi) { + rec = &midi_synth_dev; +snd_use_lock_use (&rec->use_lock); + }else { + rec =get_sdev (dev); +if (!rec) +return NULL ; + }if (! rec->opened) {snd_use_lock_free (&rec->use_lock);return NULL ;
Greg Kroah-Hartman
maintainerPATCH 18/25 mtd: cfi: cmdset_0001: Do not allow read/write to suspend erase block.
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joakim Tjernlund <[email protected]>
commit 6510bbc88e3258631831ade49033537081950605 upstream.
Currently it is possible to read and/or write to suspend EB's. Writing /dev/mtdX or /dev/mtdblockX from several processes may break the flash state machine.
--- drivers/mtd/chips/cfi_cmdset_0001.c | 16 +++++++++++----- include/linux/mtd/flashchip.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/mtd/chips/cfi_cmdset_0001.c +11 -5
@@ -825,21 +825,25 @@ static int chip_ready (struct map_info * (mode == FL_WRITING && (cfip->SuspendCmdSupport & 1)))) goto sleep; +/* Do not allow suspend iff read/write to EB address */ +if ((adr & chip->in_progress_block_mask) == + chip->in_progress_block_addr) + goto sleep;/* Erase suspend */ -map_write (map,CMD (0xB0 ), adr); +map_write (map,CMD (0xB0 ), chip->in_progress_block_addr);/* If the flash has finished erasing, then 'erase suspend' * appears to make some (28F320) flash devices switch to * 'read' mode. Make sure that we switch to 'read status' * mode so we get the right data. --rmk */ -map_write (map,CMD (0x70 ), adr); +map_write (map,CMD (0x70 ), chip->in_progress_block_addr); chip->oldstate =FL_ERASING ; chip->state =FL_ERASE_SUSPENDING ; chip->erase_suspended =1 ;for (;;) { - status =map_read (map, adr); + status =map_read (map, chip->in_progress_block_addr);if (map_word_andequal (map, status, status_OK, status_OK))break ;
@@ -1035,8 +1039,8 @@ static void put_chip(struct map_info *masending the 0x70 (Read Status) command to an erasing chip and expecting it to be ignored, that's what we do. */ -map_write (map,CMD (0xd0 ), adr); -map_write (map,CMD (0x70 ), adr); +map_write (map,CMD (0xd0 ), chip->in_progress_block_addr); +map_write (map,CMD (0x70 ), chip->in_progress_block_addr); chip->oldstate =FL_READY ; chip->state =FL_ERASING ;break ;
@@ -1927,6 +1931,8 @@ static int __xipram do_erase_oneblock(stmap_write (map,CMD (0xD0 ), adr); chip->state =FL_ERASING ; chip->erase_suspended =0 ; + chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(len -1 ); ret = INVAL_CACHE_AND_WAIT(map, chip, adr, adr, len,
include/linux/mtd/flashchip.h +1 -0
@@ -85,6 +85,7 @@ struct flchip { unsigned int write_suspended:1; unsigned int erase_suspended:1;unsigned long in_progress_block_addr; +unsigned long in_progress_block_mask;struct mutex mutex;wait_queue_head_t wq;/* Wait on here when we're waiting for the chip
Greg Kroah-Hartman
maintainerPATCH 19/25 mtd: cfi: cmdset_0001: Workaround Micron Erase suspend bug.
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joakim Tjernlund <[email protected]>
commit 46a16a2283f9e678a4e26829175e0c37a5191860 upstream.
Some Micron chips does not work well wrt Erase suspend for boot blocks. This avoids the issue by not allowing Erase suspend for the boot blocks for the 28F00AP30(1GBit) chip.
--- drivers/mtd/chips/cfi_cmdset_0001.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/mtd/chips/cfi_cmdset_0001.c +17 -0
@@ -45,6 +45,7 @@#define I82802AB 0x00ad#define I82802AC 0x00ac#define PF38F4476 0x881c +#define M28F00AP30 0x8963/* STMicroelectronics chips */ #define M50LPW080 0x002F#define M50FLW080A 0x0080
@@ -375,6 +376,17 @@ static void cfi_fixup_major_minor(struct extp->MinorVersion ='1' ; } +static int cfi_is_micron_28F00AP30 (struct cfi_private *cfi,struct flchip *chip) +{ +/* +* Micron(was Numonyx) 1Gbit bottom boot are buggy w.r.t +* Erase Supend for their small Erase Blocks(0x8000) +*/ +if (cfi->mfr ==CFI_MFR_INTEL && cfi->id ==M28F00AP30 ) +return 1 ; +return 0 ; +} +static inline struct cfi_pri_intelext *read_pri_intelext (struct map_info *map,__u16 adr) {
@@ -830,6 +842,11 @@ static int chip_ready (struct map_info * chip->in_progress_block_addr) goto sleep; +/* do not suspend small EBs, buggy Micron Chips */ +if (cfi_is_micron_28F00AP30 (cfi, chip) && + (chip->in_progress_block_mask == ~(0x8000 -1 ))) + goto sleep; +/* Erase suspend */ map_write (map,CMD (0xB0 ), chip->in_progress_block_addr);
Greg Kroah-Hartman
maintainerPATCH 20/25 mtd: cfi: cmdset_0002: Do not allow read/write to suspend erase block.
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joakim Tjernlund <[email protected]>
commit 7b70eb14392a7cf505f9b358d06c33b5af73d1e7 upstream.
Currently it is possible to read and/or write to suspend EB's. Writing /dev/mtdX or /dev/mtdblockX from several processes may break the flash state machine.
Taken from cfi_cmdset_0001 driver.
--- drivers/mtd/chips/cfi_cmdset_0002.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/mtd/chips/cfi_cmdset_0002.c +6 -3
@@ -814,9 +814,10 @@ static int get_chip(struct map_info *map (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) goto sleep; -/* We could check to see if we're trying to access the sector -* that is currently being erased. However, no user will try -* anything like that so we just wait for the timeout. */ +/* Do not allow suspend iff read/write to EB address */ +if ((adr & chip->in_progress_block_mask) == + chip->in_progress_block_addr) + goto sleep;/* Erase suspend */ /* It's harmless to issue the Erase-Suspend and Erase-Resume
@@ -2265,6 +2266,7 @@ static int __xipram do_erase_chip(struct chip->state =FL_ERASING ; chip->erase_suspended =0 ; chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(map->size -1 ); INVALIDATE_CACHE_UDELAY(map, chip, adr, map->size,
@@ -2354,6 +2356,7 @@ static int __xipram do_erase_oneblock(st chip->state =FL_ERASING ; chip->erase_suspended =0 ; chip->in_progress_block_addr = adr; + chip->in_progress_block_mask = ~(len -1 ); INVALIDATE_CACHE_UDELAY(map, chip, adr, len,
Greg Kroah-Hartman
maintainerPATCH 21/25 kobject: dont use WARN for registration failures
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Vyukov <[email protected]>
commit 3e14c6abbfb5c94506edda9d8e2c145d79375798 upstream.
This WARNING proved to be noisy. The function still returns an error and callers should handle it. That's how most of kernel code works. Downgrade the WARNING to pr_err() and leave WARNINGs for kernel bugs.
--- lib/kobject.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
lib/kobject.c +5 -7
@@ -234,14 +234,12 @@ static int kobject_add_internal(struct k/* be noisy on error issues */ if (error == -EEXIST ) -WARN (1 ,"%s failed for %s with " -"-EEXIST, don't try to register things with " -"the same name in the same directory.\n" , - __func__,kobject_name (kobj)); +pr_err ("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n" , + __func__,kobject_name (kobj));else -WARN (1 ,"%s failed for %s (error: %d parent: %s)\n" , - __func__,kobject_name (kobj), error, - parent ?kobject_name (parent) :"'none'" ); +pr_err ("%s failed for %s (error: %d parent: %s)\n" , + __func__,kobject_name (kobj), error, + parent ?kobject_name (parent) :"'none'" ); }else kobj->state_in_sysfs =1 ;
Greg Kroah-Hartman
maintainerPATCH 22/25 scsi: sd: Defer spinning up drive while SANITIZE is in progress
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mahesh Rajashekhara <[email protected]>
commit 505aa4b6a8834a2300971c5220c380c3271ebde3 upstream.
A drive being sanitized will return NOT READY / ASC 0x4 / ASCQ 0x1b ("LOGICAL UNIT NOT READY. SANITIZE IN PROGRESS").
Prevent spinning up the drive until this condition clears.
[mkp: tweaked commit message]
--- drivers/scsi/sd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/sd.c +2 -0
@@ -1848,6 +1848,8 @@ sd_spinup_disk(struct scsi_disk *sdkp)break ;/* standby */ if (sshdr.asc ==4 && sshdr.ascq ==0xc )break ;/* unavailable */ +if (sshdr.asc ==4 && sshdr.ascq ==0x1b ) +break ;/* sanitize in progress */ /* * Issue command to spin up drive when not ready */
Greg Kroah-Hartman
maintainerPATCH 23/25 ASoC: fsl_esai: Fix divisor calculation failure at lower ratio
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicolin Chen <[email protected]>
commit c656941df9bc80f7ec65b92ca73c42f8b0b62628 upstream.
When the desired ratio is less than 256, the savesub (tolerance) in the calculation would become 0. This will then fail the loop- search immediately without reporting any errors.
But if the ratio is smaller enough, there is no need to calculate the tolerance because PM divisor alone is enough to get the ratio.
So a simple fix could be just to set PM directly instead of going into the loop-search.
--- sound/soc/fsl/fsl_esai.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/fsl/fsl_esai.c +7 -0
@@ -143,6 +143,13 @@ static int fsl_esai_divisor_cal(struct s psr = ratio <=256 * maxfp ? ESAI_xCCR_xPSR_BYPASS : ESAI_xCCR_xPSR_DIV8; +/* Do not loop-search if PM (1 ~ 256) alone can serve the ratio */ +if (ratio <=256 ) { + pm = ratio; + fp =1 ; + goto out; + } +/* Set the max fluctuation -- 0.1% of the max devisor */ savesub = (psr ?1 :8 ) *256 * maxfp /1000 ;
Greg Kroah-Hartman
maintainerPATCH 24/25 libceph: validate con->state at the top of try_write()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Dryomov <[email protected]>
commit 9c55ad1c214d9f8c4594ac2c3fa392c1c32431a7 upstream.
ceph_con_workfn() validates con->state before calling try_read() and then try_write(). However, try_read() temporarily releases con->mutex, notably in process_message() and ceph_con_in_msg_alloc(), opening the window for ceph_con_close() to sneak in, close the connection and release con->sock. When try_write() is called on the assumption that con->state is still valid (i.e. not STANDBY or CLOSED), a NULL sock gets passed to the networking stack:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 IP: selinux_socket_sendmsg+0x5/0x20
Make sure con->state is valid at the top of try_write() and add an explicit BUG_ON for this, similar to try_read().
--- net/ceph/messenger.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/ceph/messenger.c +7 -0
@@ -2449,6 +2449,11 @@ static int try_write(struct ceph_connectint ret =1 ;dout ("try_write start %p state %lu\n" , con, con->state); +if (con->state !=CON_STATE_PREOPEN && + con->state !=CON_STATE_CONNECTING && + con->state !=CON_STATE_NEGOTIATING && + con->state !=CON_STATE_OPEN ) +return 0 ; more:dout ("try_write out_kvec_bytes %d\n" , con->out_kvec_bytes);
@@ -2474,6 +2479,8 @@ more: } more_kvec: +BUG_ON (!con->sock); +/* kvec data queued? */ if (con->out_skip) { ret =write_partial_skip (con);
Greg Kroah-Hartman
maintainerPATCH 25/25 Revert "perf tests: Decompress kernel module before objdump"
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <[email protected]>
This reverts commit 091b3b4ba55daf8b28f40794aefdaa0bdb5af7a1 which is commit 94df1040b1e6aacd8dec0ba3c61d7e77cd695f26 upstream.
It breaks the build of perf on 3.18.y, so I'm dropping it.
--- tools/perf/tests/code-reading.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
tools/perf/tests/code-reading.c +1 -19
@@ -141,8 +141,6 @@ static int read_object_code(u64 addr, siunsigned char buf2[BUFSZ ];size_t ret_len;u64 objdump_addr; -const char *objdump_name; -char decomp_name[KMOD_DECOMP_LEN ];int ret;pr_debug ("Reading object code for memory address: %#" PRIx64"\n" , addr);
@@ -204,25 +202,9 @@ static int read_object_code(u64 addr, si state->done[state->done_cnt++] = al.map->start; } - objdump_name = al.map->dso->long_name; -if (dso__needs_decompress (al.map->dso)) { -if (dso__decompress_kmodule_path (al.map->dso, objdump_name, - decomp_name, -sizeof (decomp_name)) <0 ) { -pr_debug ("decompression failed\n" ); -return -1 ; - } - - objdump_name = decomp_name; - } -/* Read the object code using objdump */ objdump_addr =map__rip_2objdump (al.map, al.addr); - ret =read_via_objdump (objdump_name, objdump_addr, buf2, len); - -if (dso__needs_decompress (al.map->dso)) -unlink (objdump_name); - + ret =read_via_objdump (al.map->dso->long_name, objdump_addr, buf2, len);if (ret >0 ) {/* * The kernel maps are inaccurate - assume objdump is right in
stable-rc/linux-3.18.y boot: 62 boots: 0 failed, 62 passed (v3.18.107-26-g261b9a2d80e9)
stable-rc/linux-3.18.y boot: 62 boots: 0 failed, 62 passed (v3.18.107-26-g261b9a2d80e9)
Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-3.18.y/kernel/v3.18.107-26-g261b9a2d80e9/
Full Build Summary: https://kernelci.org/build/stable-rc/branch/linux-3.18.y/kernel/v3.18.107-26-g261b9a2d80e9/
Tree: stable-rc
Branch: linux-3.18.y
Git Describe: v3.18.107-26-g261b9a2d80e9
Git Commit: 261b9a2d80e901dfcaaf4feeaa2b900685f53a96
Git URL: http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Tested: 31 unique boards, 12 SoC families, 15 builds out of 183
---
For more info write to <[email protected]>
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.108 release. There are 25 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 May 2 18:39:02 UTC 2018. 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/v3.x/stable-review/patch-3.18.108-rc1.gz
Quoted 8 lines
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
linux-3.18.y
and the diffstat can be found below.thanks,
greg k-h
Builds and boots on the OnePlus3T, no immediate regressions. Thanks for the update!
Signature · 1 line
Harsh Shandilya, PRJKT Development LLC
Greg Kroah-Hartman
maintainerQuoted 16 lines · Harsh Shandilya
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.108 release. There are 25 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 May 2 18:39:02 UTC 2018. 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/v3.x/stable-review/patch-3.18.108-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
linux-3.18.y
and the diffstat can be found below.
Quoted 4 lines
Quoted 3 lines
thanks,
greg k-h
Builds and boots on the OnePlus3T, no immediate regressions. Thanks for the update!
thanks for testing!
greg k-h
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.108 release. There are 25 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 May 2 18:39:02 UTC 2018. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 119 pass: 119 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 10 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.108 release. There are 25 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 May 2 18:39:02 UTC 2018. Anything received after that time might be too late.
Quoted 6 lines
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 119 pass: 119 fail: 0Details are available at http://kerneltests.org/builders.
Great, thanks for letting me know and testing all of these.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.108 release. There are 25 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 May 2 18:39:02 UTC 2018. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.108-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah