diff options
author | 2024-02-06 10:37:54 -0500 | |
---|---|---|
committer | 2024-02-06 10:37:54 -0500 | |
commit | 7b214aa2332c2393f4f2c4024405f60951a5c2ba (patch) | |
tree | 5a2fd5b63a188a7748f51df1854d98637564ef24 | |
parent | media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) (diff) | |
download | linux-patches-7b214aa2332c2393f4f2c4024405f60951a5c2ba.tar.gz linux-patches-7b214aa2332c2393f4f2c4024405f60951a5c2ba.tar.bz2 linux-patches-7b214aa2332c2393f4f2c4024405f60951a5c2ba.zip |
Fix-up unintentional patch overwrite6.6-21
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
-rw-r--r-- | 2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch | 105 | ||||
-rw-r--r-- | 2700_solo6x10-mem-resource-reduction-fix.patch | 70 |
2 files changed, 106 insertions, 69 deletions
diff --git a/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch b/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch index a0b55a8c..394ad48f 100644 --- a/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch +++ b/2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch @@ -1,70 +1,37 @@ -diff --git a/2700_solo6x10-mem-resource-reduction-fix.patch b/2700_solo6x10-mem-resource-reduction-fix.patch -new file mode 100644 -index 00000000..bf406a92 ---- /dev/null -+++ b/2700_solo6x10-mem-resource-reduction-fix.patch -@@ -0,0 +1,61 @@ -+From 31e97d7c9ae3de072d7b424b2cf706a03ec10720 Mon Sep 17 00:00:00 2001 -+From: Aurelien Jarno <aurelien@aurel32.net> -+Date: Sat, 13 Jan 2024 19:33:31 +0100 -+Subject: media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) -+ -+This patch replaces max(a, min(b, c)) by clamp(b, a, c) in the solo6x10 -+driver. This improves the readability and more importantly, for the -+solo6x10-p2m.c file, this reduces on my system (x86-64, gcc 13): -+ -+ - the preprocessed size from 121 MiB to 4.5 MiB; -+ -+ - the build CPU time from 46.8 s to 1.6 s; -+ -+ - the build memory from 2786 MiB to 98MiB. -+ -+In fine, this allows this relatively simple C file to be built on a -+32-bit system. -+ -+Reported-by: Jiri Slaby <jirislaby@gmail.com> -+Closes: https://lore.kernel.org/lkml/18c6df0d-45ed-450c-9eda-95160a2bbb8e@gmail.com/ -+Cc: <stable@vger.kernel.org> # v6.7+ -+Suggested-by: David Laight <David.Laight@ACULAB.COM> -+Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> -+Reviewed-by: David Laight <David.Laight@ACULAB.COM> -+Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> -+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> -+--- -+ drivers/media/pci/solo6x10/solo6x10-offsets.h | 10 +++++----- -+ 1 file changed, 5 insertions(+), 5 deletions(-) -+ -+(limited to 'drivers/media/pci/solo6x10/solo6x10-offsets.h') -+ -+diff --git a/drivers/media/pci/solo6x10/solo6x10-offsets.h b/drivers/media/pci/solo6x10/solo6x10-offsets.h -+index f414ee1316f29c..fdbb817e63601c 100644 -+--- a/drivers/media/pci/solo6x10/solo6x10-offsets.h -++++ b/drivers/media/pci/solo6x10/solo6x10-offsets.h -+@@ -57,16 +57,16 @@ -+ #define SOLO_MP4E_EXT_ADDR(__solo) \ -+ (SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo)) -+ #define SOLO_MP4E_EXT_SIZE(__solo) \ -+- max((__solo->nr_chans * 0x00080000), \ -+- min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) - \ -+- __SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000)) -++ clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) - \ -++ __SOLO_JPEG_MIN_SIZE(__solo), \ -++ __solo->nr_chans * 0x00080000, 0x00ff0000) -+ -+ #define __SOLO_JPEG_MIN_SIZE(__solo) (__solo->nr_chans * 0x00080000) -+ #define SOLO_JPEG_EXT_ADDR(__solo) \ -+ (SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo)) -+ #define SOLO_JPEG_EXT_SIZE(__solo) \ -+- max(__SOLO_JPEG_MIN_SIZE(__solo), \ -+- min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000)) -++ clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo), \ -++ __SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000) -+ -+ #define SOLO_SDRAM_END(__solo) \ -+ (SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo)) -+-- -+cgit 1.2.3-korg -+ --- -cgit v1.2.3 +The encryption is only mandatory to be enforced when both sides are using +Secure Simple Pairing and this means the key size check makes only sense +in that case. +On legacy Bluetooth 2.0 and earlier devices like mice the encryption was +optional and thus causing an issue if the key size check is not bound to +using Secure Simple Pairing. + +Fixes: d5bb334a8e17 ("Bluetooth: Align minimum encryption key size for LE and BR/EDR connections") +Signed-off-by: Marcel Holtmann <marcel@holtmann.org> +Cc: stable@vger.kernel.org +--- + net/bluetooth/hci_conn.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c +index 3cf0764d5793..7516cdde3373 100644 +--- a/net/bluetooth/hci_conn.c ++++ b/net/bluetooth/hci_conn.c +@@ -1272,8 +1272,13 @@ int hci_conn_check_link_mode(struct hci_conn *conn) + return 0; + } + +- if (hci_conn_ssp_enabled(conn) && +- !test_bit(HCI_CONN_ENCRYPT, &conn->flags)) ++ /* If Secure Simple Pairing is not enabled, then legacy connection ++ * setup is used and no encryption or key sizes can be enforced. ++ */ ++ if (!hci_conn_ssp_enabled(conn)) ++ return 1; ++ ++ if (!test_bit(HCI_CONN_ENCRYPT, &conn->flags)) + return 0; + + /* The minimum encryption key size needs to be enforced by the +-- +2.20.1 diff --git a/2700_solo6x10-mem-resource-reduction-fix.patch b/2700_solo6x10-mem-resource-reduction-fix.patch new file mode 100644 index 00000000..a0b55a8c --- /dev/null +++ b/2700_solo6x10-mem-resource-reduction-fix.patch @@ -0,0 +1,70 @@ +diff --git a/2700_solo6x10-mem-resource-reduction-fix.patch b/2700_solo6x10-mem-resource-reduction-fix.patch +new file mode 100644 +index 00000000..bf406a92 +--- /dev/null ++++ b/2700_solo6x10-mem-resource-reduction-fix.patch +@@ -0,0 +1,61 @@ ++From 31e97d7c9ae3de072d7b424b2cf706a03ec10720 Mon Sep 17 00:00:00 2001 ++From: Aurelien Jarno <aurelien@aurel32.net> ++Date: Sat, 13 Jan 2024 19:33:31 +0100 ++Subject: media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) ++ ++This patch replaces max(a, min(b, c)) by clamp(b, a, c) in the solo6x10 ++driver. This improves the readability and more importantly, for the ++solo6x10-p2m.c file, this reduces on my system (x86-64, gcc 13): ++ ++ - the preprocessed size from 121 MiB to 4.5 MiB; ++ ++ - the build CPU time from 46.8 s to 1.6 s; ++ ++ - the build memory from 2786 MiB to 98MiB. ++ ++In fine, this allows this relatively simple C file to be built on a ++32-bit system. ++ ++Reported-by: Jiri Slaby <jirislaby@gmail.com> ++Closes: https://lore.kernel.org/lkml/18c6df0d-45ed-450c-9eda-95160a2bbb8e@gmail.com/ ++Cc: <stable@vger.kernel.org> # v6.7+ ++Suggested-by: David Laight <David.Laight@ACULAB.COM> ++Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> ++Reviewed-by: David Laight <David.Laight@ACULAB.COM> ++Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> ++Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> ++--- ++ drivers/media/pci/solo6x10/solo6x10-offsets.h | 10 +++++----- ++ 1 file changed, 5 insertions(+), 5 deletions(-) ++ ++(limited to 'drivers/media/pci/solo6x10/solo6x10-offsets.h') ++ ++diff --git a/drivers/media/pci/solo6x10/solo6x10-offsets.h b/drivers/media/pci/solo6x10/solo6x10-offsets.h ++index f414ee1316f29c..fdbb817e63601c 100644 ++--- a/drivers/media/pci/solo6x10/solo6x10-offsets.h +++++ b/drivers/media/pci/solo6x10/solo6x10-offsets.h ++@@ -57,16 +57,16 @@ ++ #define SOLO_MP4E_EXT_ADDR(__solo) \ ++ (SOLO_EREF_EXT_ADDR(__solo) + SOLO_EREF_EXT_AREA(__solo)) ++ #define SOLO_MP4E_EXT_SIZE(__solo) \ ++- max((__solo->nr_chans * 0x00080000), \ ++- min(((__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo)) - \ ++- __SOLO_JPEG_MIN_SIZE(__solo)), 0x00ff0000)) +++ clamp(__solo->sdram_size - SOLO_MP4E_EXT_ADDR(__solo) - \ +++ __SOLO_JPEG_MIN_SIZE(__solo), \ +++ __solo->nr_chans * 0x00080000, 0x00ff0000) ++ ++ #define __SOLO_JPEG_MIN_SIZE(__solo) (__solo->nr_chans * 0x00080000) ++ #define SOLO_JPEG_EXT_ADDR(__solo) \ ++ (SOLO_MP4E_EXT_ADDR(__solo) + SOLO_MP4E_EXT_SIZE(__solo)) ++ #define SOLO_JPEG_EXT_SIZE(__solo) \ ++- max(__SOLO_JPEG_MIN_SIZE(__solo), \ ++- min((__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo)), 0x00ff0000)) +++ clamp(__solo->sdram_size - SOLO_JPEG_EXT_ADDR(__solo), \ +++ __SOLO_JPEG_MIN_SIZE(__solo), 0x00ff0000) ++ ++ #define SOLO_SDRAM_END(__solo) \ ++ (SOLO_JPEG_EXT_ADDR(__solo) + SOLO_JPEG_EXT_SIZE(__solo)) ++-- ++cgit 1.2.3-korg ++ +-- +cgit v1.2.3 + |