Re: [PATCH v3 2/2] Bluetooth: Support the vendor specific debug events

2021-04-13 Thread Marcel Holtmann
> + bt_dev_dbg(hdev, "enable %d", enable); > + > + /* Read the Intel supported features and if new exception formats > + * supported, need to load the additional DDC config to enable. > + */ > + err = btintel_read_debug_features(hdev, &features); > +

Re: [PATCH] net: bluetooth: cmtp: fix file refcount when cmtp_attach_device fails

2021-04-13 Thread Marcel Holtmann
Hi Thadeu, > When cmtp_attach_device fails, cmtp_add_connection returns the error value > which leads to the caller to doing fput through sockfd_put. But > cmtp_session kthread, which is stopped in this path will also call fput, > leading to a potential refcount underflow or a use-after-free. > >

Re: [PATCH v2] Bluetooth: Return whether a connection is outbound

2021-04-11 Thread Marcel Holtmann
Hi Yu, > When an MGMT_EV_DEVICE_CONNECTED event is reported back to the user > space we will set the flags to tell if the established connection is > outbound or not. This is useful for the user space to log better metrics > and error messages. > > Reviewed-by: Miao-chen Chou > Reviewed-by: Alai

Re: [PATCH -next] Bluetooth: use flexible-array member instead of zero-length array

2021-04-11 Thread Marcel Holtmann
Hi Qiheng, > Fix the following coccicheck warning: > > net/bluetooth/msft.c:37:6-13: WARNING use flexible-array member instead > net/bluetooth/msft.c:42:6-10: WARNING use flexible-array member instead > net/bluetooth/msft.c:52:6-10: WARNING use flexible-array member instead > > Signed-off-by: Qi

Re: [PATCH v2] Bluetooth: hci_h5: btrtl: Add quirk for keep power in suspend/resume

2021-04-09 Thread Marcel Holtmann
Hi Hilda, > RTL8822C devices support BT wakeup Host. Add a quirk for these specific > devices did not power off during suspend and resume. > By this change, if the Host support that received BT device signal then > it can be wakeup. > > Signed-off-by: hildawu > --- > Changes in v2: > - Add missi

Re: [PATCH v1] Bluetooth: Return whether a connection is outbound

2021-04-09 Thread Marcel Holtmann
Hi Yu, > When an MGMT_EV_DEVICE_CONNECTED event is reported back to the user > space we will set the flags to tell if the established connection is > outbound or not. This is useful for the user space to log better metrics > and error messages. > > Reviewed-by: Miao-chen Chou > Reviewed-by: Alai

Re: [PATCH] net/Bluetooth - delete unneeded variable initialization

2021-04-09 Thread Marcel Holtmann
Hi Kai, > Delete unneeded variable initialization. > > Signed-off-by: Kai Ye > --- > net/bluetooth/6lowpan.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards Marcel

Re: [PATCH v2] Bluetooth: Add ncmd=0 recovery handling

2021-04-08 Thread Marcel Holtmann
Hi Manish, > During command status or command complete event, the controller may set > ncmd=0 indicating that it is not accepting any more commands. In such a > case, host holds off sending any more commands to the controller. If the > controller doesn't recover from such condition, host will wait

Re: [PATCH 0/2] Bluetooth: Avoid centralized adv handle tracking for extended features

2021-04-06 Thread Marcel Holtmann
Hi Daniel, > This series addresses a race condition where an advertisement > registration can conflict with a software rotation advertisement > refresh. I found that this issue was only occurring with the new > extended MGMT advertising interface. A bad use of the > hdev->cur_adv_instance caused e

Re: [PATCH] net/Bluetooth - use the correct print format

2021-04-06 Thread Marcel Holtmann
Hi Kai, > Use the correct print format. Printing an unsigned int value should use %u > instead of %d. For details, please read document: > Documentation/core-api/printk-formats.rst > > Signed-off-by: Kai Ye > --- > net/bluetooth/l2cap_core.c | 16 > 1 file changed, 8 insertions(+

Re: [PATCH] Bluetooth: Check inquiry status before sending one

2021-04-02 Thread Marcel Holtmann
Hi Archie, > There is a possibility where HCI_INQUIRY flag is set but we still > send HCI_OP_INQUIRY anyway. > > Such a case can be reproduced by connecting to an LE device while > active scanning. When the device is discovered, we initiate a > connection, stop LE Scan, and send Discovery MGMT wi

Re: [PATCH] Bluetooth: L2CAP: Rudimentary typo fixes

2021-03-26 Thread Marcel Holtmann
Hi Bhaskar, > s/minium/minimum/ > s/procdure/procedure/ > > Signed-off-by: Bhaskar Chowdhury > --- > net/bluetooth/l2cap_core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel

Re: [PATCH] Bluetooth: Always call advertising disable before setting params

2021-03-24 Thread Marcel Holtmann
Hi Daniel, > In __hci_req_enable_advertising, the HCI_LE_ADV hdev flag is temporarily > cleared to allow the random address to be set, which exposes a race > condition when an advertisement is configured immediately (<10ms) after > software rotation starts to refresh an advertisement. > > In norm

Re: [PATCH v1] Bluetooth: Return whether a connection is outbound

2021-03-23 Thread Marcel Holtmann
Hi Yu, > When an MGMT_EV_DEVICE_CONNECTED event is reported back to the user > space we will set the flags to tell if the established connection is > outbound or not. This is useful for the user space to log better metrics > and error messages. > > Reviewed-by: Miao-chen Chou > Reviewed-by: Alai

Re: [PATCH v2] Bluetooth: check for zapped sk before connecting

2021-03-23 Thread Marcel Holtmann
Hi Archie, > There is a possibility of receiving a zapped sock on > l2cap_sock_connect(). This could lead to interesting crashes, one > such case is tearing down an already tore l2cap_sock as is happened > with this call trace: > > __dump_stack lib/dump_stack.c:15 [inline] > dump_stack+0xc4/0x118

Re: [PATCH] bluetooth: fix set_ecdh_privkey() prototype

2021-03-22 Thread Marcel Holtmann
Hi Arnd, > gcc-11 points out that the declaration does not match the definition: > > net/bluetooth/ecdh_helper.c:122:55: error: argument 2 of type ‘const u8[32]’ > {aka ‘const unsigned char[32]’} with mismatched bound > [-Werror=array-parameter=] > 122 | int set_ecdh_privkey(struct crypto_kpp

Re: [PATCH] Bluetooth: initialize skb_queue_head at l2cap_chan_create()

2021-03-22 Thread Marcel Holtmann
Hi Tetsuo, > syzbot is hitting "INFO: trying to register non-static key." message [1], > for "struct l2cap_chan"->tx_q.lock spinlock is not yet initialized when > l2cap_chan_del() is called due to e.g. timeout. > > Since "struct l2cap_chan"->lock mutex is initialized at l2cap_chan_create() > imme

Re: [PATCH] Bluetooth: verify AMP hci_chan before amp_destroy

2021-03-22 Thread Marcel Holtmann
Hi Archie, > hci_chan can be created in 2 places: hci_loglink_complete_evt() if > it is an AMP hci_chan, or l2cap_conn_add() otherwise. In theory, > Only AMP hci_chan should be removed by a call to > hci_disconn_loglink_complete_evt(). However, the controller might mess > up, call that function, a

Re: [PATCH] Bluetooth: Set CONF_NOT_COMPLETE as l2cap_chan default

2021-03-22 Thread Marcel Holtmann
Hi Archie, > Currently l2cap_chan_set_defaults() reset chan->conf_state to zero. > However, there is a flag CONF_NOT_COMPLETE which is set when > creating the l2cap_chan. It is suggested that the flag should be > cleared when l2cap_chan is ready, but when l2cap_chan_set_defaults() > is called, l2c

Re: [PATCH] Bluetooth: check for zapped sk before connecting

2021-03-22 Thread Marcel Holtmann
Hi Archie, > There is a possibility of receiving a zapped sock on > l2cap_sock_connect(). This could lead to interesting crashes, one > such case is tearing down an already tore l2cap_sock as is happened > with this call trace: > > __dump_stack lib/dump_stack.c:15 [inline] > dump_stack+0xc4/0x118

Re: [PATCH v1] Bluetooth: Add ncmd=0 recovery handling

2021-03-20 Thread Marcel Holtmann
Hi Manish, > During command status or command complete event, the controller may set > ncmd=0 indicating that it is not accepting any more commands. In such a > case, host holds off sending any more commands to the controller. If the > controller doesn't recover from such condition, host will wait

Re: [PATCH] Bluetooth: Allow scannable adv with extended MGMT APIs

2021-03-03 Thread Marcel Holtmann
Hi Daniel, > An issue was found, where if a bluetooth client requests a broadcast > advertisement with scan response data, it will not be properly > registered with the controller. This is because at the time that the > hci_cp_le_set_scan_param structure is created, the scan response will > not ye

Re: [PATCH v3 1/1] Bluetooth: Remove unneeded commands for suspend

2021-03-03 Thread Marcel Holtmann
Hi Abhishek, > During suspend, there are a few scan enable and set event filter > commands that don't need to be sent unless there are actual BR/EDR > devices capable of waking the system. Check the HCI_PSCAN bit before > writing scan enable and use a new dev flag, HCI_EVENT_FILTER_CONFIGURED > to

Re: [PATCH v2 1/1] Bluetooth: Remove unneeded commands for suspend

2021-03-03 Thread Marcel Holtmann
Hi Abhishek, > During suspend, there are a few scan enable and set event filter > commands that don't need to be sent unless there are actual BR/EDR > devices capable of waking the system. Check the HCI_PSCAN bit before > writing scan enable and use a new dev flag, HCI_EVENT_FILTER_CONFIGURED > to

Re: [PATCH 2/2] Bluetooth: Remove unneeded commands for suspend

2021-03-02 Thread Marcel Holtmann
Hi Abhishek, > During suspend, there are a few scan enable and set event filter > commands that don't need to be sent unless there are actual BR/EDR > devices capable of waking the system. Check the HCI_PSCAN bit before > writing scan enable and use a new dev flag, HCI_EVENT_FILTER_CONFIGURED > to

Re: [PATCH 1/2] Bluetooth: Notify suspend on le conn failed

2021-03-02 Thread Marcel Holtmann
Hi Abhishek, > When suspending, Bluetooth disconnects all connected peers devices. If > an LE connection is started but isn't completed, we will see an LE > Create Connection Cancel instead of an HCI disconnect. This just adds > a check to see if an LE cancel was the last disconnected device and w

Re: [PATCH v4] Bluetooth: Keep MSFT ext info throughout a hci_dev's life cycle

2021-02-26 Thread Marcel Holtmann
Hi Miao-chen, > This moves msft_do_close() from hci_dev_do_close() to > hci_unregister_dev() to avoid clearing MSFT extension info. This also > re-reads MSFT info upon every msft_do_open() even if MSFT extension has > been initialized. > > The following test steps were performed. > (1) boot the t

Re: [PATCH v1] Bluetooth: Fix crash in mgmt_add_adv_patterns_monitor_complete

2021-02-03 Thread Marcel Holtmann
Hi Howard, > If hci_add_adv_monitor is a pending command(e.g. forward to > msft_add_monitor_pattern), it is possible that > mgmt_add_adv_patterns_monitor_complete gets called before > cmd->user_data gets set, which will cause a crash when we > try to get the moniter handle through cmd->user_data i

Re: [PATCH v3] Bluetooth: Skip eSCO 2M params when not supported

2021-02-01 Thread Marcel Holtmann
Hi Yu, > If a peer device doesn't support eSCO 2M we should skip the params that > use it when setting up sync connection since they will always fail. > > Signed-off-by: Yu Liu > Reviewed-by: Abhishek Pandit-Subedi > --- > > Changes in v3: > - Use pkt_type instead of adding new field > > Chan

Re: [PATCH v3] Bluetooth: Keep MSFT ext info throughout ahci_dev's life cycle

2021-01-25 Thread Marcel Holtmann
Hi Miao-chen, > This moves msft_do_close() from hci_dev_do_close() to > hci_unregister_dev() to avoid clearing MSFT extension info. This also > avoids retrieving MSFT info upon every msft_do_open() if MSFT extension > has been initialized. > > The following test steps were performed. > (1) boot t

Re: [PATCH] net/bluetooth: Fix the follow coccicheck warnings

2021-01-25 Thread Marcel Holtmann
Hi Jiapeng, > ./net/bluetooth/hci_debugfs.c: WARNING: sniff_min_interval_fops > should be defined with DEFINE_DEBUGFS_ATTRIBUTE > > Signed-off-by: Jiapeng Zhong > Reported-by: Abaci Robot > --- > net/bluetooth/hci_debugfs.c | 38 +++--- > 1 file changed, 19 inserti

Re: [PATCH] Bluetooth: Put HCI device if inquiry procedure interrupts

2021-01-25 Thread Marcel Holtmann
Hi Pan, > Jump to the label done to decrement the reference count of HCI device > hdev on path that the Inquiry procedure is interrupted. > > Fixes: 3e13fa1e1fab ("Bluetooth: Fix hci_inquiry ioctl usage") > Signed-off-by: Pan Bian > --- > net/bluetooth/hci_core.c | 6 -- > 1 file changed, 4 i

Re: [PATCH v6 0/7] MSFT offloading support for advertisement monitor

2021-01-25 Thread Marcel Holtmann
Hi Archie, > This series of patches manages the hardware offloading part of MSFT > extension API. The full documentation can be accessed by this link: > https://docs.microsoft.com/en-us/windows-hardware/drivers/bluetooth/microsoft-defined-bluetooth-hci-commands-and-events > > Only four of the HCI

Re: [PATCH v2] Bluetooth: btusb: fix memory leak on suspend and resume

2021-01-25 Thread Marcel Holtmann
Hi Vamshi, > kmemleak report: > unreferenced object 0x9b1127f00500 (size 208): > comm "kworker/u17:2", pid 500, jiffies 4294937470 (age 580.136s) > hex dump (first 32 bytes): >00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >00 60 ed 05 11 9b ff ff 00 00 00 00 00 00

Re: [PATCH v5 trivial/resend] dt-bindings: net: btusb: DT fix s/interrupt-name/interrupt-names/

2021-01-25 Thread Marcel Holtmann
Hi Geert, > The standard DT property name is "interrupt-names". > > Fixes: fd913ef7ce619467 ("Bluetooth: btusb: Add out-of-band wakeup support") > Signed-off-by: Geert Uytterhoeven > Acked-by: Rob Herring > Reviewed-by: Brian Norris > Acked-by: Rajat Jain > --- > Who takes this patch, before

Re: [PATCH] Bluetooth: drop HCI device reference before return

2021-01-25 Thread Marcel Holtmann
Hi Pan, > Call hci_dev_put() to decrement reference count of HCI device hdev if > fails to duplicate memory. > > Fixes: 0b26ab9dce74 ("Bluetooth: AMP: Handle Accept phylink command status > evt") > Signed-off-by: Pan Bian > --- > net/bluetooth/a2mp.c | 1 + > 1 file changed, 1 insertion(+) patc

Re: [PATCH] Bluetooth: avoid u128_xor() on potentially misaligned inputs

2021-01-05 Thread Marcel Holtmann
Hi Ard, > u128_xor() takes pointers to quantities that are assumed to be at least > 64-bit aligned, which is not guaranteed to be the case in the smp_c1() > routine. So switch to crypto_xor() instead. > > Signed-off-by: Ard Biesheuvel > --- > net/bluetooth/smp.c | 5 ++--- > 1 file changed, 2 ins

Re: [PATCH v3 4/5] Bluetooth: advmon offload MSFT handle controller reset

2020-12-22 Thread Marcel Holtmann
Hi Archie, >>> When the controller is powered off, the registered advertising monitor >>> is removed from the controller. This patch handles the re-registration >>> of those monitors when the power is on. >>> >>> Signed-off-by: Archie Pusaka >>> Reviewed-by: Miao-chen Chou >>> Reviewed-by: Yun-

Re: [PATCH v3 4/5] Bluetooth: advmon offload MSFT handle controller reset

2020-12-21 Thread Marcel Holtmann
Hi Archie, > When the controller is powered off, the registered advertising monitor > is removed from the controller. This patch handles the re-registration > of those monitors when the power is on. > > Signed-off-by: Archie Pusaka > Reviewed-by: Miao-chen Chou > Reviewed-by: Yun-Hao Chung >

Re: [PATCH v3 2/5] Bluetooth: advmon offload MSFT add monitor

2020-12-21 Thread Marcel Holtmann
Hi Archie, > Enables advertising monitor offloading to the controller, if MSFT > extension is supported. The kernel won't adjust the monitor parameters > to match what the controller supports - that is the user space's > responsibility. > > This patch only manages the addition of monitors. Monito

Re: [PATCH v3 1/5] Bluetooth: advmon offload MSFT add rssi support

2020-12-21 Thread Marcel Holtmann
Hi Archie, > MSFT needs rssi parameter for monitoring advertisement packet, > therefore we should supply them from mgmt. This adds a new opcode > to add advertisement monitor with rssi parameters. > > Signed-off-by: Archie Pusaka > Reviewed-by: Manish Mandlik > Reviewed-by: Miao-chen Chou > Re

Re: [PATCH v2 1/4] Bluetooth: Keep MSFT ext info throughout a hci_dev's life cycle

2020-12-18 Thread Marcel Holtmann
Hi Miao-chen, > This moves msft_do_close() from hci_dev_do_close() to > hci_unregister_dev() to avoid clearing MSFT extension info. This also > avoids retrieving MSFT info upon every msft_do_open() if MSFT extension > has been initialized. what is the actual benefit of this? It is fundamentally

Re: [PATCH] Bluetooth: Pause service discovery for suspend

2020-12-18 Thread Marcel Holtmann
Hi Abhishek, > Just like MGMT_OP_START_DISCOVERY, we should reject > MGMT_OP_START_SERVICE_DISCOVERY with MGMT_STATUS_BUSY when we are paused > for suspend. > > Signed-off-by: Abhishek Pandit-Subedi > --- > On ChromeOS, we started getting reports of scanning failing after > resuming from suspend

Re: [PATCH 1/1] Bluetooth: Remove hci_req_le_suspend_config

2020-12-18 Thread Marcel Holtmann
Hi Abhishek, > Add a missing SUSPEND_SCAN_ENABLE in passive scan, remove the separate > function for configuring le scan during suspend and update the request > complete function to clear both enable and disable tasks. > > Fixes: dce0a4be8054 ("Bluetooth: Set missing suspend task bits") > Reviewe

Re: [PATCH v1 1/5] Bluetooth: advmon offload MSFT add rssi support

2020-12-07 Thread Marcel Holtmann
Hi Archie, > MSFT needs rssi parameter for monitoring advertisement packet, > therefore we should supply them from mgmt. > > Signed-off-by: Archie Pusaka > Reviewed-by: Miao-chen Chou > Reviewed-by: Yun-Hao Chung I don’t need any Reviewed-by if they are not c

Re: [PATCH v1] Bluetooth: Set missing suspend task bits

2020-12-04 Thread Marcel Holtmann
Hi Howard, > When suspending, mark SUSPEND_SCAN_ENABLE and SUSPEND_SCAN_DISABLE tasks > correctly when either classic or le scanning is modified. > > Signed-off-by: Abhishek Pandit-Subedi > Signed-off-by: Howard Chung > Reviewed-by: Alain Michaud > --- > > net/bluetooth/hci_request.c | 8

Re: [PATCH v1 1/5] Bluetooth: advmon offload MSFT add rssi support

2020-12-04 Thread Marcel Holtmann
Hi Archie, >>> MSFT needs rssi parameter for monitoring advertisement packet, >>> therefore we should supply them from mgmt. >>> >>> Signed-off-by: Archie Pusaka >>> Reviewed-by: Miao-chen Chou >>> Reviewed-by: Yun-Hao Chung >> >> I don’t need any Reviewed-by if they are not catching an obvio

Re: [PATCH v7 0/5] Bluetooth: Add new MGMT interface for advertising add

2020-12-03 Thread Marcel Holtmann
Hi Daniel, > This patch series defines the new two-call MGMT interface for adding > new advertising instances. Similarly to the hci advertising commands, a > mgmt call to set parameters is expected to be first, followed by a mgmt > call to set advertising data/scan response. The members of the > p

Re: [PATCH v1 1/5] Bluetooth: advmon offload MSFT add rssi support

2020-12-03 Thread Marcel Holtmann
Hi Archie, > MSFT needs rssi parameter for monitoring advertisement packet, > therefore we should supply them from mgmt. > > Signed-off-by: Archie Pusaka > Reviewed-by: Miao-chen Chou > Reviewed-by: Yun-Hao Chung I don’t need any Reviewed-by if they are not catching an obvious user API break

Re: [PATCH v11 2/5] Bluetooth: Handle system suspend resume case

2020-12-03 Thread Marcel Holtmann
Hi Howard, > This patch adds code to handle the system suspension during interleave > scan. The interleave scan will be canceled when the system is going to > sleep, and will be restarted after waking up. > > Signed-off-by: Howard Chung > Reviewed-by: Alain Michaud > Reviewed-by: Manish Mandlik

Re: [PATCH v11 3/5] Bluetooth: Handle active scan case

2020-12-03 Thread Marcel Holtmann
Hi Howard, > This patch adds code to handle the active scan during interleave > scan. The interleave scan will be canceled when users start active scan, > and it will be restarted after active scan stopped. > > Signed-off-by: Howard Chung > Reviewed-by: Alain Michaud > Reviewed-by: Manish Mandl

Re: [PATCH v11 4/5] Bluetooth: Refactor read default sys config for various types

2020-12-03 Thread Marcel Holtmann
Hi Howard, > Refactor read default system configuration function so that it's capable > of returning different types than u16 > > Signed-off-by: Howard Chung > --- > > (no changes since v8) > > Changes in v8: > - Update the commit title and message > > net/bluetooth/mgmt_config.c | 140 ++

Re: [PATCH v11 5/5] Bluetooth: Add toggle to switch off interleave scan

2020-12-03 Thread Marcel Holtmann
Hi Howard, > This patch add a configurable parameter to switch off the interleave > scan feature. > > Signed-off-by: Howard Chung > Reviewed-by: Alain Michaud > --- > > (no changes since v9) > > Changes in v9: > - Update and rename the macro TLV_GET_LE8 > > Changes in v7: > - Fix bt_dev_warn

Re: [PATCH v11 1/5] Bluetooth: Interleave with allowlist scan

2020-12-03 Thread Marcel Holtmann
Hi Howard, > This patch implements the interleaving between allowlist scan and > no-filter scan. It'll be used to save power when at least one monitor is > registered and at least one pending connection or one device to be > scanned for. > > The durations of the allowlist scan and the no-filter s

Re: [PATCH v6 0/5] Bluetooth: Add new MGMT interface for advertising add

2020-12-03 Thread Marcel Holtmann
Hi Daniel, > This patch series defines the new two-call MGMT interface for adding > new advertising instances. Similarly to the hci advertising commands, a > mgmt call to set parameters is expected to be first, followed by a mgmt > call to set advertising data/scan response. The members of the > p

Re: [PATCH v5 5/5] Bluetooth: Change MGMT security info CMD to be more generic

2020-11-25 Thread Marcel Holtmann
Hi Daniel, > For advertising, we wish to know the LE tx power capabilities of the > controller in userspace, so this patch edits the Security Info MGMT > command to be more generic, such that other various controller > capabilities can be included in the EIR data. This change also includes > the L

Re: [PATCH 0/3] Bluetooth: Power down controller when suspending

2020-11-25 Thread Marcel Holtmann
Hi Abhishek, >>> This patch series adds support for a quirk that will power down the >>> Bluetooth controller when suspending and power it back up when resuming. >>> >>> On Marvell SDIO Bluetooth controllers (SD8897 and SD8997), we are seeing >>> a large number of suspend failures with the follow

Re: [PATCH 1/2] bluetooth: hci_event: consolidate error paths in hci_phy_link_complete_evt()

2020-11-23 Thread Marcel Holtmann
Hi Sergey, >>> hci_phy_link_complete_evt() has several duplicate error paths -- consolidate >>> them, using the *goto* statements. >>> >>> Signed-off-by: Sergey Shtylyov >>> >>> --- >>> net/bluetooth/hci_event.c | 16 ++-- >>> 1 file changed, 6 insertions(+), 10 deletions(-) >> pat

Re: [PATCH net] Bluetooth: Fix potential null pointer dereference in create_le_conn_complete

2020-11-23 Thread Marcel Holtmann
Hi Wang, > The pointer 'conn' may be null. Before being used by > hci_connect_le_scan_cleanup(), The pointer 'conn' must be > checked whether it is null. > > Fixes: 28a667c9c279 ("Bluetooth: advertisement handling in new connect > procedure") > Reported-by: Hulk Robot > Signed-off-by: Wang Hai

Re: [PATCH] Bluetooth: sco: Fix crash when using BT_SNDMTU/BT_RCVMTU option

2020-11-23 Thread Marcel Holtmann
Hi Wei, > This commit add the invalid check for connected socket, without it will > causes the following crash due to sco_pi(sk)->conn being NULL: > > KASAN: null-ptr-deref in range [0x0050-0x0057] > CPU: 3 PID: 4284 Comm: test_sco Not tainted 5.10.0-rc3+ #1 > Hardware nam

Re: [PATCH 0/3] Bluetooth: Power down controller when suspending

2020-11-23 Thread Marcel Holtmann
Hi Abhishek, > This patch series adds support for a quirk that will power down the > Bluetooth controller when suspending and power it back up when resuming. > > On Marvell SDIO Bluetooth controllers (SD8897 and SD8997), we are seeing > a large number of suspend failures with the following log me

Re: [PATCH v9 5/6] Bluetooth: Refactor read default sys config for various types

2020-11-11 Thread Marcel Holtmann
Hi Howard, > Refactor read default system configuration function so that it's capable > of returning different types than u16 > > Signed-off-by: Howard Chung > --- > > (no changes since v8) > > Changes in v8: > - Update the commit title and message > > net/bluetooth/mgmt_config.c | 140 ++

Re: [PATCH v9 2/6] Bluetooth: Interleave with allowlist scan

2020-11-11 Thread Marcel Holtmann
Hi Howard, > This patch implements the interleaving between allowlist scan and > no-filter scan. It'll be used to save power when at least one monitor is > registered and at least one pending connection or one device to be > scanned for. > > The durations of the allowlist scan and the no-filter s

Re: [PATCH v9 1/6] Bluetooth: Replace BT_DBG with bt_dev_dbg in HCI request

2020-11-11 Thread Marcel Holtmann
Hi Howard, > This replaces the BT_DBG function to bt_dev_dbg as it is cleaner to show > the controller index in the debug message. > > Signed-off-by: Howard Chung > --- > > Changes in v9: > - Fix compile warning on patch 6/6 > > Changes in v8: > - Simplified logic in __hci_update_interleaved_s

Re: [PATCH 1/2] bluetooth: hci_event: consolidate error paths in hci_phy_link_complete_evt()

2020-11-11 Thread Marcel Holtmann
Hi Sergey, > hci_phy_link_complete_evt() has several duplicate error paths -- consolidate > them, using the *goto* statements. > > Signed-off-by: Sergey Shtylyov > > --- > net/bluetooth/hci_event.c | 16 ++-- > 1 file changed, 6 insertions(+), 10 deletions(-) patch has been applie

Re: [PATCH v2] Bluetooth: Enforce key size of 16 bytes on FIPS level

2020-11-11 Thread Marcel Holtmann
Hi Archie, > According to the spec Ver 5.2, Vol 3, Part C, Sec 5.2.2.8: > Device in security mode 4 level 4 shall enforce: > 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 k

Re: [PATCH v2] Bluetooth: Move force_bredr_smp debugfs into hci_debugfs_create_bredr

2020-11-09 Thread Marcel Holtmann
Hi Claire, > Avoid multiple attempts to create the debugfs entry, force_bredr_smp, > by moving it from the SMP registration to the BR/EDR controller init > section. hci_debugfs_create_bredr is only called when HCI_SETUP and > HCI_CONFIG is not set. > > Signed-off-by: Claire Chang > --- > v2: cor

Re: [PATCH] Bluetooth: Resume advertising after LE connection

2020-11-09 Thread Marcel Holtmann
Hi Daniel, > When an LE connection request is made, advertising is disabled and never > resumed. When a client has an active advertisement, this is disruptive. > This change adds resume logic for client-configured (non-directed) > advertisements after the connection attempt. > > The patch was tes

Re: [PATCH v7 4/5] mgmt: Add supports of variable length parameter in mgmt_config

2020-11-09 Thread Marcel Holtmann
Hi Howard, > This adds support of variable length parameter in mgmt_config. I don’t see how this commit message describes the change correctly. > > Signed-off-by: Howard Chung > --- > > (no changes since v1) > > net/bluetooth/mgmt_config.c | 140 +--- > 1 file

Re: [PATCH v7 2/5] Bluetooth: Handle system suspend resume case

2020-11-09 Thread Marcel Holtmann
Hi Howard, > This patch adds code to handle the system suspension during interleave > scan. The interleave scan will be canceled when the system is going to > sleep, and will be restarted after waking up. > > Commit-changes 5: > - Remove the change in hci_req_config_le_suspend_scan this does not

Re: [PATCH v7 1/5] Bluetooth: Interleave with allowlist scan

2020-11-09 Thread Marcel Holtmann
Hi Howard, > This patch implements the interleaving between allowlist scan and > no-filter scan. It'll be used to save power when at least one monitor is > registered and at least one pending connection or one device to be > scanned for. > > The durations of the allowlist scan and the no-filter s

Re: [Linux-kernel-mentees] [PATCH net v2] Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()

2020-11-09 Thread Marcel Holtmann
Hi Peilin, > `num_reports` is not being properly checked. A malformed event packet with > a large `num_reports` number makes hci_le_direct_adv_report_evt() read out > of bounds. Fix it. > > Cc: sta...@vger.kernel.org > Fixes: 2f010b55884e ("Bluetooth: Add support for handling LE Direct > Adverti

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-05 Thread Marcel Holtmann
Hi Greg, >>>>>>>>>>>>>> This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as >>>>>>>>>>>>>> it >>>>>>>>>>>>>> breaks all bluetooth connections on my machine

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-05 Thread Marcel Holtmann
Hi Greg, >>>>>>>>>>> This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as it >>>>>>>>>>> breaks all bluetooth connections on my machine. >>>>>>>>>>> >>>>>>>>>

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-05 Thread Marcel Holtmann
Hi Greg, >>>>>>>>> This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as it >>>>>>>>> breaks all bluetooth connections on my machine. >>>>>>>>> >>>>>>>>> Cc: Marcel Holtmann >

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-05 Thread Marcel Holtmann
Hi Greg, >>>>>>> This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as it >>>>>>> breaks all bluetooth connections on my machine. >>>>>>> >>>>>>> Cc: Marcel Holtmann >>>>>>

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-04 Thread Marcel Holtmann
Hi Greg, >>>>> This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as it >>>>> breaks all bluetooth connections on my machine. >>>>> >>>>> Cc: Marcel Holtmann >>>>> Cc: Sathish Narsimman >>>>

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-03 Thread Marcel Holtmann
Hi Greg, >>> This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as it >>> breaks all bluetooth connections on my machine. >>> >>> Cc: Marcel Holtmann >>> Cc: Sathish Narsimman >>> Fixes: 0eee35bdfa3b ("Bluetooth: Update reso

Re: [PATCH] Revert "Bluetooth: Update resolving list when updating whitelist"

2020-10-03 Thread Marcel Holtmann
Hi Greg, > This reverts commit 0eee35bdfa3b472cc986ecc6ad76293fdcda59e2 as it > breaks all bluetooth connections on my machine. > > Cc: Marcel Holtmann > Cc: Sathish Narsimman > Fixes: 0eee35bdfa3b ("Bluetooth: Update resolving list when updating > whitelist&quo

Re: [PATCH v3] Bluetooth: Check for encryption key size on connect

2020-10-01 Thread Marcel Holtmann
Hi Archie, > When receiving connection, we only check whether the link has been > encrypted, but not the encryption key size of the link. > > This patch adds check for encryption key size, and reject L2CAP > connection which size is below the specified thre

Re: [PATCH] net: bluetooth: Fix null pointer dereference in hci_event_packet()

2020-10-01 Thread Marcel Holtmann
Hi Anmol, > AMP_MGR is getting derefernced in hci_phy_link_complete_evt(), when called > from hci_event_packet() and there is a possibility, that hcon->amp_mgr may > not be found when accessing after initialization of hcon. > > - net/bluetooth/hci_event.c:4945 > The bug seems to get triggered i

Re: Removal of HCI commands, userspace bluetooth regression?

2020-09-30 Thread Marcel Holtmann
Hi Greg, I wrote a simple script "sco_features.pl" which show all supported codecs by local HCI bluetooth adapter. Script is available at: https://github.com/pali/hsphfpd-prototype/blob/prototype/sco_features.pl And I found out that OCF_READ_

Re: [PATCH v3] Bluetooth: Check for encryption key size on connect

2020-09-28 Thread Marcel Holtmann
Hi Archie, >>> When receiving connection, we only check whether the link has been >>> encrypted, but not the encryption key size of the link. >>> >>> This patch adds check for encryption key size, and reject L2CAP >>> connection which size is below the specified threshold (def

Re: [PATCH v3] Bluetooth: Check for encryption key size on connect

2020-09-28 Thread Marcel Holtmann
Hi Archie, > When receiving connection, we only check whether the link has been > encrypted, but not the encryption key size of the link. > > This patch adds check for encryption key size, and reject L2CAP > connection which size is below the specified threshold (default 7) >>

Re: [PATCH v3] Bluetooth: Check for encryption key size on connect

2020-09-27 Thread Marcel Holtmann
Hi Archie, >>> When receiving connection, we only check whether the link has been >>> encrypted, but not the encryption key size of the link. >>> >>> This patch adds check for encryption key size, and reject L2CAP >>> connection which size is below the specified threshold (default 7) >>> with sec

Re: [PATCH v5 4/4] Bluetooth: Add toggle to switch off interleave scan

2020-09-25 Thread Marcel Holtmann
Hi Howard, > This patch add a configurable parameter to switch off the interleave > scan feature. > > Signed-off-by: Howard Chung > Reviewed-by: Alain Michaud > --- > > (no changes since v4) > > Changes in v4: > - Set EnableAdvMonInterleaveScan default to Disable > - Fix 80 chars limit in mgm

Re: [PATCH v3] Bluetooth: Check for encryption key size on connect

2020-09-25 Thread Marcel Holtmann
Hi Archie, > When receiving connection, we only check whether the link has been > encrypted, but not the encryption key size of the link. > > This patch adds check for encryption key size, and reject L2CAP > connection which size is below the specified threshold (default 7) > with security block.

Re: [PATCH v1] Bluetooth: Enforce key size of 16 bytes on FIPS level

2020-09-25 Thread Marcel Holtmann
Hi Archie, > According to the spec Ver 5.2, Vol 3, Part C, Sec 5.2.2.8: > Device in security mode 4 level 4 shall enforce: > 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 k

Re: [PATCH v1] Bluetooth: send proper config param to unknown config request

2020-09-25 Thread Marcel Holtmann
Hi Archie, > When receiving an L2CAP_CONFIGURATION_REQ with an unknown config > type, currently we will reply with L2CAP_CONFIGURATION_RSP with > a list of unknown types as the config param. However, this is not > a correct format of config param. > > As described in the bluetooth spec v5.2, Vol

Re: [PATCH v1] Bluetooth: Check for encryption key size on connect

2020-09-19 Thread Marcel Holtmann
Hi Archie, > When receiving connection, we only check whether the link has been > encrypted, but not the encryption key size of the link. > > This patch adds check for encryption key size, and reject L2CAP > connection which size is below the specified threshold (default 7) > with security block.

Re: [PATCH v3 3/6] Bluetooth: Interleave with allowlist scan

2020-09-19 Thread Marcel Holtmann
Hi Howard, > This patch implements the interleaving between allowlist scan and > no-filter scan. It'll be used to save power when at least one monitor is > registered and at least one pending connection or one device to be > scanned for. > > The durations of the allowlist scan and the no-filter s

Re: [PATCH v3 1/6] Bluetooth: Update Adv monitor count upon removal

2020-09-19 Thread Marcel Holtmann
Hi Howard, > This fixes the count of Adv monitor upon monitor removal. > > The following test was performed. > - Start two btmgmt consoles, issue a btmgmt advmon-remove command on one > console and observe a MGMT_EV_ADV_MONITOR_REMOVED event on the other. > > Signed-off-by: Miao-chen Chou > Sig

Re: [PATCH v3 2/6] Bluetooth: Set scan parameters for ADV Monitor

2020-09-19 Thread Marcel Holtmann
Hi Howard, > Set scan parameters when there is at least one Advertisement monitor. > > Signed-off-by: Howard Chung > Reviewed-by: Alain Michaud > Reviewed-by: Manish Mandlik > Reviewed-by: Abhishek Pandit-Subedi > Reviewed-by: Miao-chen Chou > --- > > (no changes since v1) > > net/bluetoot

Re: [PATCH] Bluetooth: pause/resume advertising around suspend

2020-09-16 Thread Marcel Holtmann
Hi Daniel, > Currently, the controller will continue advertising when the system > enters suspend. This patch makes sure that all advertising instances are > paused when entering suspend, and resumed when suspend exits. > > The Advertising and Suspend/Resume test suites were both run on this > ch

Re: [PATCH v2 0/3] Bluetooth: Emit events for suspend/resume

2020-09-13 Thread Marcel Holtmann
Hi Abhishek, > This series adds the suspend/resume events suggested in > https://patchwork.kernel.org/patch/11771001/. > > I have tested it with some userspace changes that monitors the > controller resumed event to trigger audio device reconnection and > verified that the events are correctly em

Re: [RESEND PATCH] bluetooth: Set ext scan response only when it exists

2020-09-13 Thread Marcel Holtmann
Hi Abhishek, > Only set extended scan response only when it exists. Otherwise, clear > the scan response data. > > Per the core spec v5.2, Vol 4, Part E, 7.8.55 > > If the advertising set is non-scannable and the Host uses this command > other than to discard existing data, the Controller shall

Re: [RESEND PATCH] Bluetooth: Only mark socket zapped after unlocking

2020-09-13 Thread Marcel Holtmann
Hi Abhishek, > 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 complete before marking the socket as zapped. > > This race was reprodu

Re: [PATCH 0/3] Bluetooth: Emit events for suspend/resume

2020-09-11 Thread Marcel Holtmann
Hi Abhishek, > This series adds the suspend/resume events suggested in > https://patchwork.kernel.org/patch/11663455/. > > I have tested it with some userspace changes that monitors the > controller resumed event to trigger audio device reconnection and > verified that the events are correctly em

Re: [PATCH 0/2] Bluetooth: Report extended adv capabilities to userspace

2020-09-11 Thread Marcel Holtmann
Hi Daniel, > This series improves the kernel/controller support that is reported > to userspace for the following extended advertising features: > > 1. If extended advertising is available, the number of hardware slots > is used and reported, rather than the fixed default of 5. If no hardware > s

Re: [PATCH v3 2/2] Bluetooth: sco: new getsockopt options BT_SNDMTU/BT_RCVMTU

2020-09-11 Thread Marcel Holtmann
Hi Joseph, > This patch defines new getsockopt options BT_SNDMTU/BT_RCVMTU > for SCO socket to be compatible with other bluetooth sockets. > These new options return the same value as option SCO_OPTIONS > which is already present on existing kernels. > > Reviewed-by: Alain Michaud > Reviewed-by:

  1   2   3   4   5   >