All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fixes for sparse reported warnings
@ 2016-06-17 14:39 ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 14:39 UTC (permalink / raw)
  To: Peter Huewe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Jason Gunthorpe, open list, moderated list:TPM DEVICE DRIVER

Jarkko Sakkinen (2):
  tpm_vtpm_proxy: fix address space of a user pointer in
    vtpmx_fops_ioctl()
  tpm_crb: fix address space of the return pointer in crb_map_res()

 drivers/char/tpm/tpm_crb.c        | 2 +-
 drivers/char/tpm/tpm_vtpm_proxy.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.7.4

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

* [PATCH 0/2] Fixes for sparse reported warnings
@ 2016-06-17 14:39 ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 14:39 UTC (permalink / raw)
  To: Peter Huewe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Jason Gunthorpe, open list, moderated list:TPM DEVICE DRIVER

Jarkko Sakkinen (2):
  tpm_vtpm_proxy: fix address space of a user pointer in
    vtpmx_fops_ioctl()
  tpm_crb: fix address space of the return pointer in crb_map_res()

 drivers/char/tpm/tpm_crb.c        | 2 +-
 drivers/char/tpm/tpm_vtpm_proxy.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.7.4


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

* [PATCH 1/2] tpm_vtpm_proxy: fix address space of a user pointer in vtpmx_fops_ioctl()
@ 2016-06-17 14:39   ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 14:39 UTC (permalink / raw)
  To: Peter Huewe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, Jason Gunthorpe,
	moderated list:TPM DEVICE DRIVER, open list

When running make C=2 M=drivers/char/tpm/

  CC [M]  drivers/char/tpm//tpm_crb.o
  CHECK   drivers/char/tpm//tpm_vtpm_proxy.c
drivers/char/tpm//tpm_vtpm_proxy.c:552:32: warning: incorrect type in assignment (different address spaces)
drivers/char/tpm//tpm_vtpm_proxy.c:552:32:    expected struct vtpm_proxy_new_dev *vtpm_new_dev_p
drivers/char/tpm//tpm_vtpm_proxy.c:552:32:    got void [noderef] <asn:1>*argp
drivers/char/tpm//tpm_vtpm_proxy.c:553:51: warning: incorrect type in argument 2 (different address spaces)
drivers/char/tpm//tpm_vtpm_proxy.c:553:51:    expected void const [noderef] <asn:1>*from
drivers/char/tpm//tpm_vtpm_proxy.c:553:51:    got struct vtpm_proxy_new_dev *vtpm_new_dev_p
drivers/char/tpm//tpm_vtpm_proxy.c:559:34: warning: incorrect type in argument 1 (different address spaces)
drivers/char/tpm//tpm_vtpm_proxy.c:559:34:    expected void [noderef] <asn:1>*to
drivers/char/tpm//tpm_vtpm_proxy.c:559:34:    got struct vtpm_proxy_new_dev *vtpm_new_dev_p

The __user annotation was missing from the corresponding variable.

Fixes: 794c38e01358 ("tpm: Proxy driver for supporting multiple emulated TPMs")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
---
 drivers/char/tpm/tpm_vtpm_proxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
index 4384042..86e27e8 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -541,7 +541,7 @@ static long vtpmx_fops_ioctl(struct file *f, unsigned int ioctl,
 				   unsigned long arg)
 {
 	void __user *argp = (void __user *)arg;
-	struct vtpm_proxy_new_dev *vtpm_new_dev_p;
+	struct vtpm_proxy_new_dev __user *vtpm_new_dev_p;
 	struct vtpm_proxy_new_dev vtpm_new_dev;
 	struct file *file;
 
-- 
2.7.4

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

* [PATCH 1/2] tpm_vtpm_proxy: fix address space of a user pointer in vtpmx_fops_ioctl()
@ 2016-06-17 14:39   ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 14:39 UTC (permalink / raw)
  To: Peter Huewe
  Cc: open list, linux-security-module-u79uwXL29TY76Z2rM5mHXA,
	moderated list:TPM DEVICE DRIVER

When running make C=2 M=drivers/char/tpm/

  CC [M]  drivers/char/tpm//tpm_crb.o
  CHECK   drivers/char/tpm//tpm_vtpm_proxy.c
drivers/char/tpm//tpm_vtpm_proxy.c:552:32: warning: incorrect type in assignment (different address spaces)
drivers/char/tpm//tpm_vtpm_proxy.c:552:32:    expected struct vtpm_proxy_new_dev *vtpm_new_dev_p
drivers/char/tpm//tpm_vtpm_proxy.c:552:32:    got void [noderef] <asn:1>*argp
drivers/char/tpm//tpm_vtpm_proxy.c:553:51: warning: incorrect type in argument 2 (different address spaces)
drivers/char/tpm//tpm_vtpm_proxy.c:553:51:    expected void const [noderef] <asn:1>*from
drivers/char/tpm//tpm_vtpm_proxy.c:553:51:    got struct vtpm_proxy_new_dev *vtpm_new_dev_p
drivers/char/tpm//tpm_vtpm_proxy.c:559:34: warning: incorrect type in argument 1 (different address spaces)
drivers/char/tpm//tpm_vtpm_proxy.c:559:34:    expected void [noderef] <asn:1>*to
drivers/char/tpm//tpm_vtpm_proxy.c:559:34:    got struct vtpm_proxy_new_dev *vtpm_new_dev_p

The __user annotation was missing from the corresponding variable.

Fixes: 794c38e01358 ("tpm: Proxy driver for supporting multiple emulated TPMs")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Tested-by: Stefan Berger <stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
 drivers/char/tpm/tpm_vtpm_proxy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
index 4384042..86e27e8 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -541,7 +541,7 @@ static long vtpmx_fops_ioctl(struct file *f, unsigned int ioctl,
 				   unsigned long arg)
 {
 	void __user *argp = (void __user *)arg;
-	struct vtpm_proxy_new_dev *vtpm_new_dev_p;
+	struct vtpm_proxy_new_dev __user *vtpm_new_dev_p;
 	struct vtpm_proxy_new_dev vtpm_new_dev;
 	struct file *file;
 
-- 
2.7.4


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine

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

* [PATCH 2/2] tpm_crb: fix address space of the return pointer in crb_map_res()
@ 2016-06-17 14:39   ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 14:39 UTC (permalink / raw)
  To: Peter Huewe
  Cc: linux-security-module, Stefan Berger, Jarkko Sakkinen,
	Marcel Selhorst, Jason Gunthorpe,
	moderated list:TPM DEVICE DRIVER, open list

When running make C=2 M=drivers/char/tpm/

  CHECK   drivers/char/tpm//tpm_crb.c
drivers/char/tpm//tpm_crb.c:248:31: warning: incorrect type in return expression (different address spaces)
drivers/char/tpm//tpm_crb.c:248:31:    expected void [noderef] <asn:2>*
drivers/char/tpm//tpm_crb.c:248:31:    got void *

Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 1547636..1b8e1b5 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -245,7 +245,7 @@ static void __iomem *crb_map_res(struct device *dev, struct crb_priv *priv,
 
 	/* Detect a 64 bit address on a 32 bit system */
 	if (start != new_res.start)
-		return ERR_PTR(-EINVAL);
+		return (void __iomem *) ERR_PTR(-EINVAL);
 
 	if (!resource_contains(io_res, &new_res))
 		return devm_ioremap_resource(dev, &new_res);
-- 
2.7.4

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

* [PATCH 2/2] tpm_crb: fix address space of the return pointer in crb_map_res()
@ 2016-06-17 14:39   ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-17 14:39 UTC (permalink / raw)
  To: Peter Huewe
  Cc: open list, linux-security-module-u79uwXL29TY76Z2rM5mHXA,
	moderated list:TPM DEVICE DRIVER

When running make C=2 M=drivers/char/tpm/

  CHECK   drivers/char/tpm//tpm_crb.c
drivers/char/tpm//tpm_crb.c:248:31: warning: incorrect type in return expression (different address spaces)
drivers/char/tpm//tpm_crb.c:248:31:    expected void [noderef] <asn:2>*
drivers/char/tpm//tpm_crb.c:248:31:    got void *

Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 1547636..1b8e1b5 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -245,7 +245,7 @@ static void __iomem *crb_map_res(struct device *dev, struct crb_priv *priv,
 
 	/* Detect a 64 bit address on a 32 bit system */
 	if (start != new_res.start)
-		return ERR_PTR(-EINVAL);
+		return (void __iomem *) ERR_PTR(-EINVAL);
 
 	if (!resource_contains(io_res, &new_res))
 		return devm_ioremap_resource(dev, &new_res);
-- 
2.7.4


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine

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

* Re: [PATCH 2/2] tpm_crb: fix address space of the return pointer in crb_map_res()
  2016-06-17 14:39   ` Jarkko Sakkinen
@ 2016-06-17 14:43     ` Stefan Berger
  -1 siblings, 0 replies; 10+ messages in thread
From: Stefan Berger @ 2016-06-17 14:43 UTC (permalink / raw)
  To: Jarkko Sakkinen, Peter Huewe
  Cc: linux-security-module, Marcel Selhorst, Jason Gunthorpe,
	moderated list:TPM DEVICE DRIVER, open list

On 06/17/2016 10:39 AM, Jarkko Sakkinen wrote:
> When running make C=2 M=drivers/char/tpm/
>
>    CHECK   drivers/char/tpm//tpm_crb.c
> drivers/char/tpm//tpm_crb.c:248:31: warning: incorrect type in return expression (different address spaces)
> drivers/char/tpm//tpm_crb.c:248:31:    expected void [noderef] <asn:2>*
> drivers/char/tpm//tpm_crb.c:248:31:    got void *
>
> Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

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

* Re: [PATCH 2/2] tpm_crb: fix address space of the return pointer in crb_map_res()
@ 2016-06-17 14:43     ` Stefan Berger
  0 siblings, 0 replies; 10+ messages in thread
From: Stefan Berger @ 2016-06-17 14:43 UTC (permalink / raw)
  To: Jarkko Sakkinen, Peter Huewe
  Cc: linux-security-module, Marcel Selhorst, Jason Gunthorpe,
	moderated list:TPM DEVICE DRIVER, open list

On 06/17/2016 10:39 AM, Jarkko Sakkinen wrote:
> When running make C=2 M=drivers/char/tpm/
>
>    CHECK   drivers/char/tpm//tpm_crb.c
> drivers/char/tpm//tpm_crb.c:248:31: warning: incorrect type in return expression (different address spaces)
> drivers/char/tpm//tpm_crb.c:248:31:    expected void [noderef] <asn:2>*
> drivers/char/tpm//tpm_crb.c:248:31:    got void *
>
> Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>

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

* Re: [PATCH 0/2] Fixes for sparse reported warnings
  2016-06-17 14:39 ` Jarkko Sakkinen
@ 2016-06-18 12:20   ` Jarkko Sakkinen
  -1 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-18 12:20 UTC (permalink / raw)
  To: Peter Huewe
  Cc: linux-security-module, Stefan Berger, Jason Gunthorpe, open list,
	moderated list:TPM DEVICE DRIVER

On Fri, Jun 17, 2016 at 04:39:27PM +0200, Jarkko Sakkinen wrote:
> Jarkko Sakkinen (2):
>   tpm_vtpm_proxy: fix address space of a user pointer in
>     vtpmx_fops_ioctl()
>   tpm_crb: fix address space of the return pointer in crb_map_res()

Merged to next.

/Jarkko

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

* Re: [PATCH 0/2] Fixes for sparse reported warnings
@ 2016-06-18 12:20   ` Jarkko Sakkinen
  0 siblings, 0 replies; 10+ messages in thread
From: Jarkko Sakkinen @ 2016-06-18 12:20 UTC (permalink / raw)
  To: Peter Huewe
  Cc: linux-security-module, Stefan Berger, Jason Gunthorpe, open list,
	moderated list:TPM DEVICE DRIVER

On Fri, Jun 17, 2016 at 04:39:27PM +0200, Jarkko Sakkinen wrote:
> Jarkko Sakkinen (2):
>   tpm_vtpm_proxy: fix address space of a user pointer in
>     vtpmx_fops_ioctl()
>   tpm_crb: fix address space of the return pointer in crb_map_res()

Merged to next.

/Jarkko

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

end of thread, other threads:[~2016-06-18 12:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 14:39 [PATCH 0/2] Fixes for sparse reported warnings Jarkko Sakkinen
2016-06-17 14:39 ` Jarkko Sakkinen
2016-06-17 14:39 ` [PATCH 1/2] tpm_vtpm_proxy: fix address space of a user pointer in vtpmx_fops_ioctl() Jarkko Sakkinen
2016-06-17 14:39   ` Jarkko Sakkinen
2016-06-17 14:39 ` [PATCH 2/2] tpm_crb: fix address space of the return pointer in crb_map_res() Jarkko Sakkinen
2016-06-17 14:39   ` Jarkko Sakkinen
2016-06-17 14:43   ` Stefan Berger
2016-06-17 14:43     ` Stefan Berger
2016-06-18 12:20 ` [PATCH 0/2] Fixes for sparse reported warnings Jarkko Sakkinen
2016-06-18 12:20   ` Jarkko Sakkinen

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.