Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Kumar, M Chetan" <m.chetan.kumar@intel.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Solomon Ucko <solly.ucko@gmail.com>
Cc: linuxwwan <linuxwwan@intel.com>,
Loic Poulain <loic.poulain@linaro.org>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
"Jakub Kicinski" <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"security@kernel.org" <security@kernel.org>
Subject: RE: [PATCH v2 net] net: iosm: Prevent underflow in ipc_chnl_cfg_get()
Date: Mon, 16 Aug 2021 12:17:19 +0000 [thread overview]
Message-ID: <SJ0PR11MB50083A086BDACD9B169F40A8D7FD9@SJ0PR11MB5008.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210816111333.GE7722@kadam>
> -----Original Message-----
> From: Dan Carpenter <dan.carpenter@oracle.com>
> Sent: Monday, August 16, 2021 4:44 PM
> To: Kumar, M Chetan <m.chetan.kumar@intel.com>; Solomon Ucko
> <solly.ucko@gmail.com>
> Cc: linuxwwan <linuxwwan@intel.com>; Loic Poulain
> <loic.poulain@linaro.org>; Sergey Ryazanov <ryazanov.s.a@gmail.com>;
> Johannes Berg <johannes@sipsolutions.net>; David S. Miller
> <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>;
> netdev@vger.kernel.org; security@kernel.org
> Subject: [PATCH v2 net] net: iosm: Prevent underflow in ipc_chnl_cfg_get()
>
> The bounds check on "index" doesn't catch negative values. Using
> ARRAY_SIZE() directly is more readable and more robust because it prevents
> negative values for "index". Fortunately we only pass valid values to
> ipc_chnl_cfg_get() so this patch does not affect runtime.
>
>
> Reported-by: Solomon Ucko <solly.ucko@gmail.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: Remove underscore between "array" and "size".
> Use %zu print format specifier to fix a compile warning on 32 bit.
>
> drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
Reviewed-by: M Chetan Kumar <m.chetan.kumar@intel.com>
next prev parent reply other threads:[~2021-08-16 12:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CANtMP6qvcE+u61+HUyEFNu15kQ02a1P5_mGRSHuyeCxkf4pQbA@mail.gmail.com>
2021-08-16 9:26 ` [PATCH " Dan Carpenter
2021-08-16 10:48 ` Kumar, M Chetan
2021-08-16 11:13 ` [PATCH v2 " Dan Carpenter
2021-08-16 12:17 ` Kumar, M Chetan [this message]
2021-08-16 12:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR11MB50083A086BDACD9B169F40A8D7FD9@SJ0PR11MB5008.namprd11.prod.outlook.com \
--to=m.chetan.kumar@intel.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=ryazanov.s.a@gmail.com \
--cc=security@kernel.org \
--cc=solly.ucko@gmail.com \
--subject='RE: [PATCH v2 net] net: iosm: Prevent underflow in ipc_chnl_cfg_get()' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).