Stable Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 3.18.y] IB/mlx5: Fix leaking stack memory to userspace
@ 2019-08-12 10:48 Alessio Balsini
  2019-08-12 10:51 ` [PATCH 4.4.y] " Alessio Balsini
  0 siblings, 1 reply; 6+ messages in thread
From: Alessio Balsini @ 2019-08-12 10:48 UTC (permalink / raw)
  To: gregkh
  Cc: stable, linux-kernel, kernel-team, Jason Gunthorpe,
	Leon Romanovsky, Alessio Balsini

From: Jason Gunthorpe <jgg@mellanox.com>

mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes
were written.

Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp")
Cc: <stable@vger.kernel.org>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Alessio Balsini <balsini@android.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 5edb09e674a6..82c4e29c1213 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -811,7 +811,7 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
 			    struct ib_udata *udata, struct mlx5_ib_qp *qp)
 {
 	struct mlx5_ib_resources *devr = &dev->devr;
-	struct mlx5_ib_create_qp_resp resp;
+	struct mlx5_ib_create_qp_resp resp = {};
 	struct mlx5_create_qp_mbox_in *in;
 	struct mlx5_general_caps *gen;
 	struct mlx5_ib_create_qp ucmd;
-- 
2.23.0.rc1.153.gdeed80330f-goog


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

* [PATCH 4.4.y] IB/mlx5: Fix leaking stack memory to userspace
  2019-08-12 10:48 [PATCH 3.18.y] IB/mlx5: Fix leaking stack memory to userspace Alessio Balsini
@ 2019-08-12 10:51 ` " Alessio Balsini
  2019-08-12 10:55   ` [PATCH 4.9.y 4.14.y] " Alessio Balsini
  0 siblings, 1 reply; 6+ messages in thread
From: Alessio Balsini @ 2019-08-12 10:51 UTC (permalink / raw)
  To: gregkh
  Cc: stable, linux-kernel, kernel-team, Jason Gunthorpe,
	Leon Romanovsky, Alessio Balsini

From: Jason Gunthorpe <jgg@mellanox.com>

mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes
were written.

Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp")
Cc: <stable@vger.kernel.org>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Alessio Balsini <balsini@android.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 43d277a931c2..c035abfe8c55 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -865,7 +865,7 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
 {
 	struct mlx5_ib_resources *devr = &dev->devr;
 	struct mlx5_core_dev *mdev = dev->mdev;
-	struct mlx5_ib_create_qp_resp resp;
+	struct mlx5_ib_create_qp_resp resp = {};
 	struct mlx5_create_qp_mbox_in *in;
 	struct mlx5_ib_create_qp ucmd;
 	int inlen = sizeof(*in);
-- 
2.23.0.rc1.153.gdeed80330f-goog


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

* [PATCH 4.9.y 4.14.y] IB/mlx5: Fix leaking stack memory to userspace
  2019-08-12 10:51 ` [PATCH 4.4.y] " Alessio Balsini
@ 2019-08-12 10:55   ` " Alessio Balsini
  2019-08-12 14:23     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Alessio Balsini @ 2019-08-12 10:55 UTC (permalink / raw)
  To: gregkh
  Cc: stable, linux-kernel, kernel-team, Jason Gunthorpe,
	Leon Romanovsky, Alessio Balsini

From: Jason Gunthorpe <jgg@mellanox.com>

commit 0625b4ba1a5d4703c7fb01c497bd6c156908af00 upstream.

mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes
were written.

Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp")
Cc: <stable@vger.kernel.org>
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Alessio Balsini <balsini@android.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index a7bc89f5dae7..89357d9e489d 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -1515,7 +1515,7 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd,
 	struct mlx5_ib_resources *devr = &dev->devr;
 	int inlen = MLX5_ST_SZ_BYTES(create_qp_in);
 	struct mlx5_core_dev *mdev = dev->mdev;
-	struct mlx5_ib_create_qp_resp resp;
+	struct mlx5_ib_create_qp_resp resp = {};
 	struct mlx5_ib_cq *send_cq;
 	struct mlx5_ib_cq *recv_cq;
 	unsigned long flags;
-- 
2.23.0.rc1.153.gdeed80330f-goog


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

* Re: [PATCH 4.9.y 4.14.y] IB/mlx5: Fix leaking stack memory to userspace
  2019-08-12 10:55   ` [PATCH 4.9.y 4.14.y] " Alessio Balsini
@ 2019-08-12 14:23     ` Greg KH
  2019-08-13  9:27       ` Alessio Balsini
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2019-08-12 14:23 UTC (permalink / raw)
  To: Alessio Balsini
  Cc: stable, linux-kernel, kernel-team, Jason Gunthorpe, Leon Romanovsky

On Mon, Aug 12, 2019 at 11:55:03AM +0100, Alessio Balsini wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
> 
> commit 0625b4ba1a5d4703c7fb01c497bd6c156908af00 upstream.
> 
> mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes
> were written.
> 
> Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp")

This commit only showed up in the following kernel releases:
	4.17 4.18.7 4.19

so why is this "fix" commit needed in anything older than 4.17?

That's why I did not backport it to older kernels, as I do not think it
is needed there.  Do you?

thanks,

greg k-h

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

* Re: [PATCH 4.9.y 4.14.y] IB/mlx5: Fix leaking stack memory to userspace
  2019-08-12 14:23     ` Greg KH
@ 2019-08-13  9:27       ` Alessio Balsini
  2019-08-13 10:01         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Alessio Balsini @ 2019-08-13  9:27 UTC (permalink / raw)
  To: Greg KH
  Cc: stable, linux-kernel, kernel-team, Jason Gunthorpe,
	Leon Romanovsky, hange-folder>?

Oops, you are totally right, I was still looking at the latest
mlx5_ib_create_qp_resp struct while backporting these patches :)

Sorry for that,
Alessio

On Mon, Aug 12, 2019 at 04:23:16PM +0200, Greg KH wrote:
> On Mon, Aug 12, 2019 at 11:55:03AM +0100, Alessio Balsini wrote:
> > From: Jason Gunthorpe <jgg@mellanox.com>
> > 
> > commit 0625b4ba1a5d4703c7fb01c497bd6c156908af00 upstream.
> > 
> > mlx5_ib_create_qp_resp was never initialized and only the first 4 bytes
> > were written.
> > 
> > Fixes: 41d902cb7c32 ("RDMA/mlx5: Fix definition of mlx5_ib_create_qp_resp")
> 
> This commit only showed up in the following kernel releases:
> 	4.17 4.18.7 4.19
> 
> so why is this "fix" commit needed in anything older than 4.17?
> 
> That's why I did not backport it to older kernels, as I do not think it
> is needed there.  Do you?
> 
> thanks,
> 
> greg k-h

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

* Re: [PATCH 4.9.y 4.14.y] IB/mlx5: Fix leaking stack memory to userspace
  2019-08-13  9:27       ` Alessio Balsini
@ 2019-08-13 10:01         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2019-08-13 10:01 UTC (permalink / raw)
  To: Alessio Balsini
  Cc: stable, linux-kernel, kernel-team, Jason Gunthorpe,
	Leon Romanovsky, hange-folder>?

On Tue, Aug 13, 2019 at 10:27:28AM +0100, Alessio Balsini wrote:
> Oops, you are totally right, I was still looking at the latest
> mlx5_ib_create_qp_resp struct while backporting these patches :)
> 
> Sorry for that,

Not a problem, it's good to have a second pair of eyes on these things
:)

greg k-h

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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 10:48 [PATCH 3.18.y] IB/mlx5: Fix leaking stack memory to userspace Alessio Balsini
2019-08-12 10:51 ` [PATCH 4.4.y] " Alessio Balsini
2019-08-12 10:55   ` [PATCH 4.9.y 4.14.y] " Alessio Balsini
2019-08-12 14:23     ` Greg KH
2019-08-13  9:27       ` Alessio Balsini
2019-08-13 10:01         ` Greg KH

Stable Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://lore.kernel.org/stable \
		stable@vger.kernel.org stable@archiver.kernel.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox