5.4.72-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 5.4.72-rc1 review
This is the start of the stable review cycle for the 5.4.72 release. There are 22 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 Sun, 18 Oct 2020 09:04:25 +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/v5.x/stable-review/patch-5.4.72-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-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.72-rc1
Dominik Przychodni <[email protected]>
crypto: qat - check cipher length for aead AES-CBC-HMAC-SHA
Herbert Xu <[email protected]>
crypto: bcm - Verify GCM/CCM key length in setkey
Juergen Gross <[email protected]>
xen/events: don't use chip_data for legacy IRQs
Jan Kara <[email protected]>
reiserfs: Fix oops during mount
Jan Kara <[email protected]>
reiserfs: Initialize inode keys properly
Mychaela N. Falconia <[email protected]>
USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters
Scott Chen <[email protected]>
USB: serial: pl2303: add device-id for HP GC device
Anant Thazhemadam <[email protected]>
staging: comedi: check validity of wMaxPacketSize of usb endpoints found
Leonid Bloch <[email protected]>
USB: serial: option: Add Telit FT980-KS composition
Wilken Gottwalt <[email protected]>
USB: serial: option: add Cellient MPL200 card
Oliver Neukum <[email protected]>
media: usbtv: Fix refcounting mixup
Luiz Augusto von Dentz <[email protected]>
Bluetooth: Disconnect if E0 is used for Level 4
Patrick Steinhardt <[email protected]>
Bluetooth: Fix update of connection state in hci_encrypt_cfm
Luiz Augusto von Dentz <[email protected]>
Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
Luiz Augusto von Dentz <[email protected]>
Bluetooth: MGMT: Fix not checking if BT_HS is enabled
Luiz Augusto von Dentz <[email protected]>
Bluetooth: L2CAP: Fix calling sk_filter on non-socket based channel
Luiz Augusto von Dentz <[email protected]>
Bluetooth: A2MP: Fix not initializing all members
Arjan van de Ven <[email protected]>
ACPI: Always build evged in
Dmitry Golovin <[email protected]>
ARM: 8939/1: kbuild: use correct nm executable
Josef Bacik <[email protected]>
btrfs: take overcommit into account in inc_block_group_ro
Josef Bacik <[email protected]>
btrfs: don't pass system_chunk into can_overcommit
Leo Yan <[email protected]>
perf cs-etm: Move definition of 'traceid_list' global variable from header file
-------------
Diffstat:
Makefile | 4 +-- arch/arm/boot/compressed/Makefile | 4 +-- drivers/acpi/Makefile | 2 +- drivers/crypto/bcm/cipher.c | 15 +++++++++- drivers/crypto/qat/qat_common/qat_algs.c | 10 ++++++- drivers/media/usb/usbtv/usbtv-core.c | 3 +- drivers/staging/comedi/drivers/vmk80xx.c | 3 ++ drivers/usb/serial/ftdi_sio.c | 5 ++++ drivers/usb/serial/ftdi_sio_ids.h | 7 +++++ drivers/usb/serial/option.c | 5 ++++ drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 1 + drivers/xen/events/events_base.c | 29 +++++++++++++----- fs/btrfs/block-group.c | 38 ++++++++++++++++-------- fs/btrfs/space-info.c | 50 +++++++++++++------------------- fs/btrfs/space-info.h | 3 ++ fs/reiserfs/inode.c | 6 +--- fs/reiserfs/xattr.c | 7 +++++ include/net/bluetooth/hci_core.h | 30 +++++++++++++++---- include/net/bluetooth/l2cap.h | 2 ++ net/bluetooth/a2mp.c | 22 +++++++++++++- net/bluetooth/hci_conn.c | 17 +++++++++++ net/bluetooth/hci_event.c | 48 +++++++----------------------- net/bluetooth/l2cap_core.c | 7 +++-- net/bluetooth/l2cap_sock.c | 14 +++++++++ net/bluetooth/mgmt.c | 7 ++++- tools/perf/util/cs-etm.c | 3 ++ tools/perf/util/cs-etm.h | 3 -- 28 files changed, 232 insertions(+), 114 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/22 perf cs-etm: Move definition of traceid_list global variable from header file
From: Leo Yan <[email protected]>
commit 168200b6d6ea0cb5765943ec5da5b8149701f36a upstream.
The variable 'traceid_list' is defined in the header file cs-etm.h, if multiple C files include cs-etm.h the compiler might complaint for multiple definition of 'traceid_list'.
To fix multiple definition error, move the definition of 'traceid_list' into cs-etm.c.
--- tools/perf/util/cs-etm.c | 3 +++ tools/perf/util/cs-etm.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/cs-etm.c +3 -0
@@ -94,6 +94,9 @@ struct cs_etm_queue {struct cs_etm_traceid_queue **traceid_queues; }; +/* RB tree for quick conversion between traceID and metadata pointers */ +static struct intlist *traceid_list; +static int cs_etm__update_queues (struct cs_etm_auxtrace *etm);static int cs_etm__process_queues (struct cs_etm_auxtrace *etm); static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
tools/perf/util/cs-etm.h +0 -3
@@ -114,9 +114,6 @@ enum cs_etm_isa { CS_ETM_ISA_T32, }; -/* RB tree for quick conversion between traceID and metadata pointers */ -struct intlist *traceid_list; -struct cs_etm_queue ;struct cs_etm_packet {
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Greg Kroah-Hartman
maintainerPATCH 2/22 btrfs: dont pass system_chunk into can_overcommit
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit 9f246926b4d5db4c5e8c78e4897757de26c95be6 upstream
We have the space_info, we can just check its flags to see if it's the system chunk space info.
--- fs/btrfs/space-info.c | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-)
fs/btrfs/space-info.c +15 -27
@@ -162,8 +162,7 @@ static inline u64 calc_global_rsv_need_space(struct btrfs_block_rsv *global)static int can_overcommit (struct btrfs_fs_info *fs_info,struct btrfs_space_info *space_info,u64 bytes, -enum btrfs_reserve_flush_enum flush, -bool system_chunk) +enum btrfs_reserve_flush_enum flush) {u64 profile;u64 avail;
@@ -174,7 +173,7 @@ static int can_overcommit(struct btrfs_fs_info *fs_info,if (space_info->flags &BTRFS_BLOCK_GROUP_DATA )return 0 ; -if (system_chunk) +if (space_info->flags &BTRFS_BLOCK_GROUP_SYSTEM ) profile =btrfs_system_alloc_profile (fs_info);else profile =btrfs_metadata_alloc_profile (fs_info);
@@ -228,8 +227,7 @@ void btrfs_try_granting_tickets(struct btrfs_fs_info *fs_info,/* Check and see if our ticket can be satisified now. */ if ((used + ticket->bytes <= space_info->total_bytes) || -can_overcommit (fs_info, space_info, ticket->bytes, flush, - false)) { +can_overcommit (fs_info, space_info, ticket->bytes, flush)) {btrfs_space_info_update_bytes_may_use (fs_info, space_info, ticket->bytes);
@@ -634,8 +632,7 @@ static void flush_space(struct btrfs_fs_info *fs_info,static inline u64 btrfs_calc_reclaim_metadata_size (struct btrfs_fs_info *fs_info, -struct btrfs_space_info *space_info, -bool system_chunk) +struct btrfs_space_info *space_info) {struct reserve_ticket *ticket;u64 used;
@@ -651,13 +648,12 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info, to_reclaim =min_t (u64,num_online_cpus () *SZ_1M ,SZ_16M );if (can_overcommit (fs_info, space_info, to_reclaim, -BTRFS_RESERVE_FLUSH_ALL , system_chunk)) +BTRFS_RESERVE_FLUSH_ALL ))return 0 ; used =btrfs_space_info_used (space_info, true); -if (can_overcommit (fs_info, space_info,SZ_1M , -BTRFS_RESERVE_FLUSH_ALL , system_chunk)) +if (can_overcommit (fs_info, space_info,SZ_1M ,BTRFS_RESERVE_FLUSH_ALL )) expected =div_factor_fine (space_info->total_bytes,95 );else expected =div_factor_fine (space_info->total_bytes,90 );
@@ -673,7 +669,7 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info,static inline int need_do_async_reclaim (struct btrfs_fs_info *fs_info,struct btrfs_space_info *space_info, -u64 used,bool system_chunk) +u64 used) {u64 thresh =div_factor_fine (space_info->total_bytes,98 );
@@ -681,8 +677,7 @@ static inline int need_do_async_reclaim(struct btrfs_fs_info *fs_info,if ((space_info->bytes_used + space_info->bytes_reserved) >= thresh)return 0 ; -if (!btrfs_calc_reclaim_metadata_size (fs_info, space_info, - system_chunk)) +if (!btrfs_calc_reclaim_metadata_size (fs_info, space_info))return 0 ; return (used >= thresh && !btrfs_fs_closing(fs_info) &&
@@ -805,8 +800,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work) space_info =btrfs_find_space_info (fs_info,BTRFS_BLOCK_GROUP_METADATA );spin_lock (&space_info->lock); - to_reclaim =btrfs_calc_reclaim_metadata_size (fs_info, space_info, - false); + to_reclaim =btrfs_calc_reclaim_metadata_size (fs_info, space_info);if (!to_reclaim) { space_info->flush =0 ;spin_unlock (&space_info->lock);
@@ -825,8 +819,7 @@ static void btrfs_async_reclaim_metadata_space(struct work_struct *work)return ; } to_reclaim =btrfs_calc_reclaim_metadata_size (fs_info, - space_info, - false); + space_info);if (last_tickets_id == space_info->tickets_id) { flush_state++; }else {
@@ -898,8 +891,7 @@ static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,int flush_state;spin_lock (&space_info->lock); - to_reclaim =btrfs_calc_reclaim_metadata_size (fs_info, space_info, - false); + to_reclaim =btrfs_calc_reclaim_metadata_size (fs_info, space_info);if (!to_reclaim) {spin_unlock (&space_info->lock);return ;
@@ -1031,8 +1023,7 @@ static int handle_reserve_ticket(struct btrfs_fs_info *fs_info,static int __reserve_metadata_bytes (struct btrfs_fs_info *fs_info,struct btrfs_space_info *space_info,u64 orig_bytes, -enum btrfs_reserve_flush_enum flush, -bool system_chunk) +enum btrfs_reserve_flush_enum flush) {struct reserve_ticket ticket;u64 used;
@@ -1054,8 +1045,7 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,*/ if (!pending_tickets && ((used + orig_bytes <= space_info->total_bytes) || -can_overcommit (fs_info, space_info, orig_bytes, flush, - system_chunk))) { +can_overcommit (fs_info, space_info, orig_bytes, flush))) {btrfs_space_info_update_bytes_may_use (fs_info, space_info, orig_bytes); ret =0 ;
@@ -1097,8 +1087,7 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,* the async reclaim as we will panic. */ if (!test_bit (BTRFS_FS_LOG_RECOVERING , &fs_info->flags) && -need_do_async_reclaim (fs_info, space_info, - used, system_chunk) && +need_do_async_reclaim (fs_info, space_info, used) && !work_busy (&fs_info->async_reclaim_work)) {trace_btrfs_trigger_flush (fs_info, space_info->flags, orig_bytes, flush,"preempt" );
@@ -1135,10 +1124,9 @@ int btrfs_reserve_metadata_bytes(struct btrfs_root *root,struct btrfs_fs_info *fs_info = root->fs_info;struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv;int ret; -bool system_chunk = (root == fs_info->chunk_root); ret =__reserve_metadata_bytes (fs_info, block_rsv->space_info, - orig_bytes, flush, system_chunk); + orig_bytes, flush);if (ret == -ENOSPC &&unlikely (root->orphan_cleanup_state ==ORPHAN_CLEANUP_STARTED )) { if (block_rsv != global_rsv &&
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 3/22 btrfs: take overcommit into account in inc_block_group_ro
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit a30a3d2067536cbcce26c055e70cc3a6ae4fd45c upstream
inc_block_group_ro does a calculation to see if we have enough room left over if we mark this block group as read only in order to see if it's ok to mark the block group as read only.
The problem is this calculation _only_ works for data, where our used is always less than our total. For metadata we will overcommit, so this will almost always fail for metadata.
Fix this by exporting btrfs_can_overcommit, and then see if we have enough space to remove the remaining free space in the block group we are trying to mark read only. If we do then we can mark this block group as read only.
--- fs/btrfs/block-group.c | 38 ++++++++++++++++++++++++++------------ fs/btrfs/space-info.c | 18 ++++++++++-------- fs/btrfs/space-info.h | 3 +++ 3 files changed, 39 insertions(+), 20 deletions(-)
fs/btrfs/block-group.c +26 -12
@@ -1186,7 +1186,6 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force) {struct btrfs_space_info *sinfo = cache->space_info;u64 num_bytes; -u64 sinfo_used;u64 min_allocable_bytes;int ret = -ENOSPC ;
@@ -1213,20 +1212,38 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force) num_bytes = cache->key.offset - cache->reserved - cache->pinned - cache->bytes_super -btrfs_block_group_used (&cache->item); - sinfo_used =btrfs_space_info_used (sinfo, true);/* -* sinfo_used + num_bytes should always <= sinfo->total_bytes. -* -* Here we make sure if we mark this bg RO, we still have enough -* free space as buffer (if min_allocable_bytes is not 0). +* Data never overcommits, even in mixed mode, so do just the straight +* check of left over space in how much we have allocated. */ -if (sinfo_used + num_bytes + min_allocable_bytes <= - sinfo->total_bytes) { +if (force) { + ret =0 ; + }else if (sinfo->flags &BTRFS_BLOCK_GROUP_DATA ) { +u64 sinfo_used =btrfs_space_info_used (sinfo, true); + +/* +* Here we make sure if we mark this bg RO, we still have enough +* free space as buffer. +*/ +if (sinfo_used + num_bytes <= sinfo->total_bytes) + ret =0 ; + }else { +/* +* We overcommit metadata, so we need to do the +* btrfs_can_overcommit check here, and we need to pass in +* BTRFS_RESERVE_NO_FLUSH to give ourselves the most amount of +* leeway to allow us to mark this block group as read only. +*/ +if (btrfs_can_overcommit (cache->fs_info, sinfo, num_bytes, +BTRFS_RESERVE_NO_FLUSH )) + ret =0 ; + } + +if (!ret) { sinfo->bytes_readonly += num_bytes; cache->ro++;list_add_tail (&cache->ro_list, &sinfo->ro_bgs); - ret =0 ; } out:spin_unlock (&cache->lock);
@@ -1235,9 +1252,6 @@ static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)btrfs_info (cache->fs_info,"unable to make block group %llu ro" , cache->key.objectid); -btrfs_info (cache->fs_info, -"sinfo_used=%llu bg_num_bytes=%llu min_allocable=%llu" , - sinfo_used, num_bytes, min_allocable_bytes);btrfs_dump_space_info (cache->fs_info, cache->space_info,0 ,0 ); }return ret;
fs/btrfs/space-info.c +10 -8
@@ -160,9 +160,9 @@ static inline u64 calc_global_rsv_need_space(struct btrfs_block_rsv *global)return (global->size <<1 ); } -static int can_overcommit (struct btrfs_fs_info *fs_info, -struct btrfs_space_info *space_info,u64 bytes, -enum btrfs_reserve_flush_enum flush) +int btrfs_can_overcommit (struct btrfs_fs_info *fs_info, +struct btrfs_space_info *space_info,u64 bytes, +enum btrfs_reserve_flush_enum flush) {u64 profile;u64 avail;
@@ -227,7 +227,8 @@ void btrfs_try_granting_tickets(struct btrfs_fs_info *fs_info,/* Check and see if our ticket can be satisified now. */ if ((used + ticket->bytes <= space_info->total_bytes) || -can_overcommit (fs_info, space_info, ticket->bytes, flush)) { +btrfs_can_overcommit (fs_info, space_info, ticket->bytes, + flush)) {btrfs_space_info_update_bytes_may_use (fs_info, space_info, ticket->bytes);
@@ -647,13 +648,14 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info,return to_reclaim; to_reclaim =min_t (u64,num_online_cpus () *SZ_1M ,SZ_16M ); -if (can_overcommit (fs_info, space_info, to_reclaim, -BTRFS_RESERVE_FLUSH_ALL )) +if (btrfs_can_overcommit (fs_info, space_info, to_reclaim, +BTRFS_RESERVE_FLUSH_ALL ))return 0 ; used =btrfs_space_info_used (space_info, true); -if (can_overcommit (fs_info, space_info,SZ_1M ,BTRFS_RESERVE_FLUSH_ALL )) +if (btrfs_can_overcommit (fs_info, space_info,SZ_1M , +BTRFS_RESERVE_FLUSH_ALL )) expected =div_factor_fine (space_info->total_bytes,95 );else expected =div_factor_fine (space_info->total_bytes,90 );
@@ -1045,7 +1047,7 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,*/ if (!pending_tickets && ((used + orig_bytes <= space_info->total_bytes) || -can_overcommit (fs_info, space_info, orig_bytes, flush))) { +btrfs_can_overcommit (fs_info, space_info, orig_bytes, flush))) {btrfs_space_info_update_bytes_may_use (fs_info, space_info, orig_bytes); ret =0 ;
fs/btrfs/space-info.h +3 -0
@@ -129,6 +129,9 @@ int btrfs_reserve_metadata_bytes(struct btrfs_root *root, enum btrfs_reserve_flush_enum flush);void btrfs_try_granting_tickets (struct btrfs_fs_info *fs_info,struct btrfs_space_info *space_info); +int btrfs_can_overcommit (struct btrfs_fs_info *fs_info, +struct btrfs_space_info *space_info,u64 bytes, +enum btrfs_reserve_flush_enum flush); static inline void btrfs_space_info_free_bytes_may_use( struct btrfs_fs_info *fs_info,
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 4/22 ARM: 8939/1: kbuild: use correct nm executable
In reply to Greg Kroah-HartmanFrom: Dmitry Golovin <[email protected]>
[ Upstream commit 29c623d64f0dcd6aa10e0eabd16233e77114090b ]
Since $(NM) variable can be easily overridden for the whole build, it's better to use it instead of $(CROSS_COMPILE)nm. The use of $(CROSS_COMPILE) prefixed variables where their calculated equivalents can be used is incorrect. This fixes issues with builds where $(NM) is set to llvm-nm.
--- arch/arm/boot/compressed/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/compressed/Makefile +2 -2
@@ -121,7 +121,7 @@ ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \ asflags-y := -DZIMAGE # Supply kernel BSS size to the decompressor via a linker symbol. -KBSS_SZ = $(shell echo $$(($$($(CROSS_COMPILE)nm $(obj)/../../../../vmlinux | \ +KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \ sed -n -e 's/^\([^ ]*\) [AB] __bss_start$$/-0x\1/p' \ -e 's/^\([^ ]*\) [AB] __bss_stop$$/+0x\1/p') )) ) LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
@@ -165,7 +165,7 @@ $(obj)/bswapsdi2.S: $(srctree)/arch/$(SRCARCH)/lib/bswapsdi2.S # The .data section is already discarded by the linker script so no need # to bother about it here. check_for_bad_syms = \ -bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ +bad_syms=$$($(NM) $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ [ -z "$$bad_syms" ] || \ ( echo "following symbols must have non local/private scope:" >&2; \ echo "$$bad_syms" >&2; false )
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 5/22 ACPI: Always build evged in
In reply to Greg Kroah-HartmanFrom: Arjan van de Ven <[email protected]>
commit ac36d37e943635fc072e9d4f47e40a48fbcdb3f0 upstream.
Although the Generic Event Device is a Hardware-reduced platfom device in principle, it should not be restricted to ACPI_REDUCED_HARDWARE_ONLY.
Kernels supporting both fixed and hardware-reduced ACPI platforms should be able to probe the GED when dynamically detecting that a platform is hardware-reduced. For that, the driver must be unconditionally built in.
--- drivers/acpi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/Makefile +1 -1
@@ -48,7 +48,7 @@ acpi-y += acpi_pnp.o acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o acpi-y += power.o acpi-y += event.o -acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o +acpi-y += evged.o acpi-y += sysfs.o acpi-y += property.o acpi-$(CONFIG_X86) += acpi_cmos_rtc.o
Greg Kroah-Hartman
maintainerPATCH 6/22 Bluetooth: A2MP: Fix not initializing all members
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit eddb7732119d53400f48a02536a84c509692faa8 upstream.
This fixes various places where a stack variable is used uninitialized.
--- net/bluetooth/a2mp.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
net/bluetooth/a2mp.c +21 -1
@@ -226,6 +226,9 @@ static int a2mp_discover_rsp(struct amp_struct a2mp_info_req req; found = true; + +memset (&req,0 ,sizeof (req)); + req.id = cl->id;a2mp_send (mgr,A2MP_GETINFO_REQ ,__next_ident (mgr),sizeof (req), &req);
@@ -305,6 +308,8 @@ static int a2mp_getinfo_req(struct amp_mif (!hdev || hdev->dev_type !=HCI_AMP ) {struct a2mp_info_rsp rsp; +memset (&rsp,0 ,sizeof (rsp)); + rsp.id = req->id; rsp.status =A2MP_STATUS_INVALID_CTRL_ID ;
@@ -348,6 +353,8 @@ static int a2mp_getinfo_rsp(struct amp_mif (!ctrl)return -ENOMEM ; +memset (&req,0 ,sizeof (req)); + req.id = rsp->id;a2mp_send (mgr,A2MP_GETAMPASSOC_REQ ,__next_ident (mgr),sizeof (req), &req);
@@ -376,6 +383,8 @@ static int a2mp_getampassoc_req(struct astruct a2mp_amp_assoc_rsp rsp; rsp.id = req->id; +memset (&rsp,0 ,sizeof (rsp)); +if (tmp) { rsp.status =A2MP_STATUS_COLLISION_OCCURED ;amp_mgr_put (tmp);
@@ -464,7 +473,6 @@ static int a2mp_createphyslink_req(struc struct a2mp_cmd *hdr) {struct a2mp_physlink_req *req = (void *) skb->data; -struct a2mp_physlink_rsp rsp;struct hci_dev *hdev;struct hci_conn *hcon;
@@ -475,6 +483,8 @@ static int a2mp_createphyslink_req(strucBT_DBG ("local_id %d, remote_id %d" , req->local_id, req->remote_id); +memset (&rsp,0 ,sizeof (rsp)); + rsp.local_id = req->remote_id; rsp.remote_id = req->local_id;
@@ -553,6 +563,8 @@ static int a2mp_discphyslink_req(structBT_DBG ("local_id %d remote_id %d" , req->local_id, req->remote_id); +memset (&rsp,0 ,sizeof (rsp)); + rsp.local_id = req->remote_id; rsp.remote_id = req->local_id; rsp.status =A2MP_STATUS_SUCCESS ;
@@ -675,6 +687,8 @@ static int a2mp_chan_recv_cb(struct l2caif (err) {struct a2mp_cmd_rej rej; +memset (&rej,0 ,sizeof (rej)); + rej.reason =cpu_to_le16 (0 ); hdr = (void *) skb->data;
@@ -898,6 +912,8 @@ void a2mp_send_getinfo_rsp(struct hci_deBT_DBG ("%s mgr %p" , hdev->name, mgr); +memset (&rsp,0 ,sizeof (rsp)); + rsp.id = hdev->id; rsp.status =A2MP_STATUS_INVALID_CTRL_ID ;
@@ -995,6 +1011,8 @@ void a2mp_send_create_phy_link_rsp(strucif (!mgr)return ; +memset (&rsp,0 ,sizeof (rsp)); + hs_hcon =hci_conn_hash_lookup_state (hdev,AMP_LINK ,BT_CONNECT );if (!hs_hcon) { rsp.status =A2MP_STATUS_UNABLE_START_LINK_CREATION ;
@@ -1027,6 +1045,8 @@ void a2mp_discover_amp(struct l2cap_chan mgr->bredr_chan = chan; +memset (&req,0 ,sizeof (req)); + req.mtu =cpu_to_le16 (L2CAP_A2MP_DEFAULT_MTU ); req.ext_feat =0 ;a2mp_send (mgr,A2MP_DISCOVER_REQ ,1 ,sizeof (req), &req);
Greg Kroah-Hartman
maintainerPATCH 7/22 Bluetooth: L2CAP: Fix calling sk_filter on non-socket based channel
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit f19425641cb2572a33cb074d5e30283720bd4d22 upstream.
Only sockets will have the chan->data set to an actual sk, channels like A2MP would have its own data which would likely cause a crash when calling sk_filter, in order to fix this a new callback has been introduced so channels can implement their own filtering if necessary.
--- include/net/bluetooth/l2cap.h | 2 ++ net/bluetooth/l2cap_core.c | 7 ++++--- net/bluetooth/l2cap_sock.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-)
include/net/bluetooth/l2cap.h +2 -0
@@ -623,6 +623,8 @@ struct l2cap_ops {struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,unsigned long hdr_len,unsigned long len,int nb); +int (*filter) (struct l2cap_chan * chan, +struct sk_buff *skb); };struct l2cap_conn {
net/bluetooth/l2cap_core.c +4 -3
@@ -6701,9 +6701,10 @@ static int l2cap_data_rcv(struct l2cap_c goto drop; } -if ((chan->mode ==L2CAP_MODE_ERTM || - chan->mode ==L2CAP_MODE_STREAMING ) &&sk_filter (chan->data, skb)) - goto drop; +if (chan->ops->filter) { +if (chan->ops->filter (chan, skb)) + goto drop; + }if (!control->sframe) {int err;
net/bluetooth/l2cap_sock.c +14 -0
@@ -1479,6 +1479,19 @@ static void l2cap_sock_suspend_cb(struct sk->sk_state_change (sk); } +static int l2cap_sock_filter (struct l2cap_chan *chan,struct sk_buff *skb) +{ +struct sock *sk = chan->data; + +switch (chan->mode) { +case L2CAP_MODE_ERTM : +case L2CAP_MODE_STREAMING : +return sk_filter (sk, skb); + } + +return 0 ; +} +static const struct l2cap_ops l2cap_chan_ops = { .name ="L2CAP Socket Interface" , .new_connection = l2cap_sock_new_connection_cb,
@@ -1493,6 +1506,7 @@ static const struct l2cap_ops l2cap_chan .set_shutdown = l2cap_sock_set_shutdown_cb, .get_sndtimeo = l2cap_sock_get_sndtimeo_cb, .alloc_skb = l2cap_sock_alloc_skb_cb, + .filter = l2cap_sock_filter, };static void l2cap_sock_destruct (struct sock *sk)
Greg Kroah-Hartman
maintainerPATCH 8/22 Bluetooth: MGMT: Fix not checking if BT_HS is enabled
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit b560a208cda0297fef6ff85bbfd58a8f0a52a543 upstream.
This checks if BT_HS is enabled relecting it on MGMT_SETTING_HS instead of always reporting it as supported.
--- net/bluetooth/mgmt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
net/bluetooth/mgmt.c +6 -1
@@ -756,7 +756,8 @@ static u32 get_supported_settings(structif (lmp_ssp_capable (hdev)) { settings |=MGMT_SETTING_SSP ; - settings |=MGMT_SETTING_HS ; +if (IS_ENABLED (CONFIG_BT_HS )) + settings |=MGMT_SETTING_HS ; }if (lmp_sc_capable (hdev))
@@ -1771,6 +1772,10 @@ static int set_hs(struct sock *sk, strucBT_DBG ("request for %s" , hdev->name); +if (!IS_ENABLED (CONFIG_BT_HS )) +return mgmt_cmd_status (sk, hdev->id,MGMT_OP_SET_HS , +MGMT_STATUS_NOT_SUPPORTED ); + status =mgmt_bredr_support (hdev);if (status)return mgmt_cmd_status (sk, hdev->id,MGMT_OP_SET_HS , status);
Greg Kroah-Hartman
maintainerPATCH 9/22 Bluetooth: Consolidate encryption handling in hci_encrypt_cfm
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit 3ca44c16b0dcc764b641ee4ac226909f5c421aa3 upstream.
This makes hci_encrypt_cfm calls hci_connect_cfm in case the connection state is BT_CONFIG so callers don't have to check the state.
--- include/net/bluetooth/hci_core.h | 20 ++++++++++++++++++-- net/bluetooth/hci_event.c | 28 +++------------------------- 2 files changed, 21 insertions(+), 27 deletions(-)
include/net/bluetooth/hci_core.h +18 -2
@@ -1308,10 +1308,26 @@ static inline void hci_auth_cfm(struct h conn->security_cfm_cb (conn, status); } -static inline void hci_encrypt_cfm (struct hci_conn *conn,__u8 status, -__u8 encrypt) +static inline void hci_encrypt_cfm (struct hci_conn *conn,__u8 status) {struct hci_cb *cb; +__u8 encrypt; + +if (conn->state ==BT_CONFIG ) { +if (status) + conn->state =BT_CONNECTED ; + +hci_connect_cfm (conn, status); +hci_conn_drop (conn); +return ; + } + +if (!test_bit (HCI_CONN_ENCRYPT , &conn->flags)) + encrypt =0x00 ; +else if (test_bit (HCI_CONN_AES_CCM , &conn->flags)) + encrypt =0x02 ; +else + encrypt =0x01 ;if (conn->sec_level ==BT_SECURITY_SDP ) conn->sec_level =BT_SECURITY_LOW ;
net/bluetooth/hci_event.c +3 -25
@@ -2840,7 +2840,7 @@ static void hci_auth_complete_evt(struct &cp); }else {clear_bit (HCI_CONN_ENCRYPT_PEND , &conn->flags); -hci_encrypt_cfm (conn, ev->status,0x00 ); +hci_encrypt_cfm (conn, ev->status); } }
@@ -2925,22 +2925,7 @@ static void read_enc_key_size_complete(s conn->enc_key_size = rp->key_size; } -if (conn->state ==BT_CONFIG ) { - conn->state =BT_CONNECTED ; -hci_connect_cfm (conn,0 ); -hci_conn_drop (conn); - }else { -u8 encrypt; - -if (!test_bit (HCI_CONN_ENCRYPT , &conn->flags)) - encrypt =0x00 ; -else if (test_bit (HCI_CONN_AES_CCM , &conn->flags)) - encrypt =0x02 ; -else - encrypt =0x01 ; - -hci_encrypt_cfm (conn,0 , encrypt); - } +hci_encrypt_cfm (conn,0 ); unlock:hci_dev_unlock (hdev);
@@ -3058,14 +3043,7 @@ static void hci_encrypt_change_evt(struc } notify: -if (conn->state ==BT_CONFIG ) { -if (!ev->status) - conn->state =BT_CONNECTED ; - -hci_connect_cfm (conn, ev->status); -hci_conn_drop (conn); - }else -hci_encrypt_cfm (conn, ev->status, ev->encrypt); +hci_encrypt_cfm (conn, ev->status); unlock:hci_dev_unlock (hdev);
Greg Kroah-Hartman
maintainerPATCH 10/22 Bluetooth: Fix update of connection state in `hci_encrypt_cfm`
In reply to Greg Kroah-HartmanFrom: Patrick Steinhardt <[email protected]>
commit 339ddaa626995bc6218972ca241471f3717cc5f4 upstream.
Starting with the upgrade to v5.8-rc3, I've noticed I wasn't able to connect to my Bluetooth headset properly anymore. While connecting to the device would eventually succeed, bluetoothd seemed to be confused about the current connection state where the state was flapping hence and forth. Bisecting this issue led to commit 3ca44c16b0dc (Bluetooth:
Consolidate encryption handling in hci_encrypt_cfm, 2020-05-19), which refactored hci_encrypt_cfm to also handle updating the connection state.
The commit in question changed the code to call hci_connect_cfm inside hci_encrypt_cfm and to change the connection state. But with the conversion, we now only update the connection state if a status was set already. In fact, the reverse should be true: the status should be updated if no status is yet set. So let's fix the isuse by reversing the condition.
--- include/net/bluetooth/hci_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/bluetooth/hci_core.h +1 -1
@@ -1314,7 +1314,7 @@ static inline void hci_encrypt_cfm(struc__u8 encrypt;if (conn->state ==BT_CONFIG ) { -if (status) +if (!status) conn->state =BT_CONNECTED ;hci_connect_cfm (conn, status);
Greg Kroah-Hartman
maintainerPATCH 11/22 Bluetooth: Disconnect if E0 is used for Level 4
In reply to Greg Kroah-HartmanFrom: Luiz Augusto von Dentz <[email protected]>
commit 8746f135bb01872ff412d408ea1aa9ebd328c1f5 upstream.
E0 is not allowed with Level 4:
BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C page 1319:
'128-bit equivalent strength for link and encryption keys
required using FIPS approved algorithms (E0 not allowed, SAFER+ not allowed, and P-192 not allowed; encryption key not shortened'
SC enabled:
Quoted 1 line
HCI Event: Read Remote Extended Features (
0x23) plen 13
Status: Success (0x00)
Handle: 256
Page: 1/2
Features: 0x0b 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Secure Simple Pairing (Host Support)
LE Supported (Host)
Secure Connections (Host Support)Quoted 1 line
HCI Event: Encryption Change (
0x08) plen 4
Status: Success (0x00)
Handle: 256
Encryption: Enabled with AES-CCM (0x02)SC disabled:
Quoted 1 line
HCI Event: Read Remote Extended Features (
0x23) plen 13
Status: Success (0x00)
Handle: 256
Page: 1/2
Features: 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Secure Simple Pairing (Host Support)
LE Supported (Host)Quoted 1 line
HCI Event: Encryption Change (
0x08) plen 4
Status: Success (0x00)
Handle: 256
Encryption: Enabled with E0 (0x01)
[May 8 20:23] Bluetooth: hci0: Invalid security: expect AES but E0 was used
< HCI Command: Disconnect (0x01|0x0006) plen 3
Handle: 256
Reason: Authentication Failure (0x05)--- include/net/bluetooth/hci_core.h | 10 ++++++---- net/bluetooth/hci_conn.c | 17 +++++++++++++++++ net/bluetooth/hci_event.c | 20 ++++++++------------ 3 files changed, 31 insertions(+), 16 deletions(-)
include/net/bluetooth/hci_core.h +6 -4
@@ -1329,11 +1329,13 @@ static inline void hci_encrypt_cfm(strucelse encrypt =0x01 ; -if (conn->sec_level ==BT_SECURITY_SDP ) - conn->sec_level =BT_SECURITY_LOW ; +if (!status) { +if (conn->sec_level ==BT_SECURITY_SDP ) + conn->sec_level =BT_SECURITY_LOW ; -if (conn->pending_sec_level > conn->sec_level) - conn->sec_level = conn->pending_sec_level; +if (conn->pending_sec_level > conn->sec_level) + conn->sec_level = conn->pending_sec_level; + }mutex_lock (&hci_cb_list_lock);list_for_each_entry (cb, &hci_cb_list, list) {
net/bluetooth/hci_conn.c +17 -0
@@ -1285,6 +1285,23 @@ int hci_conn_check_link_mode(struct hci_return 0 ; } +/* AES encryption is required for Level 4: +* +* BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 3, Part C +* page 1319: +* +* 128-bit equivalent strength for link and encryption keys +* required using FIPS approved algorithms (E0 not allowed, +* SAFER+ not allowed, and P-192 not allowed; encryption key +* not shortened) +*/ +if (conn->sec_level ==BT_SECURITY_FIPS && + !test_bit (HCI_CONN_AES_CCM , &conn->flags)) { +bt_dev_err (conn->hdev, +"Invalid security: Missing AES-CCM usage" ); +return 0 ; + } +if (hci_conn_ssp_enabled (conn) && !test_bit (HCI_CONN_ENCRYPT , &conn->flags))return 0 ;
net/bluetooth/hci_event.c +8 -12
@@ -2974,26 +2974,22 @@ static void hci_encrypt_change_evt(strucclear_bit (HCI_CONN_ENCRYPT_PEND , &conn->flags); +/* Check link security requirements are met */ +if (!hci_conn_check_link_mode (conn)) + ev->status =HCI_ERROR_AUTH_FAILURE ; +if (ev->status && conn->state ==BT_CONNECTED ) {if (ev->status ==HCI_ERROR_PIN_OR_KEY_MISSING )set_bit (HCI_CONN_AUTH_FAILURE , &conn->flags); +/* Notify upper layers so they can cleanup before +* disconnecting. +*/ +hci_encrypt_cfm (conn, ev->status);hci_disconnect (conn,HCI_ERROR_AUTH_FAILURE );hci_conn_drop (conn); goto unlock; } - -/* In Secure Connections Only mode, do not allow any connections -* that are not encrypted with AES-CCM using a P-256 authenticated -* combination key. -*/ -if (hci_dev_test_flag (hdev,HCI_SC_ONLY ) && - (!test_bit (HCI_CONN_AES_CCM , &conn->flags) || - conn->key_type !=HCI_LK_AUTH_COMBINATION_P256 )) { -hci_connect_cfm (conn,HCI_ERROR_AUTH_FAILURE ); -hci_conn_drop (conn); - goto unlock; - }/* Try reading the encryption key size for encrypted ACL links */ if (!ev->status && ev->encrypt && conn->type ==ACL_LINK ) {
Greg Kroah-Hartman
maintainerPATCH 12/22 media: usbtv: Fix refcounting mixup
In reply to Greg Kroah-HartmanFrom: Oliver Neukum <[email protected]>
commit bf65f8aabdb37bc1a785884374e919477fe13e10 upstream.
The premature free in the error path is blocked by V4L refcounting, not USB refcounting. Thanks to Ben Hutchings for review.
[v2] corrected attributions
--- drivers/media/usb/usbtv/usbtv-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/usb/usbtv/usbtv-core.c +2 -1
@@ -113,7 +113,8 @@ static int usbtv_probe(struct usb_interf usbtv_audio_fail:/* we must not free at this point */ -usb_get_dev (usbtv->udev); +v4l2_device_get (&usbtv->v4l2_dev); +/* this will undo the v4l2_device_get() */ usbtv_video_free (usbtv); usbtv_video_fail:
Greg Kroah-Hartman
maintainerPATCH 13/22 USB: serial: option: add Cellient MPL200 card
In reply to Greg Kroah-HartmanFrom: Wilken Gottwalt <[email protected]>
commit 3e765cab8abe7f84cb80d4a7a973fc97d5742647 upstream.
Add usb ids of the Cellient MPL200 card.
--- drivers/usb/serial/option.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/serial/option.c +3 -0
@@ -528,6 +528,7 @@ static void option_instat_callback(struc/* Cellient products */ #define CELLIENT_VENDOR_ID 0x2692#define CELLIENT_PRODUCT_MEN200 0x9005 +#define CELLIENT_PRODUCT_MPL200 0x9025/* Hyundai Petatel Inc. products */ #define PETATEL_VENDOR_ID 0x1ff4
@@ -1982,6 +1983,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x02, 0x01) }, { USB_DEVICE_AND_INTERFACE_INFO(MEDIATEK_VENDOR_ID, MEDIATEK_PRODUCT_DC_4COM2, 0xff, 0x00, 0x00) }, { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, + { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MPL200), + .driver_info = RSVD(1) | RSVD(4) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) }, { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) }, { USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */
Greg Kroah-Hartman
maintainerPATCH 14/22 USB: serial: option: Add Telit FT980-KS composition
In reply to Greg Kroah-HartmanFrom: Leonid Bloch <[email protected]>
commit 924a9213358fb92fa3c3225d6d042aa058167405 upstream.
This commit adds the following Telit FT980-KS composition:
0x1054: rndis, diag, adb, nmea, modem, modem, aux
AT commands can be sent to /dev/ttyUSB2.
--- drivers/usb/serial/option.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/serial/option.c +2 -0
@@ -1187,6 +1187,8 @@ static const struct usb_device_id option .driver_info = NCTRL(2) | RSVD(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */ .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1054, 0xff), /* Telit FT980-KS */ + .driver_info = NCTRL(2) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
Greg Kroah-Hartman
maintainerPATCH 15/22 staging: comedi: check validity of wMaxPacketSize of usb endpoints found
In reply to Greg Kroah-HartmanFrom: Anant Thazhemadam <[email protected]>
commit e1f13c879a7c21bd207dc6242455e8e3a1e88b40 upstream.
While finding usb endpoints in vmk80xx_find_usb_endpoints(), check if wMaxPacketSize = 0 for the endpoints found.
Some devices have isochronous endpoints that have wMaxPacketSize = 0 (as required by the USB-2 spec).
However, since this doesn't apply here, wMaxPacketSize = 0 can be considered to be invalid.
--- drivers/staging/comedi/drivers/vmk80xx.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/comedi/drivers/vmk80xx.c +3 -0
@@ -667,6 +667,9 @@ static int vmk80xx_find_usb_endpoints(stif (!devpriv->ep_rx || !devpriv->ep_tx)return -ENODEV ; +if (!usb_endpoint_maxp (devpriv->ep_rx) || !usb_endpoint_maxp (devpriv->ep_tx)) +return -EINVAL ; +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 16/22 USB: serial: pl2303: add device-id for HP GC device
In reply to Greg Kroah-HartmanFrom: Scott Chen <[email protected]>
commit 031f9664f8f9356cee662335bc56c93d16e75665 upstream.
This is adds a device id for HP LD381 which is a pl2303GC-base device.
--- drivers/usb/serial/pl2303.c | 1 + drivers/usb/serial/pl2303.h | 1 + 2 files changed, 2 insertions(+)
drivers/usb/serial/pl2303.c +1 -0
@@ -94,6 +94,7 @@ static const struct usb_device_id id_tab { USB_DEVICE(HP_VENDOR_ID, HP_LD220_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD220TA_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD381_PRODUCT_ID) }, + { USB_DEVICE(HP_VENDOR_ID, HP_LD381GC_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD960_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LD960TA_PRODUCT_ID) }, { USB_DEVICE(HP_VENDOR_ID, HP_LCM220_PRODUCT_ID) },
drivers/usb/serial/pl2303.h +1 -0
@@ -121,6 +121,7 @@/* Hewlett-Packard POS Pole Displays */ #define HP_VENDOR_ID 0x03f0 +#define HP_LD381GC_PRODUCT_ID 0x0183#define HP_LM920_PRODUCT_ID 0x026b#define HP_TD620_PRODUCT_ID 0x0956#define HP_LD960_PRODUCT_ID 0x0b39
Greg Kroah-Hartman
maintainerPATCH 17/22 USB: serial: ftdi_sio: add support for FreeCalypso JTAG+UART adapters
In reply to Greg Kroah-HartmanFrom: Mychaela N. Falconia <[email protected]>
commit 6cf87e5edd9944e1d3b6efd966ea401effc304ee upstream.
There exist many FT2232-based JTAG+UART adapter designs in which FT2232 Channel A is used for JTAG and Channel B is used for UART. The best way to handle them in Linux is to have the ftdi_sio driver create a ttyUSB device only for Channel B and not for Channel A:
a ttyUSB device for Channel A would be bogus and will disappear as soon as the user runs OpenOCD or other applications that access Channel A for JTAG from userspace, causing undesirable noise for users. The ftdi_sio driver already has a dedicated quirk for such JTAG+UART FT2232 adapters, and it requires assigning custom USB IDs to such adapters and adding these IDs to the driver with the ftdi_jtag_quirk applied.
Boutique hardware manufacturer Falconia Partners LLC has created a couple of JTAG+UART adapter designs (one buffered, one unbuffered) as part of FreeCalypso project, and this hardware is specifically made to be used with Linux hosts, with the intent that Channel A will be accessed only from userspace via appropriate applications, and that Channel B will be supported by the ftdi_sio kernel driver, presenting a standard ttyUSB device to userspace. Toward this end the hardware manufacturer will be programming FT2232 EEPROMs with custom USB IDs, specifically with the intent that these IDs will be recognized by the ftdi_sio driver with the ftdi_jtag_quirk applied.
--- drivers/usb/serial/ftdi_sio.c | 5 +++++ drivers/usb/serial/ftdi_sio_ids.h | 7 +++++++ 2 files changed, 12 insertions(+)
drivers/usb/serial/ftdi_sio.c +5 -0
@@ -1037,6 +1037,11 @@ static const struct usb_device_id id_tab/* U-Blox devices */ { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ZED_PID) }, { USB_DEVICE(UBLOX_VID, UBLOX_C099F9P_ODIN_PID) }, +/* FreeCalypso USB adapters */ + { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_BUF_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, + { USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID), + .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +7 -0
@@ -39,6 +39,13 @@#define FTDI_LUMEL_PD12_PID 0x6002 +/* +* Custom USB adapters made by Falconia Partners LLC +* for FreeCalypso project, ID codes allocated to Falconia by FTDI. +*/ +#define FTDI_FALCONIA_JTAG_BUF_PID 0x7150 +#define FTDI_FALCONIA_JTAG_UNBUF_PID 0x7151 +/* Sienna Serial Interface by Secyourit GmbH */ #define FTDI_SIENNA_PID 0x8348
Greg Kroah-Hartman
maintainerPATCH 18/22 reiserfs: Initialize inode keys properly
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit 4443390e08d34d5771ab444f601cf71b3c9634a4 upstream.
reiserfs_read_locked_inode() didn't initialize key length properly. Use _make_cpu_key() macro for key initialization so that all key member are properly initialized.
--- fs/reiserfs/inode.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
fs/reiserfs/inode.c +1 -5
@@ -1553,11 +1553,7 @@ void reiserfs_read_locked_inode(struct i* set version 1, version 2 could be used too, because stat data * key is the same in both versions */ - key.version =KEY_FORMAT_3_5 ; - key.on_disk_key.k_dir_id = dirino; - key.on_disk_key.k_objectid = inode->i_ino; - key.on_disk_key.k_offset =0 ; - key.on_disk_key.k_type =0 ; +_make_cpu_key (&key,KEY_FORMAT_3_5 , dirino, inode->i_ino,0 ,0 ,3 );/* look for the object's stat data */ retval =search_item (inode->i_sb, &key, &path_to_sd);
Greg Kroah-Hartman
maintainerPATCH 19/22 reiserfs: Fix oops during mount
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
commit c2bb80b8bdd04dfe32364b78b61b6a47f717af52 upstream.
With suitably crafted reiserfs image and mount command reiserfs will crash when trying to verify that XATTR_ROOT directory can be looked up in / as that recurses back to xattr code like:
xattr_lookup+0x24/0x280 fs/reiserfs/xattr.c:395 reiserfs_xattr_get+0x89/0x540 fs/reiserfs/xattr.c:677 reiserfs_get_acl+0x63/0x690 fs/reiserfs/xattr_acl.c:209 get_acl+0x152/0x2e0 fs/posix_acl.c:141 check_acl fs/namei.c:277 [inline] acl_permission_check fs/namei.c:309 [inline] generic_permission+0x2ba/0x550 fs/namei.c:353 do_inode_permission fs/namei.c:398 [inline] inode_permission+0x234/0x4a0 fs/namei.c:463 lookup_one_len+0xa6/0x200 fs/namei.c:2557 reiserfs_lookup_privroot+0x85/0x1e0 fs/reiserfs/xattr.c:972 reiserfs_fill_super+0x2b51/0x3240 fs/reiserfs/super.c:2176 mount_bdev+0x24f/0x360 fs/super.c:1417
Fix the problem by bailing from reiserfs_xattr_get() when xattrs are not yet initialized.
--- fs/reiserfs/xattr.c | 7 +++++++ 1 file changed, 7 insertions(+)
fs/reiserfs/xattr.c +7 -0
@@ -674,6 +674,13 @@ reiserfs_xattr_get(struct inode *inode,if (get_inode_sd_version (inode) ==STAT_DATA_V1 )return -EOPNOTSUPP ; +/* +* priv_root needn't be initialized during mount so allow initial +* lookups to succeed. +*/ +if (!REISERFS_SB (inode->i_sb)->priv_root) +return 0 ; + dentry =xattr_lookup (inode, name,XATTR_REPLACE );if (IS_ERR (dentry)) { err =PTR_ERR (dentry);
Greg Kroah-Hartman
maintainerPATCH 20/22 xen/events: dont use chip_data for legacy IRQs
In reply to Greg Kroah-HartmanFrom: Juergen Gross <[email protected]>
commit 0891fb39ba67bd7ae023ea0d367297ffff010781 upstream.
Since commit c330fb1ddc0a ("XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.") Xen is using the chip_data pointer for storing IRQ specific data. When
running as a HVM domain this can result in problems for legacy IRQs, as
those might use chip_data for their own purposes.
Use a local array for this purpose in case of legacy IRQs, avoiding the double use.
--- drivers/xen/events/events_base.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-)
drivers/xen/events/events_base.c +21 -8
@@ -91,6 +91,8 @@ static bool (*pirq_needs_eoi)(unsigned i/* Xen will never allocate port zero for any purpose. */ #define VALID_EVTCHN (chn) ((chn) != 0) +static struct irq_info *legacy_info_ptrs[NR_IRQS_LEGACY ]; +static struct irq_chip xen_dynamic_chip;static struct irq_chip xen_percpu_chip;static struct irq_chip xen_pirq_chip;
@@ -155,7 +157,18 @@ int get_evtchn_to_irq(unsigned evtchn)/* Get info for IRQ */ struct irq_info *info_for_irq (unsigned irq) { -return irq_get_chip_data (irq); +if (irq <nr_legacy_irqs ()) +return legacy_info_ptrs[irq]; +else +return irq_get_chip_data (irq); +} + +static void set_info_for_irq (unsigned int irq,struct irq_info *info) +{ +if (irq <nr_legacy_irqs ()) + legacy_info_ptrs[irq] = info; +else +irq_set_chip_data (irq, info); }/* Constructors for packed IRQ information. */
@@ -376,7 +389,7 @@ static void xen_irq_init(unsigned irq) info->type =IRQT_UNBOUND ; info->refcnt =-1 ; -irq_set_chip_data (irq, info); +set_info_for_irq (irq, info);list_add_tail (&info->list, &xen_irq_list_head); }
@@ -425,14 +438,14 @@ static int __must_check xen_allocate_irqstatic void xen_free_irq (unsigned irq) { -struct irq_info *info =irq_get_chip_data (irq); +struct irq_info *info =info_for_irq (irq);if (WARN_ON (!info))return ;list_del (&info->list); -irq_set_chip_data (irq,NULL ); +set_info_for_irq (irq,NULL );WARN_ON (info->refcnt >0 );
@@ -602,7 +615,7 @@ EXPORT_SYMBOL_GPL(xen_irq_from_gsi);static void __unbind_from_irq (unsigned int irq) {int evtchn =evtchn_from_irq (irq); -struct irq_info *info =irq_get_chip_data (irq); +struct irq_info *info =info_for_irq (irq);if (info->refcnt >0 ) { info->refcnt--;
@@ -1106,7 +1119,7 @@ int bind_ipi_to_irqhandler(enum ipi_vectvoid unbind_from_irqhandler (unsigned int irq,void *dev_id) { -struct irq_info *info =irq_get_chip_data (irq); +struct irq_info *info =info_for_irq (irq);if (WARN_ON (!info))return ;
@@ -1140,7 +1153,7 @@ int evtchn_make_refcounted(unsigned intif (irq ==-1 )return -ENOENT ; - info =irq_get_chip_data (irq); + info =info_for_irq (irq);if (!info)return -ENOENT ;
@@ -1168,7 +1181,7 @@ int evtchn_get(unsigned int evtchn)if (irq ==-1 ) goto done; - info =irq_get_chip_data (irq); + info =info_for_irq (irq);if (!info) goto done;
Greg Kroah-Hartman
maintainerPATCH 21/22 crypto: bcm - Verify GCM/CCM key length in setkey
In reply to Greg Kroah-HartmanFrom: Herbert Xu <[email protected]>
commit 10a2f0b311094ffd45463a529a410a51ca025f27 upstream.
The setkey function for GCM/CCM algorithms didn't verify the key length before copying the key and subtracting the salt length.
This patch delays the copying of the key til after the verification has been done. It also adds checks on the key length to ensure that it's at least as long as the salt.
--- drivers/crypto/bcm/cipher.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/crypto/bcm/cipher.c +14 -1
@@ -2937,7 +2937,6 @@ static int aead_gcm_ccm_setkey(struct cr ctx->enckeylen = keylen; ctx->authkeylen =0 ; -memcpy (ctx->enckey, key, ctx->enckeylen);switch (ctx->enckeylen) {case AES_KEYSIZE_128 :
@@ -2953,6 +2952,8 @@ static int aead_gcm_ccm_setkey(struct cr goto badkey; } +memcpy (ctx->enckey, key, ctx->enckeylen); +flow_log (" enckeylen:%u authkeylen:%u\n" , ctx->enckeylen, ctx->authkeylen);flow_dump (" enc: " , ctx->enckey, ctx->enckeylen);
@@ -3013,6 +3014,10 @@ static int aead_gcm_esp_setkey(struct crstruct iproc_ctx_s *ctx =crypto_aead_ctx (cipher);flow_log ("%s\n" , __func__); + +if (keylen <GCM_ESP_SALT_SIZE ) +return -EINVAL ; + ctx->salt_len =GCM_ESP_SALT_SIZE ; ctx->salt_offset =GCM_ESP_SALT_OFFSET ;memcpy (ctx->salt, key + keylen -GCM_ESP_SALT_SIZE ,GCM_ESP_SALT_SIZE );
@@ -3041,6 +3046,10 @@ static int rfc4543_gcm_esp_setkey(structstruct iproc_ctx_s *ctx =crypto_aead_ctx (cipher);flow_log ("%s\n" , __func__); + +if (keylen <GCM_ESP_SALT_SIZE ) +return -EINVAL ; + ctx->salt_len =GCM_ESP_SALT_SIZE ; ctx->salt_offset =GCM_ESP_SALT_OFFSET ;memcpy (ctx->salt, key + keylen -GCM_ESP_SALT_SIZE ,GCM_ESP_SALT_SIZE );
@@ -3070,6 +3079,10 @@ static int aead_ccm_esp_setkey(struct crstruct iproc_ctx_s *ctx =crypto_aead_ctx (cipher);flow_log ("%s\n" , __func__); + +if (keylen <CCM_ESP_SALT_SIZE ) +return -EINVAL ; + ctx->salt_len =CCM_ESP_SALT_SIZE ; ctx->salt_offset =CCM_ESP_SALT_OFFSET ;memcpy (ctx->salt, key + keylen -CCM_ESP_SALT_SIZE ,CCM_ESP_SALT_SIZE );
Greg Kroah-Hartman
maintainerPATCH 22/22 crypto: qat - check cipher length for aead AES-CBC-HMAC-SHA
In reply to Greg Kroah-HartmanFrom: Dominik Przychodni <[email protected]>
commit 45cb6653b0c355fc1445a8069ba78a4ce8720511 upstream.
Return -EINVAL for authenc(hmac(sha1),cbc(aes)), authenc(hmac(sha256),cbc(aes)) and authenc(hmac(sha512),cbc(aes)) if the cipher length is not multiple of the AES block. This is to prevent an undefined device behaviour.
--- drivers/crypto/qat/qat_common/qat_algs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/crypto/qat/qat_common/qat_algs.c +9 -1
@@ -873,6 +873,11 @@ static int qat_alg_aead_dec(struct aead_struct icp_qat_fw_la_bulk_req *msg;int digst_size =crypto_aead_authsize (aead_tfm);int ret, ctr =0 ; +u32 cipher_len; + + cipher_len = areq->cryptlen - digst_size; +if (cipher_len %AES_BLOCK_SIZE !=0 ) +return -EINVAL ; ret =qat_alg_sgl_to_bufl (ctx->inst, areq->src, areq->dst, qat_req);if (unlikely (ret))
@@ -887,7 +892,7 @@ static int qat_alg_aead_dec(struct aead_ qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp; qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp; cipher_param = (void *)&qat_req->req.serv_specif_rqpars; - cipher_param->cipher_length = areq->cryptlen - digst_size; + cipher_param->cipher_length = cipher_len; cipher_param->cipher_offset = areq->assoclen;memcpy (cipher_param->u.cipher_IV_array, areq->iv,AES_BLOCK_SIZE ); auth_param = (void *)((uint8_t *)cipher_param +sizeof (*cipher_param));
@@ -916,6 +921,9 @@ static int qat_alg_aead_enc(struct aead_uint8_t *iv = areq->iv;int ret, ctr =0 ; +if (areq->cryptlen %AES_BLOCK_SIZE !=0 ) +return -EINVAL ; + ret =qat_alg_sgl_to_bufl (ctx->inst, areq->src, areq->dst, qat_req);if (unlikely (ret))return ret;
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.72 release. There are 22 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 Sun, 18 Oct 2020 09:04:25 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.72-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.4:
15 builds: 15 pass, 0 fail
26 boots: 26 pass, 0 fail
56 tests: 56 pass, 0 failLinux version: 5.4.72-rc1-ga3f8c7f24ee0
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.72 release. There are 22 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 Sun, 18 Oct 2020 09:04:25 +0000. Anything received after that time might be too late.
Build results:
total: 157 pass: 157 fail: 0 Qemu test results: total: 430 pass: 430 fail: 0
Guenter
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.72 release. There are 22 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 Sun, 18 Oct 2020 09:04:25 +0000. 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/v5.x/stable-review/patch-5.4.72-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
Summary
------------------------------------------------------------------------
kernel: 5.4.72-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.4.y
git commit: a3f8c7f24ee00462a09758774aee840317650b51
git describe: v5.4.71-23-ga3f8c7f24ee0
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.4.y/build/v5.4.71-23-ga3f8c7f24ee0
No regressions (compared to build v5.4.71)
No fixes (compared to build v5.4.71)
Ran 24730 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- juno-r2-compat
- nxp-ls2088
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86
- x86-kasan
Test Suites
-----------
* build
* install-android-platform-tools-r2600
* kselftest
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-fs-tests
* ltp-ipc-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* perf
* v4l2-compliance
* ltp-commands-tests
* ltp-containers-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-math-tests
* ltp-mm-tests
* network-basic-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-none
* ssuite
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.72 release. There are 22 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 Sun, 18 Oct 2020 09:04:25 +0000. 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/v5.x/stable-review/patch-5.4.72-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah