mbox series

[BlueZ,v2,00/20] Fix a number of static analysis issues

Message ID 20240510121355.3241456-1-hadess@hadess.net
Headers show
Series Fix a number of static analysis issues | expand

Message

Bastien Nocera May 10, 2024, 12:10 p.m. UTC
Changes since v1:
- added 6 patches
- Fix syntax error in "client/gatt: Check write_value() retval"

Bastien Nocera (20):
  adapter: Use false instead of 0 for bool
  attrib/gatt: Guard against possible integer overflow
  client/gatt: Don't pass negative fd on error
  client/gatt: Check write_value() retval
  client/main: Fix array access
  client/main: Fix mismatched free
  monitor/att: Fix memory leak
  bap: Fix memory leaks
  media: Fix memory leak
  main: Fix memory leaks
  isotest: Consider "0" fd to be valid
  isotest: Fix error check after opening file
  client/player: Fix copy/paste error
  shared/vcp: Fix copy/paste error
  isotest: Fix fd leak
  iso-tester: Fix fd leak
  sdp: Fix use of uninitialised memory
  monitor: Work-around memory leak warning
  avrcp: Fix uninitialised memory usage
  main: Simplify variable assignment

 attrib/gatt.c          |  8 ++++---
 client/gatt.c          | 21 +++++++++++++++----
 client/main.c          |  7 ++++++-
 client/player.c        |  2 +-
 lib/sdp.c              |  2 +-
 monitor/att.c          | 19 +++++++++++++++++
 monitor/jlink.c        |  3 ++-
 profiles/audio/avrcp.c | 10 ++++-----
 profiles/audio/bap.c   | 47 +++++++++++++++++++++++++++++-------------
 profiles/audio/media.c |  1 +
 src/adapter.c          |  2 +-
 src/main.c             | 16 +++++++-------
 src/shared/vcp.c       |  2 +-
 tools/iso-tester.c     |  1 +
 tools/isotest.c        |  6 ++++--
 15 files changed, 104 insertions(+), 43 deletions(-)

Comments

patchwork-bot+bluetooth@kernel.org May 10, 2024, 3:40 p.m. UTC | #1
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri, 10 May 2024 14:10:10 +0200 you wrote:
> Changes since v1:
> - added 6 patches
> - Fix syntax error in "client/gatt: Check write_value() retval"
> 
> Bastien Nocera (20):
>   adapter: Use false instead of 0 for bool
>   attrib/gatt: Guard against possible integer overflow
>   client/gatt: Don't pass negative fd on error
>   client/gatt: Check write_value() retval
>   client/main: Fix array access
>   client/main: Fix mismatched free
>   monitor/att: Fix memory leak
>   bap: Fix memory leaks
>   media: Fix memory leak
>   main: Fix memory leaks
>   isotest: Consider "0" fd to be valid
>   isotest: Fix error check after opening file
>   client/player: Fix copy/paste error
>   shared/vcp: Fix copy/paste error
>   isotest: Fix fd leak
>   iso-tester: Fix fd leak
>   sdp: Fix use of uninitialised memory
>   monitor: Work-around memory leak warning
>   avrcp: Fix uninitialised memory usage
>   main: Simplify variable assignment
> 
> [...]

Here is the summary with links:
  - [BlueZ,v2,01/20] adapter: Use false instead of 0 for bool
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d3fcc77f99da
  - [BlueZ,v2,02/20] attrib/gatt: Guard against possible integer overflow
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1e22fd9adbb3
  - [BlueZ,v2,03/20] client/gatt: Don't pass negative fd on error
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1ba9e5f21ca2
  - [BlueZ,v2,04/20] client/gatt: Check write_value() retval
    (no matching commit)
  - [BlueZ,v2,05/20] client/main: Fix array access
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f3f762b77b58
  - [BlueZ,v2,06/20] client/main: Fix mismatched free
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ab325450b0c2
  - [BlueZ,v2,07/20] monitor/att: Fix memory leak
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0b842fe9b1fe
  - [BlueZ,v2,08/20] bap: Fix memory leaks
    (no matching commit)
  - [BlueZ,v2,09/20] media: Fix memory leak
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3652e98d2bb6
  - [BlueZ,v2,10/20] main: Fix memory leaks
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=45d151ec8a0f
  - [BlueZ,v2,11/20] isotest: Consider "0" fd to be valid
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d30dc38b0425
  - [BlueZ,v2,12/20] isotest: Fix error check after opening file
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9a36f191aa78
  - [BlueZ,v2,13/20] client/player: Fix copy/paste error
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6f041df23ecf
  - [BlueZ,v2,14/20] shared/vcp: Fix copy/paste error
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=856353b254da
  - [BlueZ,v2,15/20] isotest: Fix fd leak
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3e03788ba80c
  - [BlueZ,v2,16/20] iso-tester: Fix fd leak
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c81f9320357b
  - [BlueZ,v2,17/20] sdp: Fix use of uninitialised memory
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=dc60ce0b460a
  - [BlueZ,v2,18/20] monitor: Work-around memory leak warning
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e5925dbb84fa
  - [BlueZ,v2,19/20] avrcp: Fix uninitialised memory usage
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=af2634ce0a62
  - [BlueZ,v2,20/20] main: Simplify variable assignment
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=87edbabf3956

You are awesome, thank you!
Luiz Augusto von Dentz May 10, 2024, 4:42 p.m. UTC | #2
Hi Bastien,

On Fri, May 10, 2024 at 11:48 AM <patchwork-bot+bluetooth@kernel.org> wrote:
>
> Hello:
>
> This series was applied to bluetooth/bluez.git (master)
> by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
>
> On Fri, 10 May 2024 14:10:10 +0200 you wrote:
> > Changes since v1:
> > - added 6 patches
> > - Fix syntax error in "client/gatt: Check write_value() retval"
> >
> > Bastien Nocera (20):
> >   adapter: Use false instead of 0 for bool
> >   attrib/gatt: Guard against possible integer overflow
> >   client/gatt: Don't pass negative fd on error
> >   client/gatt: Check write_value() retval
> >   client/main: Fix array access
> >   client/main: Fix mismatched free
> >   monitor/att: Fix memory leak
> >   bap: Fix memory leaks
> >   media: Fix memory leak
> >   main: Fix memory leaks
> >   isotest: Consider "0" fd to be valid
> >   isotest: Fix error check after opening file
> >   client/player: Fix copy/paste error
> >   shared/vcp: Fix copy/paste error
> >   isotest: Fix fd leak
> >   iso-tester: Fix fd leak
> >   sdp: Fix use of uninitialised memory
> >   monitor: Work-around memory leak warning
> >   avrcp: Fix uninitialised memory usage
> >   main: Simplify variable assignment
> >
> > [...]
>
> Here is the summary with links:
>   - [BlueZ,v2,01/20] adapter: Use false instead of 0 for bool
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d3fcc77f99da
>   - [BlueZ,v2,02/20] attrib/gatt: Guard against possible integer overflow
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1e22fd9adbb3
>   - [BlueZ,v2,03/20] client/gatt: Don't pass negative fd on error
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1ba9e5f21ca2
>   - [BlueZ,v2,04/20] client/gatt: Check write_value() retval
>     (no matching commit)
>   - [BlueZ,v2,05/20] client/main: Fix array access
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f3f762b77b58
>   - [BlueZ,v2,06/20] client/main: Fix mismatched free
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ab325450b0c2
>   - [BlueZ,v2,07/20] monitor/att: Fix memory leak
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0b842fe9b1fe
>   - [BlueZ,v2,08/20] bap: Fix memory leaks
>     (no matching commit)
>   - [BlueZ,v2,09/20] media: Fix memory leak
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3652e98d2bb6
>   - [BlueZ,v2,10/20] main: Fix memory leaks
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=45d151ec8a0f
>   - [BlueZ,v2,11/20] isotest: Consider "0" fd to be valid
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d30dc38b0425
>   - [BlueZ,v2,12/20] isotest: Fix error check after opening file
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9a36f191aa78
>   - [BlueZ,v2,13/20] client/player: Fix copy/paste error
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6f041df23ecf
>   - [BlueZ,v2,14/20] shared/vcp: Fix copy/paste error
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=856353b254da
>   - [BlueZ,v2,15/20] isotest: Fix fd leak
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3e03788ba80c
>   - [BlueZ,v2,16/20] iso-tester: Fix fd leak
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c81f9320357b
>   - [BlueZ,v2,17/20] sdp: Fix use of uninitialised memory
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=dc60ce0b460a
>   - [BlueZ,v2,18/20] monitor: Work-around memory leak warning
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e5925dbb84fa
>   - [BlueZ,v2,19/20] avrcp: Fix uninitialised memory usage
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=af2634ce0a62
>   - [BlueZ,v2,20/20] main: Simplify variable assignment
>     https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=87edbabf3956
>
> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html

Had to revert the last one since it was causing bluetoothd to crash at star.
Bastien Nocera May 14, 2024, 10:05 a.m. UTC | #3
On Fri, 2024-05-10 at 12:42 -0400, Luiz Augusto von Dentz wrote:
> Hi Bastien,
> 
> On Fri, May 10, 2024 at 11:48 AM <patchwork-bot+bluetooth@kernel.org>
> wrote:
> > 
> > Hello:
> > 
> > This series was applied to bluetooth/bluez.git (master)
> > by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
> > 
> > On Fri, 10 May 2024 14:10:10 +0200 you wrote:
> > > Changes since v1:
> > > - added 6 patches
> > > - Fix syntax error in "client/gatt: Check write_value() retval"
> > > 
> > > Bastien Nocera (20):
> > >   adapter: Use false instead of 0 for bool
> > >   attrib/gatt: Guard against possible integer overflow
> > >   client/gatt: Don't pass negative fd on error
> > >   client/gatt: Check write_value() retval
> > >   client/main: Fix array access
> > >   client/main: Fix mismatched free
> > >   monitor/att: Fix memory leak
> > >   bap: Fix memory leaks
> > >   media: Fix memory leak
> > >   main: Fix memory leaks
> > >   isotest: Consider "0" fd to be valid
> > >   isotest: Fix error check after opening file
> > >   client/player: Fix copy/paste error
> > >   shared/vcp: Fix copy/paste error
> > >   isotest: Fix fd leak
> > >   iso-tester: Fix fd leak
> > >   sdp: Fix use of uninitialised memory
> > >   monitor: Work-around memory leak warning
> > >   avrcp: Fix uninitialised memory usage
> > >   main: Simplify variable assignment
> > > 
> > > [...]
> > 
> > Here is the summary with links:
> >   - [BlueZ,v2,01/20] adapter: Use false instead of 0 for bool
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d3fcc77f99da
> >   - [BlueZ,v2,02/20] attrib/gatt: Guard against possible integer
> > overflow
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1e22fd9adbb3
> >   - [BlueZ,v2,03/20] client/gatt: Don't pass negative fd on error
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1ba9e5f21ca2
> >   - [BlueZ,v2,04/20] client/gatt: Check write_value() retval
> >     (no matching commit)
> >   - [BlueZ,v2,05/20] client/main: Fix array access
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=f3f762b77b58
> >   - [BlueZ,v2,06/20] client/main: Fix mismatched free
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ab325450b0c2
> >   - [BlueZ,v2,07/20] monitor/att: Fix memory leak
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0b842fe9b1fe
> >   - [BlueZ,v2,08/20] bap: Fix memory leaks
> >     (no matching commit)
> >   - [BlueZ,v2,09/20] media: Fix memory leak
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3652e98d2bb6
> >   - [BlueZ,v2,10/20] main: Fix memory leaks
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=45d151ec8a0f
> >   - [BlueZ,v2,11/20] isotest: Consider "0" fd to be valid
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=d30dc38b0425
> >   - [BlueZ,v2,12/20] isotest: Fix error check after opening file
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9a36f191aa78
> >   - [BlueZ,v2,13/20] client/player: Fix copy/paste error
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6f041df23ecf
> >   - [BlueZ,v2,14/20] shared/vcp: Fix copy/paste error
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=856353b254da
> >   - [BlueZ,v2,15/20] isotest: Fix fd leak
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=3e03788ba80c
> >   - [BlueZ,v2,16/20] iso-tester: Fix fd leak
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c81f9320357b
> >   - [BlueZ,v2,17/20] sdp: Fix use of uninitialised memory
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=dc60ce0b460a
> >   - [BlueZ,v2,18/20] monitor: Work-around memory leak warning
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e5925dbb84fa
> >   - [BlueZ,v2,19/20] avrcp: Fix uninitialised memory usage
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=af2634ce0a62
> >   - [BlueZ,v2,20/20] main: Simplify variable assignment
> >    
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=87edbabf3956
> > 
> > You are awesome, thank you!
> > --
> > Deet-doot-dot, I am a bot.
> > https://korg.docs.kernel.org/patchwork/pwbot.html
> 
> Had to revert the last one since it was causing bluetoothd to crash
> at star.

Thanks very much!

I should have at least mildly tested the resulting builds, my fault, I
also misunderstood what this portion of code did. I've made another
attempt at fixing this issue, and will be submitting more bug fixes in
the near future.

Cheers

>