All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place" failed to apply to 4.9-stable tree
@ 2019-03-20 15:35 gregkh
  2019-03-20 19:15 ` Dexuan Cui
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2019-03-20 15:35 UTC (permalink / raw)
  To: decui, dan.j.williams, stable; +Cc: stable


The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 43f89877f26671c6309cd87d7364b1a3e66e71cf Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Wed, 30 Jan 2019 01:23:01 +0000
Subject: [PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place

In the case of ND_CMD_CALL, we should also check out_obj->type.

The patch uses out_obj->type, which is a short alias to
out_obj->package.type.

Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 95db6a2d0d6b..1598e3a121a6 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -535,6 +535,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return -EINVAL;
 	}
 
+	if (out_obj->type != ACPI_TYPE_BUFFER) {
+		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
+				dimm_name, cmd_name, out_obj->type);
+		rc = -EINVAL;
+		goto out;
+	}
+
 	if (call_pkg) {
 		call_pkg->nd_fw_size = out_obj->buffer.length;
 		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -553,13 +560,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return 0;
 	}
 
-	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
-		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
-				dimm_name, cmd_name, out_obj->type);
-		rc = -EINVAL;
-		goto out;
-	}
-
 	dev_dbg(dev, "%s cmd: %s output length: %d\n", dimm_name,
 			cmd_name, out_obj->buffer.length);
 	print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4, 4,


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

* RE: FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place" failed to apply to 4.9-stable tree
  2019-03-20 15:35 FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place" failed to apply to 4.9-stable tree gregkh
@ 2019-03-20 19:15 ` Dexuan Cui
  2019-03-20 20:14   ` gregkh
  0 siblings, 1 reply; 3+ messages in thread
From: Dexuan Cui @ 2019-03-20 19:15 UTC (permalink / raw)
  To: gregkh, dan.j.williams, stable; +Cc: stable

[-- Attachment #1: Type: text/plain, Size: 4612 bytes --]

> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Wednesday, March 20, 2019 8:35 AM
> To: Dexuan Cui <decui@microsoft.com>; dan.j.williams@intel.com;
> stable@vger.kernel.org
> Cc: stable@vger.kernel.org
> Subject: FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the
> right place" failed to apply to 4.9-stable tree
> 
> 
> The patch below does not apply to the 4.9-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From 43f89877f26671c6309cd87d7364b1a3e66e71cf Mon Sep 17 00:00:00
> 2001
> From: Dexuan Cui <decui@microsoft.com>
> Date: Wed, 30 Jan 2019 01:23:01 +0000
> Subject: [PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place
> 
> In the case of ND_CMD_CALL, we should also check out_obj->type.
> 
> The patch uses out_obj->type, which is a short alias to
> out_obj->package.type.
> 
> Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command
> marshaling mechanism")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> 
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 95db6a2d0d6b..1598e3a121a6 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -535,6 +535,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor
> *nd_desc, struct nvdimm *nvdimm,
>  		return -EINVAL;
>  	}
> 
> +	if (out_obj->type != ACPI_TYPE_BUFFER) {
> +		dev_dbg(dev, "%s unexpected output object type cmd: %s
> type: %d\n",
> +				dimm_name, cmd_name, out_obj->type);
> +		rc = -EINVAL;
> +		goto out;
> +	}
> +
>  	if (call_pkg) {
>  		call_pkg->nd_fw_size = out_obj->buffer.length;
>  		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
> @@ -553,13 +560,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor
> *nd_desc, struct nvdimm *nvdimm,
>  		return 0;
>  	}
> 
> -	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
> -		dev_dbg(dev, "%s unexpected output object type cmd: %s
> type: %d\n",
> -				dimm_name, cmd_name, out_obj->type);
> -		rc = -EINVAL;
> -		goto out;
> -	}
> -
>  	dev_dbg(dev, "%s cmd: %s output length: %d\n", dimm_name,
>  			cmd_name, out_obj->buffer.length);
>  	print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4, 4,

Hi, 
I rebased the patch on linux-4.9.y (Linux 4.9.164) as below (I also attached it
for your convenience):

From ee95ef19124b5d425977b9abb0d7553aa8e96e93 Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Wed, 30 Jan 2019 01:23:01 +0000
Subject: [PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place
Reply-To: decui@microsoft.com

In the case of ND_CMD_CALL, we should also check out_obj->type.

The patch uses out_obj->type, which is a short alias to
out_obj->package.type.

Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/acpi/nfit/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 06cf7427d0c4..31a07609f7a2 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -307,6 +307,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return -EINVAL;
 	}
 
+	if (out_obj->type != ACPI_TYPE_BUFFER) {
+		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
+				dimm_name, cmd_name, out_obj->type);
+		rc = -EINVAL;
+		goto out;
+	}
+
 	if (call_pkg) {
 		call_pkg->nd_fw_size = out_obj->buffer.length;
 		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -325,13 +332,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return 0;
 	}
 
-	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
-		dev_dbg(dev, "%s:%s unexpected output object type cmd: %s type: %d\n",
-				__func__, dimm_name, cmd_name, out_obj->type);
-		rc = -EINVAL;
-		goto out;
-	}
-
 	if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
 		dev_dbg(dev, "%s:%s cmd: %s output length: %d\n", __func__,
 				dimm_name, cmd_name, out_obj->buffer.length);
-- 
2.19.1


[-- Attachment #2: for-linux-4.9.y-0001-nfit-acpi_nfit_ctl-Check-out_obj-type-in-the-right-p.patch --]
[-- Type: application/octet-stream, Size: 1841 bytes --]

From ee95ef19124b5d425977b9abb0d7553aa8e96e93 Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Wed, 30 Jan 2019 01:23:01 +0000
Subject: [PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place
Reply-To: decui@microsoft.com

In the case of ND_CMD_CALL, we should also check out_obj->type.

The patch uses out_obj->type, which is a short alias to
out_obj->package.type.

Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/acpi/nfit/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 06cf7427d0c4..31a07609f7a2 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -307,6 +307,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return -EINVAL;
 	}
 
+	if (out_obj->type != ACPI_TYPE_BUFFER) {
+		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
+				dimm_name, cmd_name, out_obj->type);
+		rc = -EINVAL;
+		goto out;
+	}
+
 	if (call_pkg) {
 		call_pkg->nd_fw_size = out_obj->buffer.length;
 		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -325,13 +332,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return 0;
 	}
 
-	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
-		dev_dbg(dev, "%s:%s unexpected output object type cmd: %s type: %d\n",
-				__func__, dimm_name, cmd_name, out_obj->type);
-		rc = -EINVAL;
-		goto out;
-	}
-
 	if (IS_ENABLED(CONFIG_ACPI_NFIT_DEBUG)) {
 		dev_dbg(dev, "%s:%s cmd: %s output length: %d\n", __func__,
 				dimm_name, cmd_name, out_obj->buffer.length);
-- 
2.19.1


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

* Re: FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place" failed to apply to 4.9-stable tree
  2019-03-20 19:15 ` Dexuan Cui
@ 2019-03-20 20:14   ` gregkh
  0 siblings, 0 replies; 3+ messages in thread
From: gregkh @ 2019-03-20 20:14 UTC (permalink / raw)
  To: Dexuan Cui; +Cc: dan.j.williams, stable

On Wed, Mar 20, 2019 at 07:15:00PM +0000, Dexuan Cui wrote:
> > -----Original Message-----
> > From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> > Sent: Wednesday, March 20, 2019 8:35 AM
> > To: Dexuan Cui <decui@microsoft.com>; dan.j.williams@intel.com;
> > stable@vger.kernel.org
> > Cc: stable@vger.kernel.org
> > Subject: FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the
> > right place" failed to apply to 4.9-stable tree
> > 
> > 
> > The patch below does not apply to the 4.9-stable tree.
> > If someone wants it applied there, or to any other stable or longterm
> > tree, then please email the backport, including the original git commit
> > id to <stable@vger.kernel.org>.
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > ------------------ original commit in Linus's tree ------------------
> > 
> > From 43f89877f26671c6309cd87d7364b1a3e66e71cf Mon Sep 17 00:00:00
> > 2001
> > From: Dexuan Cui <decui@microsoft.com>
> > Date: Wed, 30 Jan 2019 01:23:01 +0000
> > Subject: [PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place
> > 
> > In the case of ND_CMD_CALL, we should also check out_obj->type.
> > 
> > The patch uses out_obj->type, which is a short alias to
> > out_obj->package.type.
> > 
> > Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command
> > marshaling mechanism")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Dexuan Cui <decui@microsoft.com>
> > Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> > 
> > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> > index 95db6a2d0d6b..1598e3a121a6 100644
> > --- a/drivers/acpi/nfit/core.c
> > +++ b/drivers/acpi/nfit/core.c
> > @@ -535,6 +535,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor
> > *nd_desc, struct nvdimm *nvdimm,
> >  		return -EINVAL;
> >  	}
> > 
> > +	if (out_obj->type != ACPI_TYPE_BUFFER) {
> > +		dev_dbg(dev, "%s unexpected output object type cmd: %s
> > type: %d\n",
> > +				dimm_name, cmd_name, out_obj->type);
> > +		rc = -EINVAL;
> > +		goto out;
> > +	}
> > +
> >  	if (call_pkg) {
> >  		call_pkg->nd_fw_size = out_obj->buffer.length;
> >  		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
> > @@ -553,13 +560,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor
> > *nd_desc, struct nvdimm *nvdimm,
> >  		return 0;
> >  	}
> > 
> > -	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
> > -		dev_dbg(dev, "%s unexpected output object type cmd: %s
> > type: %d\n",
> > -				dimm_name, cmd_name, out_obj->type);
> > -		rc = -EINVAL;
> > -		goto out;
> > -	}
> > -
> >  	dev_dbg(dev, "%s cmd: %s output length: %d\n", dimm_name,
> >  			cmd_name, out_obj->buffer.length);
> >  	print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4, 4,
> 
> Hi, 
> I rebased the patch on linux-4.9.y (Linux 4.9.164) as below (I also attached it
> for your convenience):

Thanks for this and the 4.14 patch, now queued up.

greg k-h

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

end of thread, other threads:[~2019-03-20 20:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 15:35 FAILED: patch "[PATCH] nfit: acpi_nfit_ctl(): Check out_obj->type in the right place" failed to apply to 4.9-stable tree gregkh
2019-03-20 19:15 ` Dexuan Cui
2019-03-20 20:14   ` gregkh

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.