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] 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 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 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 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 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 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 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 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 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 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 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 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 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-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 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-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 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] 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 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 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 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 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: [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 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: [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 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] 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 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 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 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 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 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 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] 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 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] 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: 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] 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 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 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] 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 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 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 -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: 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] 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 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] 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 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 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 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] 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] 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 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 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 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 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 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 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] 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 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 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: 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] 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: 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: 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: 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 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 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] 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: [RFC] net: Add new LoRaWAN subsystem

2018-05-11 Thread Marcel Holtmann
Hi Jian-Hong, > A Low-Power Wide-Area Network (LPWAN) is a type of wireless > telecommunication wide area network designed to allow long range > communications at a low bit rate among things (connected objects), such > as sensors operated on a battery. It can be used widely in IoT area. > LoRaWAN

Re: Bluetooth/lock_sock: false positive "WARNING: possible recursive locking detected"

2018-04-23 Thread Marcel Holtmann
Hi Jiri, >> [ 2891.586061] >> [ 2891.586063] WARNING: possible recursive locking detected >> [ 2891.586065] 4.16.2-10.ge881e16-default #1 Not tainted >> [ 2891.586067] >> [ 2891.586068] kworker/u9:3/873 is tr

Re: [PATCH] Bluetooth: use wait_event API instead of open-coding it

2018-04-23 Thread Marcel Holtmann
Hi John, > I've seen timeout errors from HCI commands where it looks like > schedule_timeout() has returned immediately; additional logging for the > error case gives: > > req_status=1 req_result=0 remaining=1 jiffies > > so the device is still in state HCI_REQ_PEND and the value retur

Re: pull request: bluetooth 2018-03-16

2018-03-20 Thread Marcel Holtmann
Hi Dave, >> any issue with this pull request? I ask since it seems to have >> disappeared from patchwork. > > Should be pulled in now, don't know how that happened ;-) awesome. Thanks. Any chance you can pull net into net-next once you send it off to Linus? We have a few further Broadcom drive

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-03-21 Thread Marcel Holtmann
Hi Gustavo, > In preparation to enabling -Wvla, remove VLA and replace it > with dynamic memory allocation instead. > > The use of stack Variable Length Arrays needs to be avoided, as they > can be a vector for stack exhaustion, which can be both a runtime bug > or a security flaw. Also, in gener

Re: [PATCH] 6lowpan: no need to check return value of debugfs_create functions

2019-07-06 Thread Marcel Holtmann
Hi Greg, > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Because we don't care if debugfs works or not, this trickles back a bit > so we can clean things

Re: [PATCH] Bluetooth: hidp: NUL terminate a string in the compat ioctl

2019-07-06 Thread Marcel Holtmann
Hi Dan, > This change is similar to commit a1616a5ac99e ("Bluetooth: hidp: fix > buffer overflow") but for the compat ioctl. We take a string from the > user and forgot to ensure that it's NUL terminated. > > I have also changed the strncpy() in to strscpy() in hidp_setup_hid(). > The difference

Re: [PATCH net-next 2/3 v4] net: arp: Add support for raw IP device

2017-08-15 Thread Marcel Holtmann
Hi Subash, > Define the raw IP type. This is needed for raw IP net devices > like rmnet. > > Signed-off-by: Subash Abhinov Kasiviswanathan > --- > include/uapi/linux/if_arp.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h > inde

Re: [PATCH] Bluetooth: make device_type const

2017-08-19 Thread Marcel Holtmann
Hi Bhumika, > Make these const as they are only stored in the type field of a device > structure, which is const. > Done using Coccinelle. > > Signed-off-by: Bhumika Goyal > --- > net/bluetooth/hci_sysfs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) patch has been applied to blue

Re: [PATCH] ieee802154: ca8210: Fix a potential NULL pointer dereference

2017-08-20 Thread Marcel Holtmann
Hi Christophe, > 'spi' is known to be NULL, so we dereference a NULL pointer here. > Use 'pr_crit()' instead of 'dev_crit()' to report the message. > > Signed-off-by: Christophe JAILLET > --- > drivers/net/ieee802154/ca8210.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions(-) patch has

Re: Stable apply request [was: Bluetooth: bnep: fix possible might sleep error in bnep_session]

2017-08-23 Thread Marcel Holtmann
Hi Jiri, >>> It looks like bnep_session has same pattern as the issue reported in >>> old rfcomm: >>> >>> while (1) { >>> set_current_state(TASK_INTERRUPTIBLE); >>> if (condition) >>> break; >>> // may call might_sleep here >>>

Re: [PATCH 3/7] ieee802154: 6lowpan: make header_ops const

2017-08-25 Thread Marcel Holtmann
Hi Bhumika, > Make this const as it is only stored as a reference in a const field of > a net_device structure. > > Signed-off-by: Bhumika Goyal > --- > net/ieee802154/6lowpan/core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) patch has been applied to bluetooth-next tree. Regards

Re: [PATCH][next] Bluetooth: mgmt: Use struct_size() helper

2019-02-26 Thread Marcel Holtmann
Hi Gustavo, > Make use of the struct_size() helper instead of an open-coded version > in order to avoid any potential type mistakes, in particular in the > context in which this code is being used. > > So, change the following form: > > sizeof(*rp) + (sizeof(rp->entry[0]) * count); > > to : >

Re: [PATCH v4 0/3] Add quirk for reading BD_ADDR from fwnode property

2019-02-26 Thread Marcel Holtmann
Hi Matthias, > On some systems the Bluetooth Device Address (BD_ADDR) isn't stored > on the Bluetooth chip itself. One way to configure the address is > through the device tree (patched in by the bootloader). The btqcomsmd > driver is an example, it can read the address from the DT property > 'loc

Re: [PATCH] net/bluetooth: Fix bound check in event handling

2019-03-02 Thread Marcel Holtmann
Hi Tomas, > hci_inquiry_result_with_rssi_evt() can perform out of bound reads > on skb->data as a bound check is missing. > > Signed-off-by: Tomas Bortoli > Reported-by: syzbot+cec7a50c412a2c03f...@syzkaller.appspotmail.com > Reported-by: syzbot+660883c56e2fa65d4...@syzkaller.appspotmail.com > -

Re: [PATCH 0/5] isdn: deprecate non-mISDN drivers

2019-04-24 Thread Marcel Holtmann
Hi Arnd, >>> When isdn4linux came up in the context of another patch series, I >>> remembered that we had discussed removing it a while ago. >> >> This seems long overdue to me. >> >> Could you please respin against net-next and I'll just apply this? > > Ok. I'll send a pull request then, which

Re: [PATCH 0/5] isdn: deprecate non-mISDN drivers

2019-04-24 Thread Marcel Holtmann
Hi Arnd, > When isdn4linux came up in the context of another patch series, I > remembered that we had discussed removing it a while ago. >> >> NAK. >> >> I do not care about isdn4linux, but this is a purely CAPI based driver. So >> removing (or moving to staging) >> CAPI support seems r

[PATCH] genetlink: use idr_alloc_cyclic for family->id assignment

2019-04-24 Thread Marcel Holtmann
When allocating the next family->id it makes more sense to use idr_alloc_cyclic to avoid re-using a previously used family->id as much as possible. Signed-off-by: Marcel Holtmann --- net/netlink/genetlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/n

Re: [PATCH 0/5] isdn: deprecate non-mISDN drivers

2019-04-25 Thread Marcel Holtmann
Hi Arnd, >>> When isdn4linux came up in the context of another patch series, I >>> remembered that we had discussed removing it a while ago. NAK. I do not care about isdn4linux, but this is a purely CAPI based driver. So removing (or moving to staging) CAPI

Re: [PATCH] Bluetooth: btrsi: rework dependencies

2018-03-15 Thread Marcel Holtmann
Hi Arnd, > The linkage between the bluetooth driver and the wireless > driver is not defined properly, leading to build problems > such as: > > warning: (BT_HCIRSI) selects RSI_COEX which has unmet direct dependencies > (NETDEVICES && WLAN && WLAN_VENDOR_RSI && BT_HCIRSI && RSI_91X) > drivers/ne

Re: [PATCH] Bluetooth: btrsi: rework dependencies

2018-03-15 Thread Marcel Holtmann
Hi Arnd, >>> diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile >>> index 03cfc1b20c4a..9e8d22712ff3 100644 >>> --- a/drivers/bluetooth/Makefile >>> +++ b/drivers/bluetooth/Makefile >>> @@ -28,7 +28,7 @@ obj-$(CONFIG_BT_QCA)+= btqca.o >>> >>> obj-$(CONFIG_BT_HCIU

Re: [PATCH] [v2] Bluetooth: btrsi: rework dependencies

2018-03-15 Thread Marcel Holtmann
etooth/Kconfig| 4 +--- > drivers/net/wireless/rsi/Kconfig | 4 +++- > 2 files changed, 4 insertions(+), 4 deletions(-) Acked-by: Marcel Holtmann Since I think Kalle still has to take it through his tree until the btrsi driver makes it into net-next. Regards Marcel

Re: pull request: bluetooth 2018-03-16

2018-03-20 Thread Marcel Holtmann
Hi Dave, > Here are a few more important Bluetooth driver fixes for the 4.16 > kernel. > > Please let me know if there are any issues pulling. Thanks. > > Johan > > --- > The following changes since commit 3d502067599f0db12e74e6646aee8728efe3e5be: > > net/smc: simplify wait when closing liste

Re: [PATCH] Bluetooth: Mark expected switch fall-throughs

2018-03-31 Thread Marcel Holtmann
Hi Gustavo, > In preparation to enabling -Wimplicit-fallthrough, mark switch cases > where we are expecting to fall through. > > Signed-off-by: Gustavo A. R. Silva > --- > net/bluetooth/mgmt.c| 1 + > net/bluetooth/rfcomm/sock.c | 1 + > 2 files changed, 2 insertions(+) patch has been app

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Marcel Holtmann
Hi Gustavo, > In preparation to enabling -Wvla, remove VLA and replace it > with dynamic memory allocation instead. > > The use of stack Variable Length Arrays needs to be avoided, as they > can be a vector for stack exhaustion, which can be both a runtime bug > or a security flaw. Also, in gener

Re: [PATCH v2] Bluetooth: Remove VLA usage in aes_cmac

2018-04-05 Thread Marcel Holtmann
Hi Gustavo, >> so I took this patch back out of bluetooth-next before sending the pull >> request. I think the discussion on how to fix SHASH_DESC_ON_STACK macro >> needs to complete first. Once that has concluded we can revisit if this >> patch is still needed or if another solution has been f

[PATCH] rtnetlink: expose value from SET_NETDEV_DEVTYPE via IFLA_DEVTYPE attribute

2018-08-28 Thread Marcel Holtmann
network managing daemons that have to classify ARPHRD_ETHER network devices into different types (like Wireless LAN, Bluetooth etc.), this avoids the extra round trip to sysfs and parsing of the uevent file. Signed-off-by: Marcel Holtmann --- include/uapi/linux/if_link.h | 2 ++ net/core

Re: [PATCH] rtnetlink: expose value from SET_NETDEV_DEVTYPE via IFLA_DEVTYPE attribute

2018-08-29 Thread Marcel Holtmann
ttribute included in the RTM_NEWLINK >> messages. >> >> For network managing daemons that have to classify ARPHRD_ETHER network >> devices into different types (like Wireless LAN, Bluetooth etc.), this >> avoids the extra round trip to sysfs and parsing of

  1   2   3   4   5   >