array-bounds fixes for 5.14-rc3

Hi Linus,
 
 Please, pull the following patch that fixes a couple of out-of-bounds
 warnings in the media subsystem. This is part of the ongoing efforts
 to globally enable -Warray-bounds.
 
 Thanks!
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkmRahXBSurMIg1YvRwW0y0cG2zEFAmD52/kACgkQRwW0y0cG
 2zHH7hAAxTMovB7VvNaz9henptY7q/1rY4GeDxfilUTCD8mmL7f/ZSqEOm/IR9tD
 jrx1Kolz4rM4kJmctglmBTSGjPTL6nVeyCBxb3c7seT0n88mSACPiz6B9dVqv+/x
 UzDgVoZ14jAbpnejBylifuZ8QeogWQKYEPeiqSCthUUrf1VgVOtZcJ0XkmOC4Hcz
 XoANihmwxGelpjkJRbYAz2dxC/IP83gxT36Jqvqjnz9OQFwpSFfuJxG6hSYu9WsT
 MFf7Tq9FcZ2SPrFLvkPhrmQ0lVs1ilNeV5CoqJOlQTEyV3IwAusmS0Jv7Nzx0FsF
 gyKQwQdH+DNibPtfIYDG66enDuiTqlf6PIqDj4fSXIaQX7wG3E/LNjhFbP9I4bIw
 qXlsudXZcAPggRbQHFMcMH2vXA1VHm8+7zwrH6QFzYy1itKC7xB5mIqMb4HI1x1x
 +reAbW07JG/h4ZqeKxlEbyPLhVmA+5vWDmuQb6m+4Zjpo9EtEACoMBjBEh1h3781
 GVD87X3nI9H1QDoQw5cPaewy20dmjBOffsPjMFCsyH7XnUYxu48zybqsuKueRmYy
 maEQz1MGsoGW6NZmwzypV4uQemeLWQe6HypulP/bFla3JmTd1zfPCvAVTXQkYYrG
 iNfHVyl2jb7PCp9m7xnpasT2hd7b1i058A+QQWklxzgVTttEkP4=
 =JRnb
 -----END PGP SIGNATURE-----

Merge tag 'array-bounds-fixes-5.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux

Pull array bounds warning fix from Gustavo Silva:
 "Fix a couple of out-of-bounds warnings in the media subsystem.

  This is part of the ongoing efforts to globally enable -Warray-bounds"

* tag 'array-bounds-fixes-5.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
  media: ngene: Fix out-of-bounds bug in ngene_command_config_free_buf()
This commit is contained in:
Linus Torvalds 2021-07-22 14:38:28 -07:00
commit 9bead1b58c
2 changed files with 9 additions and 7 deletions

View File

@ -385,7 +385,7 @@ static int ngene_command_config_free_buf(struct ngene *dev, u8 *config)
com.cmd.hdr.Opcode = CMD_CONFIGURE_FREE_BUFFER;
com.cmd.hdr.Length = 6;
memcpy(&com.cmd.ConfigureBuffers.config, config, 6);
memcpy(&com.cmd.ConfigureFreeBuffers.config, config, 6);
com.in_len = 6;
com.out_len = 0;

View File

@ -407,12 +407,14 @@ enum _BUFFER_CONFIGS {
struct FW_CONFIGURE_FREE_BUFFERS {
struct FW_HEADER hdr;
u8 UVI1_BufferLength;
u8 UVI2_BufferLength;
u8 TVO_BufferLength;
u8 AUD1_BufferLength;
u8 AUD2_BufferLength;
u8 TVA_BufferLength;
struct {
u8 UVI1_BufferLength;
u8 UVI2_BufferLength;
u8 TVO_BufferLength;
u8 AUD1_BufferLength;
u8 AUD2_BufferLength;
u8 TVA_BufferLength;
} __packed config;
} __attribute__ ((__packed__));
struct FW_CONFIGURE_UART {