[PATCH AUTOSEL 4.14 36/52] xfs: make sure the rt allocator doesn't run off the end

2020-10-18 Thread Sasha Levin
From: "Darrick J. Wong" [ Upstream commit 2a6ca4baed620303d414934aa1b7b0a8e7bab05f ] There's an overflow bug in the realtime allocator. If the rt volume is large enough to handle a single allocation request that is larger than the maximum bmap extent length and the rt bitmap ends exactly on a

[PATCH AUTOSEL 4.14 13/52] media: media/pci: prevent memory leak in bttv_probe

2020-10-18 Thread Sasha Levin
From: Xiaolong Huang [ Upstream commit 7b817585b730665126b45df5508dd69526448bc8 ] In bttv_probe if some functions such as pci_enable_device, pci_set_dma_mask and request_mem_region fails the allocated memory for btv should be released. Signed-off-by: Xiaolong Huang Signed-off-by: Hans

[PATCH AUTOSEL 4.14 27/52] misc: vop: add round_up(x,4) for vring_size to avoid kernel panic

2020-10-18 Thread Sasha Levin
From: Sherry Sun [ Upstream commit cc1a2679865a94b83804822996eed010a50a7c1d ] Since struct _mic_vring_info and vring are allocated together and follow vring, if the vring_size() is not four bytes aligned, which will cause the start address of struct _mic_vring_info is not four byte aligned. For

[PATCH AUTOSEL 4.14 21/52] ntfs: add check for mft record size in superblock

2020-10-18 Thread Sasha Levin
From: Rustam Kovhaev [ Upstream commit 4f8c94022f0bc3babd0a124c0a7dcdd7547bd94e ] Number of bytes allocated for mft record should be equal to the mft record size stored in ntfs superblock as reported by syzbot, userspace might trigger out-of-bounds read by dereferencing ctx->attr in

[PATCH AUTOSEL 4.14 31/52] USB: cdc-acm: handle broken union descriptors

2020-10-18 Thread Sasha Levin
From: Johan Hovold [ Upstream commit 960c7339de27c6d6fec13b54880501c3576bb08d ] Handle broken union functional descriptors where the master-interface doesn't exist or where its class is of neither Communication or Data type (as required by the specification) by falling back to

[PATCH AUTOSEL 4.14 24/52] scsi: mvumi: Fix error return in mvumi_io_attach()

2020-10-18 Thread Sasha Levin
From: Jing Xiangfeng [ Upstream commit 055f15ab2cb4a5cbc4c0a775ef3d0066e0fa9b34 ] Return PTR_ERR() from the error handling case instead of 0. Link: https://lore.kernel.org/r/20200910123848.93649-1-jingxiangf...@huawei.com Signed-off-by: Jing Xiangfeng Signed-off-by: Martin K. Petersen

[PATCH AUTOSEL 4.14 40/52] brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

2020-10-18 Thread Sasha Levin
From: Keita Suzuki [ Upstream commit f4443293d741d1776b86ed1dd8c4e4285d0775fc ] When wlc_phy_txpwr_srom_read_lcnphy fails in wlc_phy_attach_lcnphy, the allocated pi->u.pi_lcnphy is leaked, since struct brcms_phy will be freed in the caller function. Fix this by calling wlc_phy_detach_lcnphy in

[PATCH AUTOSEL 4.14 29/52] udf: Limit sparing table size

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit 44ac6b829c4e173fdf6df18e6dd86aecf9a3dc99 ] Although UDF standard allows it, we don't support sparing table larger than a single block. Check it during mount so that we don't try to access memory beyond end of buffer. Reported-by:

[PATCH AUTOSEL 4.14 20/52] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-10-18 Thread Sasha Levin
From: Mathieu Desnoyers [ Upstream commit 272928d1cdacfc3b55f605cb0e9115832ecfb20c ] As per RFC4443, the destination address field for ICMPv6 error messages is copied from the source address field of the invoking packet. In configurations with Virtual Routing and Forwarding tables, looking up

[PATCH AUTOSEL 4.14 28/52] usb: gadget: function: printer: fix use-after-free in __lock_acquire

2020-10-18 Thread Sasha Levin
From: Zqiang [ Upstream commit e8d5f92b8d30bb4ade76494490c3c065e12411b1 ] Fix this by increase object reference count. BUG: KASAN: use-after-free in __lock_acquire+0x3fd4/0x4180 kernel/locking/lockdep.c:3831 Read of size 8 at addr 8880683b0018 by task syz-executor.0/3377 CPU: 1 PID: 3377

[PATCH AUTOSEL 4.14 30/52] udf: Avoid accessing uninitialized data on failed inode read

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit 044e2e26f214e5ab26af85faffd8d1e4ec066931 ] When we fail to read inode, some data accessed in udf_evict_inode() may be uninitialized. Move the accesses to !is_bad_inode() branch. Reported-by: syzbot+91f02b28f9bb5f5f1...@syzkaller.appspotmail.com Signed-off-by:

[PATCH AUTOSEL 4.14 22/52] mac80211: handle lack of sband->bitrates in rates

2020-10-18 Thread Sasha Levin
From: Thomas Pedersen [ Upstream commit 8b783d104e7f40684333d2ec155fac39219beb2f ] Even though a driver or mac80211 shouldn't produce a legacy bitrate if sband->bitrates doesn't exist, don't crash if that is the case either. This fixes a kernel panic if station dump is run before last_rate can

[PATCH AUTOSEL 4.14 17/52] media: saa7134: avoid a shift overflow

2020-10-18 Thread Sasha Levin
From: Mauro Carvalho Chehab [ Upstream commit 15a36aae1ec1c1f17149b6113b92631791830740 ] As reported by smatch: drivers/media/pci/saa7134//saa7134-tvaudio.c:686 saa_dsp_writel() warn: should 'reg << 2' be a 64 bit type? On a 64-bits Kernel, the shift might be bigger than 32 bits. In

[PATCH AUTOSEL 4.14 41/52] rtl8xxxu: prevent potential memory leak

2020-10-18 Thread Sasha Levin
From: Chris Chiu [ Upstream commit 86279456a4d47782398d3cb8193f78f672e36cac ] Free the skb if usb_submit_urb fails on rx_urb. And free the urb no matter usb_submit_urb succeeds or not in rtl8xxxu_submit_int_urb. Signed-off-by: Chris Chiu Signed-off-by: Kalle Valo Link:

[PATCH AUTOSEL 4.14 15/52] seccomp: kill process instead of thread for unknown actions

2020-10-18 Thread Sasha Levin
From: Rich Felker [ Upstream commit 4d671d922d51907bc41f1f7f2dc737c928ae78fd ] Asynchronous termination of a thread outside of the userspace thread library's knowledge is an unsafe operation that leaves the process in an inconsistent, corrupt, and possibly unrecoverable state. In order to make

[PATCH AUTOSEL 4.14 42/52] Fix use after free in get_capset_info callback.

2020-10-18 Thread Sasha Levin
From: Doug Horn [ Upstream commit e219688fc5c3d0d9136f8d29d7e0498388f01440 ] If a response to virtio_gpu_cmd_get_capset_info takes longer than five seconds to return, the callback will access freed kernel memory in vg->capsets. Signed-off-by: Doug Horn Link:

[PATCH AUTOSEL 4.14 44/52] scsi: qedi: Fix list_del corruption while removing active I/O

2020-10-18 Thread Sasha Levin
From: Nilesh Javali [ Upstream commit 28b35d17f9f8573d4646dd8df08917a4076a6b63 ] While aborting the I/O, the firmware cleanup task timed out and driver deleted the I/O from active command list. Some time later the firmware sent the cleanup task response and driver again deleted the I/O from

[PATCH AUTOSEL 4.14 32/52] can: flexcan: flexcan_chip_stop(): add error handling and propagate error value

2020-10-18 Thread Sasha Levin
From: Joakim Zhang [ Upstream commit 9ad02c7f4f279504bdd38ab706fdc97d5f2b2a9c ] This patch implements error handling and propagates the error value of flexcan_chip_stop(). This function will be called from flexcan_suspend() in an upcoming patch in some SoCs which support LPSR mode. Add a new

[PATCH AUTOSEL 4.14 43/52] scsi: qedi: Protect active command list to avoid list corruption

2020-10-18 Thread Sasha Levin
From: Nilesh Javali [ Upstream commit c0650e28448d606c84f76c34333dba30f61de993 ] Protect active command list for non-I/O commands like login response, logout response, text response, and recovery cleanup of active list to avoid list corruption. Link:

[PATCH AUTOSEL 4.14 46/52] ipvs: Fix uninit-value in do_ip_vs_set_ctl()

2020-10-18 Thread Sasha Levin
From: Peilin Ye [ Upstream commit c5a8a8498eed1c164afc94f50a939c1a10abf8ad ] do_ip_vs_set_ctl() is referencing uninitialized stack value when `len` is zero. Fix it. Reported-by: syzbot+23b5f9e7caf61d9a3...@syzkaller.appspotmail.com Link:

[PATCH AUTOSEL 4.14 51/52] scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config()

2020-10-18 Thread Sasha Levin
From: Can Guo [ Upstream commit 89dd87acd40a44de8ff3358138aedf8f73f4efc6 ] If ufs_qcom_dump_dbg_regs() calls ufs_qcom_testbus_config() from ufshcd_suspend/resume and/or clk gate/ungate context, pm_runtime_get_sync() and ufshcd_hold() will cause a race condition. Fix this by removing the

[PATCH AUTOSEL 4.14 39/52] scsi: ibmvfc: Fix error return in ibmvfc_probe()

2020-10-18 Thread Sasha Levin
From: Jing Xiangfeng [ Upstream commit 5e48a084f4e824e1b624d3fd7ddcf53d2ba69e53 ] Fix to return error code PTR_ERR() from the error handling case instead of 0. Link: https://lore.kernel.org/r/20200907083949.154251-1-jingxiangf...@huawei.com Acked-by: Tyrel Datwyler Signed-off-by: Jing

[PATCH AUTOSEL 4.14 45/52] tty: ipwireless: fix error handling

2020-10-18 Thread Sasha Levin
From: Tong Zhang [ Upstream commit db332356222d9429731ab9395c89cca403828460 ] ipwireless_send_packet() can only return 0 on success and -ENOMEM on error, the caller should check non zero for error condition Signed-off-by: Tong Zhang Acked-by: David Sterba Link:

[PATCH AUTOSEL 4.14 47/52] reiserfs: Fix memory leak in reiserfs_parse_options()

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit e9d4709fcc26353df12070566970f080e651f0c9 ] When a usrjquota or grpjquota mount option is used multiple times, we will leak memory allocated for the file name. Make sure the last setting is used and all the previous ones are properly freed. Reported-by:

[PATCH AUTOSEL 4.14 50/52] usb: core: Solve race condition in anchor cleanup functions

2020-10-18 Thread Sasha Levin
From: Eli Billauer [ Upstream commit fbc299437c06648afcc7891e6e2e6638dd48d4df ] usb_kill_anchored_urbs() is commonly used to cancel all URBs on an anchor just before releasing resources which the URBs rely on. By doing so, users of this function rely on that no completer callbacks will take

[PATCH AUTOSEL 4.14 48/52] mwifiex: don't call del_timer_sync() on uninitialized timer

2020-10-18 Thread Sasha Levin
From: Tetsuo Handa [ Upstream commit 621a3a8b1c0ecf16e1e5667ea5756a76a082b738 ] syzbot is reporting that del_timer_sync() is called from mwifiex_usb_cleanup_tx_aggr() from mwifiex_unregister_dev() without checking timer_setup() from mwifiex_usb_tx_init() was called [1]. Ganapathi Bhat proposed

[PATCH AUTOSEL 4.9 11/41] media: media/pci: prevent memory leak in bttv_probe

2020-10-18 Thread Sasha Levin
From: Xiaolong Huang [ Upstream commit 7b817585b730665126b45df5508dd69526448bc8 ] In bttv_probe if some functions such as pci_enable_device, pci_set_dma_mask and request_mem_region fails the allocated memory for btv should be released. Signed-off-by: Xiaolong Huang Signed-off-by: Hans

[PATCH AUTOSEL 4.9 06/41] media: exynos4-is: Fix a reference count leak

2020-10-18 Thread Sasha Levin
From: Qiushi Wu [ Upstream commit 64157b2cb1940449e7df2670e85781c690266588 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. Thus call

[PATCH AUTOSEL 4.9 03/41] media: ati_remote: sanity check for both endpoints

2020-10-18 Thread Sasha Levin
From: Oliver Neukum [ Upstream commit a8be80053ea74bd9c3f9a3810e93b802236d6498 ] If you do sanity checks, you should do them for both endpoints. Hence introduce checking for endpoint type for the output endpoint, too. Reported-by: syzbot+998261c2ae5932458...@syzkaller.appspotmail.com

[PATCH AUTOSEL 4.9 07/41] media: vsp1: Fix runtime PM imbalance on error

2020-10-18 Thread Sasha Levin
From: Dinghao Liu [ Upstream commit 98fae901c8883640202802174a4bd70a1b9118bd ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao

[PATCH AUTOSEL 4.9 15/41] fs: dlm: fix configfs memory leak

2020-10-18 Thread Sasha Levin
From: Alexander Aring [ Upstream commit 3d2825c8c6105b0f36f3ff72760799fa2e71420e ] This patch fixes the following memory detected by kmemleak and umount gfs2 filesystem which removed the last lockspace: unreferenced object 0x9264f482f600 (size 192): comm "dlm_controld", pid 325, jiffies

[PATCH AUTOSEL 4.9 16/41] ntfs: add check for mft record size in superblock

2020-10-18 Thread Sasha Levin
From: Rustam Kovhaev [ Upstream commit 4f8c94022f0bc3babd0a124c0a7dcdd7547bd94e ] Number of bytes allocated for mft record should be equal to the mft record size stored in ntfs superblock as reported by syzbot, userspace might trigger out-of-bounds read by dereferencing ctx->attr in

[PATCH AUTOSEL 4.9 08/41] media: platform: s3c-camif: Fix runtime PM imbalance on error

2020-10-18 Thread Sasha Levin
From: Dinghao Liu [ Upstream commit dafa3605fe60d5a61239d670919b2a36e712481e ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Also, call

[PATCH AUTOSEL 4.19 24/56] mac80211: handle lack of sband->bitrates in rates

2020-10-18 Thread Sasha Levin
From: Thomas Pedersen [ Upstream commit 8b783d104e7f40684333d2ec155fac39219beb2f ] Even though a driver or mac80211 shouldn't produce a legacy bitrate if sband->bitrates doesn't exist, don't crash if that is the case either. This fixes a kernel panic if station dump is run before last_rate can

[PATCH AUTOSEL 4.9 10/41] media: bdisp: Fix runtime PM imbalance on error

2020-10-18 Thread Sasha Levin
From: Dinghao Liu [ Upstream commit dbd2f2dc025f9be8ae063e4f270099677238f620 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao

[PATCH AUTOSEL 4.9 18/41] scsi: mvumi: Fix error return in mvumi_io_attach()

2020-10-18 Thread Sasha Levin
From: Jing Xiangfeng [ Upstream commit 055f15ab2cb4a5cbc4c0a775ef3d0066e0fa9b34 ] Return PTR_ERR() from the error handling case instead of 0. Link: https://lore.kernel.org/r/20200910123848.93649-1-jingxiangf...@huawei.com Signed-off-by: Jing Xiangfeng Signed-off-by: Martin K. Petersen

[PATCH AUTOSEL 4.9 13/41] mmc: sdio: Check for CISTPL_VERS_1 buffer size

2020-10-18 Thread Sasha Levin
From: Pali Rohár [ Upstream commit 8ebe2607965d3e2dc02029e8c7dd35fbe508ffd0 ] Before parsing CISTPL_VERS_1 structure check that its size is at least two bytes to prevent buffer overflow. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200727133837.19086-2-p...@kernel.org

[PATCH AUTOSEL 4.9 28/41] reiserfs: only call unlock_new_inode() if I_NEW

2020-10-18 Thread Sasha Levin
From: Eric Biggers [ Upstream commit 8859bf2b1278d064a139e3031451524a49a56bd0 ] unlock_new_inode() is only meant to be called after a new inode has already been inserted into the hash table. But reiserfs_new_inode() can call it even before it has inserted the inode, triggering the WARNING in

[PATCH AUTOSEL 4.9 04/41] media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_sync

2020-10-18 Thread Sasha Levin
From: Qiushi Wu [ Upstream commit 7ef64ceea0008c17e94a8a2c60c5d6d46f481996 ] On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Qiushi Wu Signed-off-by: Hans Verkuil

[PATCH AUTOSEL 4.9 19/41] scsi: target: core: Add CONTROL field for trace events

2020-10-18 Thread Sasha Levin
From: Roman Bolshakov [ Upstream commit 7010645ba7256992818b518163f46bd4cdf8002a ] trace-cmd report doesn't show events from target subsystem because scsi_command_size() leaks through event format string: [target:target_sequencer_start] function scsi_command_size not defined

[PATCH AUTOSEL 4.9 26/41] ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()

2020-10-18 Thread Sasha Levin
From: Brooke Basile [ Upstream commit 03fb92a432ea5abe5909bca1455b7e44a9380480 ] Calls to usb_kill_anchored_urbs() after usb_kill_urb() on multiprocessor systems create a race condition in which usb_kill_anchored_urbs() deallocates the URB before the completer callback is called in

[PATCH AUTOSEL 4.9 23/41] udf: Limit sparing table size

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit 44ac6b829c4e173fdf6df18e6dd86aecf9a3dc99 ] Although UDF standard allows it, we don't support sparing table larger than a single block. Check it during mount so that we don't try to access memory beyond end of buffer. Reported-by:

[PATCH AUTOSEL 4.9 24/41] udf: Avoid accessing uninitialized data on failed inode read

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit 044e2e26f214e5ab26af85faffd8d1e4ec066931 ] When we fail to read inode, some data accessed in udf_evict_inode() may be uninitialized. Move the accesses to !is_bad_inode() branch. Reported-by: syzbot+91f02b28f9bb5f5f1...@syzkaller.appspotmail.com Signed-off-by:

[PATCH AUTOSEL 4.19 21/56] ipv6/icmp: l3mdev: Perform icmp error route lookup on source device routing table (v2)

2020-10-18 Thread Sasha Levin
From: Mathieu Desnoyers [ Upstream commit 272928d1cdacfc3b55f605cb0e9115832ecfb20c ] As per RFC4443, the destination address field for ICMPv6 error messages is copied from the source address field of the invoking packet. In configurations with Virtual Routing and Forwarding tables, looking up

[PATCH AUTOSEL 4.9 25/41] USB: cdc-acm: handle broken union descriptors

2020-10-18 Thread Sasha Levin
From: Johan Hovold [ Upstream commit 960c7339de27c6d6fec13b54880501c3576bb08d ] Handle broken union functional descriptors where the master-interface doesn't exist or where its class is of neither Communication or Data type (as required by the specification) by falling back to

[PATCH AUTOSEL 4.9 20/41] mic: vop: copy data to kernel space then write to io memory

2020-10-18 Thread Sasha Levin
From: Sherry Sun [ Upstream commit 675f0ad4046946e80412896436164d172cd92238 ] Read and write io memory should address align on ARCH ARM. Change to use memcpy_toio to avoid kernel panic caused by the address un-align issue. Signed-off-by: Sherry Sun Signed-off-by: Joakim Zhang Link:

[PATCH AUTOSEL 4.9 21/41] misc: vop: add round_up(x,4) for vring_size to avoid kernel panic

2020-10-18 Thread Sasha Levin
From: Sherry Sun [ Upstream commit cc1a2679865a94b83804822996eed010a50a7c1d ] Since struct _mic_vring_info and vring are allocated together and follow vring, if the vring_size() is not four bytes aligned, which will cause the start address of struct _mic_vring_info is not four byte aligned. For

[PATCH AUTOSEL 4.19 25/56] PM: hibernate: remove the bogus call to get_gendisk() in software_resume()

2020-10-18 Thread Sasha Levin
From: Christoph Hellwig [ Upstream commit 428805c0c5e76ef643b1fbc893edfb636b3d8aef ] get_gendisk grabs a reference on the disk and file operation, so this code will leak both of them while having absolutely no use for the gendisk itself. This effectively reverts commit 2df83fa4bce421f ("PM /

[PATCH AUTOSEL 4.9 12/41] media: uvcvideo: Ensure all probed info is returned to v4l2

2020-10-18 Thread Sasha Levin
From: Adam Goode [ Upstream commit 8a652a17e3c005dcdae31b6c8fdf14382a29cbbe ] bFrameIndex and bFormatIndex can be negotiated by the camera during probing, resulting in the camera choosing a different format than expected. v4l2 can already accommodate such changes, but the code was not updating

[PATCH AUTOSEL 4.9 29/41] xfs: make sure the rt allocator doesn't run off the end

2020-10-18 Thread Sasha Levin
From: "Darrick J. Wong" [ Upstream commit 2a6ca4baed620303d414934aa1b7b0a8e7bab05f ] There's an overflow bug in the realtime allocator. If the rt volume is large enough to handle a single allocation request that is larger than the maximum bmap extent length and the rt bitmap ends exactly on a

[PATCH AUTOSEL 4.9 38/41] reiserfs: Fix memory leak in reiserfs_parse_options()

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit e9d4709fcc26353df12070566970f080e651f0c9 ] When a usrjquota or grpjquota mount option is used multiple times, we will leak memory allocated for the file name. Make sure the last setting is used and all the previous ones are properly freed. Reported-by:

[PATCH AUTOSEL 4.9 35/41] Fix use after free in get_capset_info callback.

2020-10-18 Thread Sasha Levin
From: Doug Horn [ Upstream commit e219688fc5c3d0d9136f8d29d7e0498388f01440 ] If a response to virtio_gpu_cmd_get_capset_info takes longer than five seconds to return, the callback will access freed kernel memory in vg->capsets. Signed-off-by: Doug Horn Link:

[PATCH AUTOSEL 4.9 36/41] tty: ipwireless: fix error handling

2020-10-18 Thread Sasha Levin
From: Tong Zhang [ Upstream commit db332356222d9429731ab9395c89cca403828460 ] ipwireless_send_packet() can only return 0 on success and -ENOMEM on error, the caller should check non zero for error condition Signed-off-by: Tong Zhang Acked-by: David Sterba Link:

[PATCH AUTOSEL 4.9 17/41] PM: hibernate: remove the bogus call to get_gendisk() in software_resume()

2020-10-18 Thread Sasha Levin
From: Christoph Hellwig [ Upstream commit 428805c0c5e76ef643b1fbc893edfb636b3d8aef ] get_gendisk grabs a reference on the disk and file operation, so this code will leak both of them while having absolutely no use for the gendisk itself. This effectively reverts commit 2df83fa4bce421f ("PM /

[PATCH AUTOSEL 4.9 41/41] ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n()

2020-10-18 Thread Sasha Levin
From: Zekun Shen [ Upstream commit bad60b8d1a7194df38fd7fe4b22f3f4dcf775099 ] The idx in __ath10k_htt_rx_ring_fill_n function lives in consistent dma region writable by the device. Malfunctional or malicious device could manipulate such idx to have a OOB write. Either by

[PATCH AUTOSEL 4.9 27/41] misc: rtsx: Fix memory leak in rtsx_pci_probe

2020-10-18 Thread Sasha Levin
From: Keita Suzuki [ Upstream commit bc28369c6189009b66d9619dd9f09bd8c684bb98 ] When mfd_add_devices() fail, pcr->slots should also be freed. However, the current implementation does not free the member, leading to a memory leak. Fix this by adding a new goto label that frees pcr->slots.

[PATCH AUTOSEL 4.9 31/41] Bluetooth: Only mark socket zapped after unlocking

2020-10-18 Thread Sasha Levin
From: Abhishek Pandit-Subedi [ Upstream commit 20ae4089d0afeb24e9ceb026b996bfa55c983cc2 ] Since l2cap_sock_teardown_cb doesn't acquire the channel lock before setting the socket as zapped, it could potentially race with l2cap_sock_release which frees the socket. Thus, wait until the cleanup is

[PATCH AUTOSEL 4.4 01/33] media: firewire: fix memory leak

2020-10-18 Thread Sasha Levin
From: Pavel Machek [ Upstream commit b28e32798c78a346788d412f1958f36bb760ec03 ] Fix memory leak in node_probe. Signed-off-by: Pavel Machek (CIP) Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/firewire/firedtv-fw.c | 6 --

[PATCH AUTOSEL 4.9 22/41] usb: gadget: function: printer: fix use-after-free in __lock_acquire

2020-10-18 Thread Sasha Levin
From: Zqiang [ Upstream commit e8d5f92b8d30bb4ade76494490c3c065e12411b1 ] Fix this by increase object reference count. BUG: KASAN: use-after-free in __lock_acquire+0x3fd4/0x4180 kernel/locking/lockdep.c:3831 Read of size 8 at addr 8880683b0018 by task syz-executor.0/3377 CPU: 1 PID: 3377

[PATCH AUTOSEL 4.4 02/33] media: ati_remote: sanity check for both endpoints

2020-10-18 Thread Sasha Levin
From: Oliver Neukum [ Upstream commit a8be80053ea74bd9c3f9a3810e93b802236d6498 ] If you do sanity checks, you should do them for both endpoints. Hence introduce checking for endpoint type for the output endpoint, too. Reported-by: syzbot+998261c2ae5932458...@syzkaller.appspotmail.com

[PATCH AUTOSEL 4.4 03/33] media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_sync

2020-10-18 Thread Sasha Levin
From: Qiushi Wu [ Upstream commit 7ef64ceea0008c17e94a8a2c60c5d6d46f481996 ] On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Qiushi Wu Signed-off-by: Hans Verkuil

[PATCH AUTOSEL 4.4 08/33] media: uvcvideo: Ensure all probed info is returned to v4l2

2020-10-18 Thread Sasha Levin
From: Adam Goode [ Upstream commit 8a652a17e3c005dcdae31b6c8fdf14382a29cbbe ] bFrameIndex and bFormatIndex can be negotiated by the camera during probing, resulting in the camera choosing a different format than expected. v4l2 can already accommodate such changes, but the code was not updating

[PATCH AUTOSEL 4.4 16/33] udf: Limit sparing table size

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit 44ac6b829c4e173fdf6df18e6dd86aecf9a3dc99 ] Although UDF standard allows it, we don't support sparing table larger than a single block. Check it during mount so that we don't try to access memory beyond end of buffer. Reported-by:

[PATCH AUTOSEL 4.4 09/33] mmc: sdio: Check for CISTPL_VERS_1 buffer size

2020-10-18 Thread Sasha Levin
From: Pali Rohár [ Upstream commit 8ebe2607965d3e2dc02029e8c7dd35fbe508ffd0 ] Before parsing CISTPL_VERS_1 structure check that its size is at least two bytes to prevent buffer overflow. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20200727133837.19086-2-p...@kernel.org

[PATCH AUTOSEL 4.4 17/33] udf: Avoid accessing uninitialized data on failed inode read

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit 044e2e26f214e5ab26af85faffd8d1e4ec066931 ] When we fail to read inode, some data accessed in udf_evict_inode() may be uninitialized. Move the accesses to !is_bad_inode() branch. Reported-by: syzbot+91f02b28f9bb5f5f1...@syzkaller.appspotmail.com Signed-off-by:

[PATCH AUTOSEL 4.4 13/33] scsi: mvumi: Fix error return in mvumi_io_attach()

2020-10-18 Thread Sasha Levin
From: Jing Xiangfeng [ Upstream commit 055f15ab2cb4a5cbc4c0a775ef3d0066e0fa9b34 ] Return PTR_ERR() from the error handling case instead of 0. Link: https://lore.kernel.org/r/20200910123848.93649-1-jingxiangf...@huawei.com Signed-off-by: Jing Xiangfeng Signed-off-by: Martin K. Petersen

[PATCH] dt-bindings: mailbox: mtk-gce: fix incorrect mbox-cells value

2020-10-18 Thread Fabien Parent
As the binding documentation says, #mbox-cells must have a value of 2, but the example use a value 3. The MT8173 device tree correctly use mbox-cells = <2>. This commit fixes the example. Signed-off-by: Fabien Parent --- Documentation/devicetree/bindings/mailbox/mtk-gce.txt | 2 +- 1 file

[PATCH AUTOSEL 4.4 11/33] ntfs: add check for mft record size in superblock

2020-10-18 Thread Sasha Levin
From: Rustam Kovhaev [ Upstream commit 4f8c94022f0bc3babd0a124c0a7dcdd7547bd94e ] Number of bytes allocated for mft record should be equal to the mft record size stored in ntfs superblock as reported by syzbot, userspace might trigger out-of-bounds read by dereferencing ctx->attr in

[PATCH AUTOSEL 4.4 20/33] reiserfs: only call unlock_new_inode() if I_NEW

2020-10-18 Thread Sasha Levin
From: Eric Biggers [ Upstream commit 8859bf2b1278d064a139e3031451524a49a56bd0 ] unlock_new_inode() is only meant to be called after a new inode has already been inserted into the hash table. But reiserfs_new_inode() can call it even before it has inserted the inode, triggering the WARNING in

[PATCH AUTOSEL 4.9 32/41] scsi: ibmvfc: Fix error return in ibmvfc_probe()

2020-10-18 Thread Sasha Levin
From: Jing Xiangfeng [ Upstream commit 5e48a084f4e824e1b624d3fd7ddcf53d2ba69e53 ] Fix to return error code PTR_ERR() from the error handling case instead of 0. Link: https://lore.kernel.org/r/20200907083949.154251-1-jingxiangf...@huawei.com Acked-by: Tyrel Datwyler Signed-off-by: Jing

[PATCH AUTOSEL 4.4 06/33] media: bdisp: Fix runtime PM imbalance on error

2020-10-18 Thread Sasha Levin
From: Dinghao Liu [ Upstream commit dbd2f2dc025f9be8ae063e4f270099677238f620 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao

[PATCH AUTOSEL 4.4 07/33] media: media/pci: prevent memory leak in bttv_probe

2020-10-18 Thread Sasha Levin
From: Xiaolong Huang [ Upstream commit 7b817585b730665126b45df5508dd69526448bc8 ] In bttv_probe if some functions such as pci_enable_device, pci_set_dma_mask and request_mem_region fails the allocated memory for btv should be released. Signed-off-by: Xiaolong Huang Signed-off-by: Hans

[PATCH AUTOSEL 4.4 22/33] usb: ohci: Default to per-port over-current protection

2020-10-18 Thread Sasha Levin
From: Hamish Martin [ Upstream commit b77d2a0a223bc139ee8904991b2922d215d02636 ] Some integrated OHCI controller hubs do not expose all ports of the hub to pins on the SoC. In some cases the unconnected ports generate spurious over-current events. For example the Broadcom 56060/Ranger 2 SoC

[PATCH AUTOSEL 4.4 23/33] Bluetooth: Only mark socket zapped after unlocking

2020-10-18 Thread Sasha Levin
From: Abhishek Pandit-Subedi [ Upstream commit 20ae4089d0afeb24e9ceb026b996bfa55c983cc2 ] Since l2cap_sock_teardown_cb doesn't acquire the channel lock before setting the socket as zapped, it could potentially race with l2cap_sock_release which frees the socket. Thus, wait until the cleanup is

[PATCH AUTOSEL 4.4 05/33] media: exynos4-is: Fix a reference count leak

2020-10-18 Thread Sasha Levin
From: Qiushi Wu [ Upstream commit 64157b2cb1940449e7df2670e85781c690266588 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. Thus call

[PATCH AUTOSEL 4.4 27/33] Fix use after free in get_capset_info callback.

2020-10-18 Thread Sasha Levin
From: Doug Horn [ Upstream commit e219688fc5c3d0d9136f8d29d7e0498388f01440 ] If a response to virtio_gpu_cmd_get_capset_info takes longer than five seconds to return, the callback will access freed kernel memory in vg->capsets. Signed-off-by: Doug Horn Link:

[PATCH AUTOSEL 4.9 39/41] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach

2020-10-18 Thread Sasha Levin
From: Wang Yufen [ Upstream commit 6c151410d5b57e6bb0d91a735ac511459539a7bf ] When brcmf_proto_msgbuf_attach fail and msgbuf->txflow_wq != NULL, we should destroy the workqueue. Reported-by: Hulk Robot Signed-off-by: Wang Yufen Signed-off-by: Kalle Valo Link:

[PATCH AUTOSEL 4.4 31/33] brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach

2020-10-18 Thread Sasha Levin
From: Wang Yufen [ Upstream commit 6c151410d5b57e6bb0d91a735ac511459539a7bf ] When brcmf_proto_msgbuf_attach fail and msgbuf->txflow_wq != NULL, we should destroy the workqueue. Reported-by: Hulk Robot Signed-off-by: Wang Yufen Signed-off-by: Kalle Valo Link:

[PATCH AUTOSEL 4.4 25/33] brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

2020-10-18 Thread Sasha Levin
From: Keita Suzuki [ Upstream commit f4443293d741d1776b86ed1dd8c4e4285d0775fc ] When wlc_phy_txpwr_srom_read_lcnphy fails in wlc_phy_attach_lcnphy, the allocated pi->u.pi_lcnphy is leaked, since struct brcms_phy will be freed in the caller function. Fix this by calling wlc_phy_detach_lcnphy in

[PATCH AUTOSEL 4.4 19/33] misc: rtsx: Fix memory leak in rtsx_pci_probe

2020-10-18 Thread Sasha Levin
From: Keita Suzuki [ Upstream commit bc28369c6189009b66d9619dd9f09bd8c684bb98 ] When mfd_add_devices() fail, pcr->slots should also be freed. However, the current implementation does not free the member, leading to a memory leak. Fix this by adding a new goto label that frees pcr->slots.

[PATCH AUTOSEL 4.4 24/33] scsi: ibmvfc: Fix error return in ibmvfc_probe()

2020-10-18 Thread Sasha Levin
From: Jing Xiangfeng [ Upstream commit 5e48a084f4e824e1b624d3fd7ddcf53d2ba69e53 ] Fix to return error code PTR_ERR() from the error handling case instead of 0. Link: https://lore.kernel.org/r/20200907083949.154251-1-jingxiangf...@huawei.com Acked-by: Tyrel Datwyler Signed-off-by: Jing

[PATCH AUTOSEL 4.4 33/33] ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n()

2020-10-18 Thread Sasha Levin
From: Zekun Shen [ Upstream commit bad60b8d1a7194df38fd7fe4b22f3f4dcf775099 ] The idx in __ath10k_htt_rx_ring_fill_n function lives in consistent dma region writable by the device. Malfunctional or malicious device could manipulate such idx to have a OOB write. Either by

[PATCH AUTOSEL 4.4 14/33] scsi: target: core: Add CONTROL field for trace events

2020-10-18 Thread Sasha Levin
From: Roman Bolshakov [ Upstream commit 7010645ba7256992818b518163f46bd4cdf8002a ] trace-cmd report doesn't show events from target subsystem because scsi_command_size() leaks through event format string: [target:target_sequencer_start] function scsi_command_size not defined

[PATCH AUTOSEL 4.9 40/41] usb: core: Solve race condition in anchor cleanup functions

2020-10-18 Thread Sasha Levin
From: Eli Billauer [ Upstream commit fbc299437c06648afcc7891e6e2e6638dd48d4df ] usb_kill_anchored_urbs() is commonly used to cancel all URBs on an anchor just before releasing resources which the URBs rely on. By doing so, users of this function rely on that no completer callbacks will take

[PATCH AUTOSEL 4.4 10/33] media: saa7134: avoid a shift overflow

2020-10-18 Thread Sasha Levin
From: Mauro Carvalho Chehab [ Upstream commit 15a36aae1ec1c1f17149b6113b92631791830740 ] As reported by smatch: drivers/media/pci/saa7134//saa7134-tvaudio.c:686 saa_dsp_writel() warn: should 'reg << 2' be a 64 bit type? On a 64-bits Kernel, the shift might be bigger than 32 bits. In

[PATCH AUTOSEL 4.4 29/33] ipvs: Fix uninit-value in do_ip_vs_set_ctl()

2020-10-18 Thread Sasha Levin
From: Peilin Ye [ Upstream commit c5a8a8498eed1c164afc94f50a939c1a10abf8ad ] do_ip_vs_set_ctl() is referencing uninitialized stack value when `len` is zero. Fix it. Reported-by: syzbot+23b5f9e7caf61d9a3...@syzkaller.appspotmail.com Link:

[PATCH AUTOSEL 4.4 26/33] rtl8xxxu: prevent potential memory leak

2020-10-18 Thread Sasha Levin
From: Chris Chiu [ Upstream commit 86279456a4d47782398d3cb8193f78f672e36cac ] Free the skb if usb_submit_urb fails on rx_urb. And free the urb no matter usb_submit_urb succeeds or not in rtl8xxxu_submit_int_urb. Signed-off-by: Chris Chiu Signed-off-by: Kalle Valo Link:

[PATCH AUTOSEL 4.4 04/33] media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync

2020-10-18 Thread Sasha Levin
From: Qiushi Wu [ Upstream commit c47f7c779ef0458a58583f00c9ed71b7f5a4d0a2 ] On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Qiushi Wu Signed-off-by: Hans Verkuil

[PATCH AUTOSEL 4.4 30/33] reiserfs: Fix memory leak in reiserfs_parse_options()

2020-10-18 Thread Sasha Levin
From: Jan Kara [ Upstream commit e9d4709fcc26353df12070566970f080e651f0c9 ] When a usrjquota or grpjquota mount option is used multiple times, we will leak memory allocated for the file name. Make sure the last setting is used and all the previous ones are properly freed. Reported-by:

[PATCH AUTOSEL 4.4 32/33] usb: core: Solve race condition in anchor cleanup functions

2020-10-18 Thread Sasha Levin
From: Eli Billauer [ Upstream commit fbc299437c06648afcc7891e6e2e6638dd48d4df ] usb_kill_anchored_urbs() is commonly used to cancel all URBs on an anchor just before releasing resources which the URBs rely on. By doing so, users of this function rely on that no completer callbacks will take

[PATCH AUTOSEL 4.4 28/33] tty: ipwireless: fix error handling

2020-10-18 Thread Sasha Levin
From: Tong Zhang [ Upstream commit db332356222d9429731ab9395c89cca403828460 ] ipwireless_send_packet() can only return 0 on success and -ENOMEM on error, the caller should check non zero for error condition Signed-off-by: Tong Zhang Acked-by: David Sterba Link:

[PATCH AUTOSEL 4.4 15/33] usb: gadget: function: printer: fix use-after-free in __lock_acquire

2020-10-18 Thread Sasha Levin
From: Zqiang [ Upstream commit e8d5f92b8d30bb4ade76494490c3c065e12411b1 ] Fix this by increase object reference count. BUG: KASAN: use-after-free in __lock_acquire+0x3fd4/0x4180 kernel/locking/lockdep.c:3831 Read of size 8 at addr 8880683b0018 by task syz-executor.0/3377 CPU: 1 PID: 3377

[PATCH AUTOSEL 4.9 33/41] brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

2020-10-18 Thread Sasha Levin
From: Keita Suzuki [ Upstream commit f4443293d741d1776b86ed1dd8c4e4285d0775fc ] When wlc_phy_txpwr_srom_read_lcnphy fails in wlc_phy_attach_lcnphy, the allocated pi->u.pi_lcnphy is leaked, since struct brcms_phy will be freed in the caller function. Fix this by calling wlc_phy_detach_lcnphy in

[PATCH AUTOSEL 4.9 37/41] ipvs: Fix uninit-value in do_ip_vs_set_ctl()

2020-10-18 Thread Sasha Levin
From: Peilin Ye [ Upstream commit c5a8a8498eed1c164afc94f50a939c1a10abf8ad ] do_ip_vs_set_ctl() is referencing uninitialized stack value when `len` is zero. Fix it. Reported-by: syzbot+23b5f9e7caf61d9a3...@syzkaller.appspotmail.com Link:

[PATCH AUTOSEL 4.4 21/33] xfs: make sure the rt allocator doesn't run off the end

2020-10-18 Thread Sasha Levin
From: "Darrick J. Wong" [ Upstream commit 2a6ca4baed620303d414934aa1b7b0a8e7bab05f ] There's an overflow bug in the realtime allocator. If the rt volume is large enough to handle a single allocation request that is larger than the maximum bmap extent length and the rt bitmap ends exactly on a

[PATCH AUTOSEL 4.4 18/33] ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()

2020-10-18 Thread Sasha Levin
From: Brooke Basile [ Upstream commit 03fb92a432ea5abe5909bca1455b7e44a9380480 ] Calls to usb_kill_anchored_urbs() after usb_kill_urb() on multiprocessor systems create a race condition in which usb_kill_anchored_urbs() deallocates the URB before the completer callback is called in

[PATCH AUTOSEL 4.4 12/33] PM: hibernate: remove the bogus call to get_gendisk() in software_resume()

2020-10-18 Thread Sasha Levin
From: Christoph Hellwig [ Upstream commit 428805c0c5e76ef643b1fbc893edfb636b3d8aef ] get_gendisk grabs a reference on the disk and file operation, so this code will leak both of them while having absolutely no use for the gendisk itself. This effectively reverts commit 2df83fa4bce421f ("PM /

[PATCH AUTOSEL 4.9 09/41] media: platform: sti: hva: Fix runtime PM imbalance on error

2020-10-18 Thread Sasha Levin
From: Dinghao Liu [ Upstream commit d912a1d9e9afe69c6066c1ceb6bfc09063074075 ] pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao

[PATCH AUTOSEL 4.9 14/41] media: saa7134: avoid a shift overflow

2020-10-18 Thread Sasha Levin
From: Mauro Carvalho Chehab [ Upstream commit 15a36aae1ec1c1f17149b6113b92631791830740 ] As reported by smatch: drivers/media/pci/saa7134//saa7134-tvaudio.c:686 saa_dsp_writel() warn: should 'reg << 2' be a 64 bit type? On a 64-bits Kernel, the shift might be bigger than 32 bits. In

[PATCH AUTOSEL 4.19 22/56] ntfs: add check for mft record size in superblock

2020-10-18 Thread Sasha Levin
From: Rustam Kovhaev [ Upstream commit 4f8c94022f0bc3babd0a124c0a7dcdd7547bd94e ] Number of bytes allocated for mft record should be equal to the mft record size stored in ntfs superblock as reported by syzbot, userspace might trigger out-of-bounds read by dereferencing ctx->attr in

<    1   2   3   4   5   6   7   8   >