* [PATCH] ASoC: Taint the kernel if debugfs is used to write directly to CODECs
@ 2011-01-06 16:05 Mark Brown
2011-01-09 13:56 ` Liam Girdwood
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2011-01-06 16:05 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
Since direct register writes may confuse the drivers and are supposed
to be used only in diagnostic situations discourage their use in
production by tainting the kernel when we do a write.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmciro.com>
---
sound/soc/soc-core.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a233607..dbca5023 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file,
start++;
if (strict_strtoul(start, 16, &value))
return -EINVAL;
+
+ /* Userspace has been fiddling around behind the kernel's back */
+ add_taint(TAINT_USER);
+
snd_soc_write(codec, reg, value);
return buf_size;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ASoC: Taint the kernel if debugfs is used to write directly to CODECs
@ 2011-01-06 16:16 Mark Brown
0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-01-06 16:16 UTC (permalink / raw)
To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown
Since direct register writes may confuse the drivers and are supposed
to be used only in diagnostic situations discourage their use in
production by tainting the kernel when we do a write.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/soc-core.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index a233607..dbca5023 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file,
start++;
if (strict_strtoul(start, 16, &value))
return -EINVAL;
+
+ /* Userspace has been fiddling around behind the kernel's back */
+ add_taint(TAINT_USER);
+
snd_soc_write(codec, reg, value);
return buf_size;
}
--
1.7.2.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: Taint the kernel if debugfs is used to write directly to CODECs
2011-01-06 16:05 Mark Brown
@ 2011-01-09 13:56 ` Liam Girdwood
0 siblings, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-01-09 13:56 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches
On Thu, 2011-01-06 at 16:05 +0000, Mark Brown wrote:
> Since direct register writes may confuse the drivers and are supposed
> to be used only in diagnostic situations discourage their use in
> production by tainting the kernel when we do a write.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmciro.com>
> ---
> sound/soc/soc-core.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index a233607..dbca5023 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -209,6 +209,10 @@ static ssize_t codec_reg_write_file(struct file *file,
> start++;
> if (strict_strtoul(start, 16, &value))
> return -EINVAL;
> +
> + /* Userspace has been fiddling around behind the kernel's back */
> + add_taint(TAINT_USER);
> +
> snd_soc_write(codec, reg, value);
> return buf_size;
> }
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-09 13:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06 16:16 [PATCH] ASoC: Taint the kernel if debugfs is used to write directly to CODECs Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2011-01-06 16:05 Mark Brown
2011-01-09 13:56 ` Liam Girdwood
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).