All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: net: phy: in112525: fix out of bounds write
@ 2021-09-02 11:44 Cosmin-Florin Aluchenesei
  2021-09-05 13:48 ` Ramon Fried
  0 siblings, 1 reply; 2+ messages in thread
From: Cosmin-Florin Aluchenesei @ 2021-09-02 11:44 UTC (permalink / raw)
  To: joe.hershberger, rfried.dev
  Cc: ioana.ciornei, u-boot, Cosmin-Florin Aluchenesei

Changed declarations of line_temp, reg_addr and reg_data arrays in order to
avoid out-of-bounds write which may be caused by the following writing:
line_temp[column_cnt] = '\0'; (Increased size from 80 to 81).

Signed-off-by: Cosmin-Florin Aluchenesei <aluchenesei.cosmin-florin@nxp.com>
---
 drivers/net/phy/in112525.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/in112525.c b/drivers/net/phy/in112525.c
index 2ce1ab1195..e286fa8f14 100644
--- a/drivers/net/phy/in112525.c
+++ b/drivers/net/phy/in112525.c
@@ -224,9 +224,9 @@ struct phy_device *inphi_phydev;
 
 int in112525_upload_firmware(struct phy_device *phydev)
 {
-	char line_temp[0x50] = {0};
-	char reg_addr[0x50] = {0};
-	char reg_data[0x50] = {0};
+	char line_temp[0x51] = {0};
+	char reg_addr[0x51] = {0};
+	char reg_data[0x51] = {0};
 	int i, line_cnt = 0, column_cnt = 0;
 	struct in112525_reg_config fw_temp;
 	char *addr = NULL;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: net: phy: in112525: fix out of bounds write
  2021-09-02 11:44 [PATCH] drivers: net: phy: in112525: fix out of bounds write Cosmin-Florin Aluchenesei
@ 2021-09-05 13:48 ` Ramon Fried
  0 siblings, 0 replies; 2+ messages in thread
From: Ramon Fried @ 2021-09-05 13:48 UTC (permalink / raw)
  To: Cosmin-Florin Aluchenesei
  Cc: Joe Hershberger, ioana.ciornei, U-Boot Mailing List

On Thu, Sep 2, 2021 at 2:44 PM Cosmin-Florin Aluchenesei
<aluchenesei.cosmin-florin@nxp.com> wrote:
>
> Changed declarations of line_temp, reg_addr and reg_data arrays in order to
> avoid out-of-bounds write which may be caused by the following writing:
> line_temp[column_cnt] = '\0'; (Increased size from 80 to 81).
>
> Signed-off-by: Cosmin-Florin Aluchenesei <aluchenesei.cosmin-florin@nxp.com>
> ---
>  drivers/net/phy/in112525.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/phy/in112525.c b/drivers/net/phy/in112525.c
> index 2ce1ab1195..e286fa8f14 100644
> --- a/drivers/net/phy/in112525.c
> +++ b/drivers/net/phy/in112525.c
> @@ -224,9 +224,9 @@ struct phy_device *inphi_phydev;
>
>  int in112525_upload_firmware(struct phy_device *phydev)
>  {
> -       char line_temp[0x50] = {0};
> -       char reg_addr[0x50] = {0};
> -       char reg_data[0x50] = {0};
> +       char line_temp[0x51] = {0};
> +       char reg_addr[0x51] = {0};
> +       char reg_data[0x51] = {0};
>         int i, line_cnt = 0, column_cnt = 0;
>         struct in112525_reg_config fw_temp;
>         char *addr = NULL;
> --
> 2.21.0
>
We don't have such a driver in U-boot upstream master, which tree are
you using ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-05 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 11:44 [PATCH] drivers: net: phy: in112525: fix out of bounds write Cosmin-Florin Aluchenesei
2021-09-05 13:48 ` Ramon Fried

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.