All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: avoid format string leaks into iommu_device_create
@ 2015-07-24 23:27 Kees Cook
  2015-08-03 14:16   ` Joerg Roedel
  0 siblings, 1 reply; 3+ messages in thread
From: Kees Cook @ 2015-07-24 23:27 UTC (permalink / raw)
  To: linux-kernel; +Cc: Joerg Roedel, David Woodhouse, iommu

This makes sure it won't be possible to accidentally leak format
strings into iommu device names. Current name allocations are safe,
but this makes the "%s" explicit.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/iommu/dmar.c        | 2 +-
 drivers/iommu/intel-iommu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c
index c9db04d4ef39..8757f8dfc4e5 100644
--- a/drivers/iommu/dmar.c
+++ b/drivers/iommu/dmar.c
@@ -1068,7 +1068,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 	if (intel_iommu_enabled)
 		iommu->iommu_dev = iommu_device_create(NULL, iommu,
 						       intel_iommu_groups,
-						       iommu->name);
+						       "%s", iommu->name);
 
 	return 0;
 
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0649b94f5958..0be23c589d3b 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -4533,7 +4533,7 @@ int __init intel_iommu_init(void)
 	for_each_active_iommu(iommu, drhd)
 		iommu->iommu_dev = iommu_device_create(NULL, iommu,
 						       intel_iommu_groups,
-						       iommu->name);
+						       "%s", iommu->name);
 
 	bus_set_iommu(&pci_bus_type, &intel_iommu_ops);
 	bus_register_notifier(&pci_bus_type, &device_nb);
-- 
1.9.1


-- 
Kees Cook
Chrome OS Security

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

* Re: [PATCH] iommu: avoid format string leaks into iommu_device_create
@ 2015-08-03 14:16   ` Joerg Roedel
  0 siblings, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2015-08-03 14:16 UTC (permalink / raw)
  To: Kees Cook; +Cc: linux-kernel, David Woodhouse, iommu

On Fri, Jul 24, 2015 at 04:27:57PM -0700, Kees Cook wrote:
> This makes sure it won't be possible to accidentally leak format
> strings into iommu device names. Current name allocations are safe,
> but this makes the "%s" explicit.
> 
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>  drivers/iommu/dmar.c        | 2 +-
>  drivers/iommu/intel-iommu.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

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

* Re: [PATCH] iommu: avoid format string leaks into iommu_device_create
@ 2015-08-03 14:16   ` Joerg Roedel
  0 siblings, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2015-08-03 14:16 UTC (permalink / raw)
  To: Kees Cook
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	David Woodhouse, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Fri, Jul 24, 2015 at 04:27:57PM -0700, Kees Cook wrote:
> This makes sure it won't be possible to accidentally leak format
> strings into iommu device names. Current name allocations are safe,
> but this makes the "%s" explicit.
> 
> Signed-off-by: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/iommu/dmar.c        | 2 +-
>  drivers/iommu/intel-iommu.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

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

end of thread, other threads:[~2015-08-03 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-24 23:27 [PATCH] iommu: avoid format string leaks into iommu_device_create Kees Cook
2015-08-03 14:16 ` Joerg Roedel
2015-08-03 14:16   ` Joerg Roedel

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.