alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: avoid format string leak to thread name
@ 2014-05-22 18:43 Kees Cook
  2014-05-23  7:13 ` Jarkko Nikula
  2014-05-26 13:31 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Kees Cook @ 2014-05-22 18:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Jarkko Nikula, Wenkai Du, Dan Carpenter, Christian Engelmayer,
	alsa-devel

This makes sure a format string can never get processed into the worker
thread name from the device name.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 sound/soc/intel/sst-baytrail-ipc.c |    2 +-
 sound/soc/intel/sst-haswell-ipc.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c
index 0d31dbbf4806..1b25bf168beb 100644
--- a/sound/soc/intel/sst-baytrail-ipc.c
+++ b/sound/soc/intel/sst-baytrail-ipc.c
@@ -809,7 +809,7 @@ int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata)
 	/* start the IPC message thread */
 	init_kthread_worker(&byt->kworker);
 	byt->tx_thread = kthread_run(kthread_worker_fn,
-				     &byt->kworker,
+				     &byt->kworker, "%s",
 				     dev_name(byt->dev));
 	if (IS_ERR(byt->tx_thread)) {
 		err = PTR_ERR(byt->tx_thread);
diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
index e7996b39a484..a8fd60c67341 100644
--- a/sound/soc/intel/sst-haswell-ipc.c
+++ b/sound/soc/intel/sst-haswell-ipc.c
@@ -1735,7 +1735,7 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata)
 	/* start the IPC message thread */
 	init_kthread_worker(&hsw->kworker);
 	hsw->tx_thread = kthread_run(kthread_worker_fn,
-					   &hsw->kworker,
+					   &hsw->kworker, "%s",
 					   dev_name(hsw->dev));
 	if (IS_ERR(hsw->tx_thread)) {
 		ret = PTR_ERR(hsw->tx_thread);
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

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

* Re: [PATCH] ASoC: Intel: avoid format string leak to thread name
  2014-05-22 18:43 [PATCH] ASoC: Intel: avoid format string leak to thread name Kees Cook
@ 2014-05-23  7:13 ` Jarkko Nikula
  2014-05-26 13:31 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Nikula @ 2014-05-23  7:13 UTC (permalink / raw)
  To: Kees Cook, linux-kernel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Wenkai Du, Dan Carpenter, Christian Engelmayer, alsa-devel

On 05/22/2014 09:43 PM, Kees Cook wrote:
> This makes sure a format string can never get processed into the worker
> thread name from the device name.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
>   sound/soc/intel/sst-baytrail-ipc.c |    2 +-
>   sound/soc/intel/sst-haswell-ipc.c  |    2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/intel/sst-baytrail-ipc.c b/sound/soc/intel/sst-baytrail-ipc.c
> index 0d31dbbf4806..1b25bf168beb 100644
> --- a/sound/soc/intel/sst-baytrail-ipc.c
> +++ b/sound/soc/intel/sst-baytrail-ipc.c
> @@ -809,7 +809,7 @@ int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata)
>   	/* start the IPC message thread */
>   	init_kthread_worker(&byt->kworker);
>   	byt->tx_thread = kthread_run(kthread_worker_fn,
> -				     &byt->kworker,
> +				     &byt->kworker, "%s",
>   				     dev_name(byt->dev));
>   	if (IS_ERR(byt->tx_thread)) {
>   		err = PTR_ERR(byt->tx_thread);
> diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c
> index e7996b39a484..a8fd60c67341 100644
> --- a/sound/soc/intel/sst-haswell-ipc.c
> +++ b/sound/soc/intel/sst-haswell-ipc.c
> @@ -1735,7 +1735,7 @@ int sst_hsw_dsp_init(struct device *dev, struct sst_pdata *pdata)
>   	/* start the IPC message thread */
>   	init_kthread_worker(&hsw->kworker);
>   	hsw->tx_thread = kthread_run(kthread_worker_fn,
> -					   &hsw->kworker,
> +					   &hsw->kworker, "%s",
>   					   dev_name(hsw->dev));
>   	if (IS_ERR(hsw->tx_thread)) {
>   		ret = PTR_ERR(hsw->tx_thread);
This is not very fatal as name comes from sound/soc/intel/sst-acpi.c so 
only developer can hit this but to be on safe side:

Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

* Re: [PATCH] ASoC: Intel: avoid format string leak to thread name
  2014-05-22 18:43 [PATCH] ASoC: Intel: avoid format string leak to thread name Kees Cook
  2014-05-23  7:13 ` Jarkko Nikula
@ 2014-05-26 13:31 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-05-26 13:31 UTC (permalink / raw)
  To: Kees Cook
  Cc: linux-kernel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Jarkko Nikula, Wenkai Du, Dan Carpenter, Christian Engelmayer,
	alsa-devel

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

On Thu, May 22, 2014 at 11:43:55AM -0700, Kees Cook wrote:
> This makes sure a format string can never get processed into the worker
> thread name from the device name.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-05-26 13:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 18:43 [PATCH] ASoC: Intel: avoid format string leak to thread name Kees Cook
2014-05-23  7:13 ` Jarkko Nikula
2014-05-26 13:31 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).