All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only
@ 2024-03-28 14:03 shaibran
  2024-03-28 14:03 ` [PATCH v2 1/1] net/ena/base: fix metrics excessive memory consumption shaibran
  2024-03-28 14:22 ` [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only Brandes, Shai
  0 siblings, 2 replies; 5+ messages in thread
From: shaibran @ 2024-03-28 14:03 UTC (permalink / raw)
  To: ferruh.yigit, bluca, christian.ehrhardt, xuemingl, ktraynor
  Cc: stable, dev, Shai Brandes

From: Shai Brandes <shaibran@amazon.com>

Hi, the fix is for a bug that was introduced in 23.11.
The fix was already merged into 24.03 indirectly as part of c8a1898f82f8 ("net/ena: improve style and readability")
and the entire function was later restructured in patch bcb1753156ac ("net/ena/base: modify customer metrics memory management")
Meaning, this issue is indirectly fixed going forward, but we need to introduce a dedicated fix for 23.11 stable only.
I CC'ed also dev mailing list since this involves Bugzilla bug fix.
Sorry in advance in case this is not the correct procedure. 

All the best,
Shai

Shai Brandes (1):
  net/ena/base: fix metrics excessive memory consumption

 drivers/net/ena/base/ena_com.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.17.1


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

* [PATCH v2 1/1] net/ena/base: fix metrics excessive memory consumption
  2024-03-28 14:03 [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only shaibran
@ 2024-03-28 14:03 ` shaibran
  2024-03-28 14:22 ` [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only Brandes, Shai
  1 sibling, 0 replies; 5+ messages in thread
From: shaibran @ 2024-03-28 14:03 UTC (permalink / raw)
  To: ferruh.yigit, bluca, christian.ehrhardt, xuemingl, ktraynor
  Cc: stable, dev, Shai Brandes

From: Shai Brandes <shaibran@amazon.com>

The driver accidentally allocates a huge memory
buffer for the customer metrics because it uses
an uninitialized variable for the buffer length.
This can lead to excessive memory footprint for
the driver which can even fail to initialize in
case of insufficient memory.

Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
Fixes: f73f53f7dc7a ("net/ena: upgrade HAL")
Bugzilla ID: 1400
---
 drivers/net/ena/base/ena_com.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 6953a1fa33..8ae7dcf48e 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -3134,16 +3134,18 @@ int ena_com_allocate_debug_area(struct ena_com_dev *ena_dev,
 int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev)
 {
 	struct ena_customer_metrics *customer_metrics = &ena_dev->customer_metrics;
+	customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
+	customer_metrics->buffer_virt_addr = NULL;
 
 	ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev,
 			       customer_metrics->buffer_len,
 			       customer_metrics->buffer_virt_addr,
 			       customer_metrics->buffer_dma_addr,
 			       customer_metrics->buffer_dma_handle);
-	if (unlikely(customer_metrics->buffer_virt_addr == NULL))
+	if (unlikely(customer_metrics->buffer_virt_addr == NULL)) {
+		customer_metrics->buffer_len = 0;
 		return ENA_COM_NO_MEM;
-
-	customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
+	}
 
 	return 0;
 }
-- 
2.17.1


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

* RE: [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only
  2024-03-28 14:03 [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only shaibran
  2024-03-28 14:03 ` [PATCH v2 1/1] net/ena/base: fix metrics excessive memory consumption shaibran
@ 2024-03-28 14:22 ` Brandes, Shai
  2024-03-28 14:29   ` Luca Boccassi
  1 sibling, 1 reply; 5+ messages in thread
From: Brandes, Shai @ 2024-03-28 14:22 UTC (permalink / raw)
  To: Brandes, Shai, ferruh.yigit, bluca, christian.ehrhardt, xuemingl,
	ktraynor
  Cc: stable, dev

Sorry, for some reason this appears on the wrong branch
I will fix this and upload a new patch

> -----Original Message-----
> From: shaibran@amazon.com <shaibran@amazon.com>
> Sent: Thursday, March 28, 2024 4:03 PM
> To: ferruh.yigit@amd.com; bluca@debian.org;
> christian.ehrhardt@canonical.com; xuemingl@nvidia.com;
> ktraynor@redhat.com
> Cc: stable@dpdk.org; dev@dpdk.org; Brandes, Shai
> <shaibran@amazon.com>
> Subject: [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only
> 
> From: Shai Brandes <shaibran@amazon.com>
> 
> Hi, the fix is for a bug that was introduced in 23.11.
> The fix was already merged into 24.03 indirectly as part of c8a1898f82f8
> ("net/ena: improve style and readability") and the entire function was later
> restructured in patch bcb1753156ac ("net/ena/base: modify customer
> metrics memory management") Meaning, this issue is indirectly fixed going
> forward, but we need to introduce a dedicated fix for 23.11 stable only.
> I CC'ed also dev mailing list since this involves Bugzilla bug fix.
> Sorry in advance in case this is not the correct procedure.
> 
> All the best,
> Shai
> 
> Shai Brandes (1):
>   net/ena/base: fix metrics excessive memory consumption
> 
>  drivers/net/ena/base/ena_com.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> --
> 2.17.1


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

* Re: [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only
  2024-03-28 14:22 ` [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only Brandes, Shai
@ 2024-03-28 14:29   ` Luca Boccassi
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Boccassi @ 2024-03-28 14:29 UTC (permalink / raw)
  To: Brandes, Shai
  Cc: ferruh.yigit, christian.ehrhardt, xuemingl, ktraynor, stable, dev

Please see https://core.dpdk.org/contribute/ for instructions on
sending patches for stable releases, otherwise they will be missed

On Thu, 28 Mar 2024 at 14:22, Brandes, Shai <shaibran@amazon.com> wrote:
>
> Sorry, for some reason this appears on the wrong branch
> I will fix this and upload a new patch
>
> > -----Original Message-----
> > From: shaibran@amazon.com <shaibran@amazon.com>
> > Sent: Thursday, March 28, 2024 4:03 PM
> > To: ferruh.yigit@amd.com; bluca@debian.org;
> > christian.ehrhardt@canonical.com; xuemingl@nvidia.com;
> > ktraynor@redhat.com
> > Cc: stable@dpdk.org; dev@dpdk.org; Brandes, Shai
> > <shaibran@amazon.com>
> > Subject: [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only
> >
> > From: Shai Brandes <shaibran@amazon.com>
> >
> > Hi, the fix is for a bug that was introduced in 23.11.
> > The fix was already merged into 24.03 indirectly as part of c8a1898f82f8
> > ("net/ena: improve style and readability") and the entire function was later
> > restructured in patch bcb1753156ac ("net/ena/base: modify customer
> > metrics memory management") Meaning, this issue is indirectly fixed going
> > forward, but we need to introduce a dedicated fix for 23.11 stable only.
> > I CC'ed also dev mailing list since this involves Bugzilla bug fix.
> > Sorry in advance in case this is not the correct procedure.
> >
> > All the best,
> > Shai
> >
> > Shai Brandes (1):
> >   net/ena/base: fix metrics excessive memory consumption
> >
> >  drivers/net/ena/base/ena_com.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > --
> > 2.17.1
>

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

* [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only
@ 2024-04-08 12:15 shaibran
  0 siblings, 0 replies; 5+ messages in thread
From: shaibran @ 2024-04-08 12:15 UTC (permalink / raw)
  To: ferruh.yigit, bluca, christian.ehrhardt, xuemingl, ktraynor
  Cc: stable, dev, Shai Brandes

From: Shai Brandes <shaibran@amazon.com>

Hi, the fix is for a bug that was introduced in 23.11.

The fix was already merged into 24.03 indirectly as part of c8a1898f82f8 ("net/ena: improve style and readability")
and the entire function was later restructured in patch bcb1753156ac ("net/ena/base: modify customer metrics memory management").

Meaning, this issue is indirectly fixed going forward, but we need to introduce a dedicated fix for 23.11 stable only.
I CC'ed also dev mailing list since this involves Bugzilla bug fix.

All the best,
Shai

---
v2:
* reordered the tags in the commit message

Shai Brandes (1):
  net/ena/base: fix metrics excessive memory consumption

 drivers/net/ena/base/ena_com.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2024-04-08 12:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 14:03 [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only shaibran
2024-03-28 14:03 ` [PATCH v2 1/1] net/ena/base: fix metrics excessive memory consumption shaibran
2024-03-28 14:22 ` [PATCH v2 0/1] net/ena/base: bug fix for 23.11 stable only Brandes, Shai
2024-03-28 14:29   ` Luca Boccassi
2024-04-08 12:15 shaibran

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.