02 May, 2018
1 commit
-
commit f9d94b57e30fd1575b4935045b32d738668aa74b upstream.
As recently Smatch suggested, a couple of places in ASIHPI driver may
expand the array directly from the user-space value with speculation:
sound/pci/asihpi/hpimsginit.c:70 hpi_init_response() warn: potential spectre issue 'res_size' (local cap)
sound/pci/asihpi/hpioctl.c:189 asihpi_hpi_ioctl() warn: potential spectre issue 'adapters'This patch puts array_index_nospec() for hardening against them.
BugLink: https://marc.info/?l=linux-kernel&m=152411496503418&w=2
Reported-by: Dan Carpenter
Cc:
Signed-off-by: Takashi Iwai
Signed-off-by: Greg Kroah-Hartman
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
20 Sep, 2017
1 commit
-
The hm->h.size is intended to hold the actual size of the hm struct
that is copied from userspace and should always be h.size), since userspace
process has full control over the memory region pointed by puhm, it is
possible that the value of hm->h.size is different from what is fetched-in
previously (get_user(hm->h.size, (u16 __user *)puhm)). In other words,
hm->h.size is overriden and the relation between hm->h.size and the hm
struct is broken.This patch proposes to use a seperate variable, msg_size, to hold
the value of the first fetch and override hm->h.size to msg_size
after the second fetch to maintain the relation.Signed-off-by: Meng Xu
Signed-off-by: Takashi Iwai
07 Sep, 2017
1 commit
-
BUG_ON() is the worst choice for a trivial sanity check.
Either it should be removed or replaced with a softer one like
WARN_ON() if still really needed.Signed-off-by: Takashi Iwai
31 Aug, 2017
1 commit
-
The asihpi driver has a debug printk code without proper KERN_
prefix. On recent kernels, KERN_CONT prefix is mandatory for
continued output lines. Put it properly.Signed-off-by: Takashi Iwai
18 Oct, 2016
1 commit
-
Some elements in hr are not cleared before being copied to user space,
leaking kernel heap memory to user space. For example, this happens in
the error handling code for the HPI_ADAPTER_DELETE case. Zero the memory
before it's copied.Signed-off-by: Vlad Tsyrklevich
Signed-off-by: Takashi Iwai
08 Sep, 2016
1 commit
-
Remove unneeded variables and assignments.
Signed-off-by: Masahiro Yamada
Signed-off-by: Takashi Iwai
02 Sep, 2016
1 commit
-
Check for snd_pcm_ops structures that are only stored in the ops field of a
snd_soc_platform_driver structure or passed as the third argument to
snd_pcm_set_ops. The corresponding field or parameter is declared const,
so snd_pcm_ops structures that have this property can be declared as const
also.The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)//
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = { ... };@ok1@
identifier r.i;
struct snd_soc_platform_driver e;
position p;
@@
e.ops = &i@p;@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
snd_pcm_set_ops(e1, e2, &i@p)@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_pcm_ops e;
@@
e@i@p@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct snd_pcm_ops i = { ... };
//Signed-off-by: Julia Lawall
Signed-off-by: Takashi Iwai
03 Jun, 2015
1 commit
-
Nothing in uses anything from , so
remove it from there and fix up the resulting build problems
triggered on x86 {64|32}-bit {def|allmod|allno}configs.The breakages were triggering in places where x86 builds relied
on vmalloc() facilities but did not include
explicitly and relied on the implicit inclusion via .Also add:
- to
- to... which were two other implicit header file dependencies.
Suggested-by: David Miller
Signed-off-by: Stephen Rothwell
[ Tidied up the changelog. ]
Acked-by: David Miller
Acked-by: Takashi Iwai
Acked-by: Viresh Kumar
Acked-by: Vinod Koul
Cc: Andrew Morton
Cc: Anton Vorontsov
Cc: Boris Ostrovsky
Cc: Colin Cross
Cc: David Vrabel
Cc: H. Peter Anvin
Cc: Haiyang Zhang
Cc: James E.J. Bottomley
Cc: Jaroslav Kysela
Cc: K. Y. Srinivasan
Cc: Kees Cook
Cc: Konrad Rzeszutek Wilk
Cc: Kristen Carlson Accardi
Cc: Len Brown
Cc: Linus Torvalds
Cc: Peter Zijlstra
Cc: Rafael J. Wysocki
Cc: Suma Ramars
Cc: Thomas Gleixner
Cc: Tony Luck
Signed-off-by: Ingo Molnar
24 Mar, 2015
1 commit
-
Replace duplicated const keyword for 'sampleclock_sources' with proper
array of const pointers to const strings.Signed-off-by: Krzysztof Kozlowski
Signed-off-by: Takashi Iwai
29 Jan, 2015
1 commit
-
Signed-off-by: Takashi Iwai
19 Jan, 2015
1 commit
-
No functional change, refactoring with the standard helpers.
Signed-off-by: Takashi Iwai
04 Jan, 2015
1 commit
-
The iounmap() function performs also input parameter validation.
Thus the test around the call is not needed.This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Takashi Iwai
02 Jan, 2015
1 commit
-
snd_asihpi_hpi_new() takes a pointer to a pointer of a hwdep where if this
parameter is provided the newly allocated hwdep is stored. All callers pass
NULL though, so remove the parameter. This makes the code a bit cleaner and
shorter.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Takashi Iwai
31 Dec, 2014
1 commit
-
Add missing limits to keep copied data within allocated buffer.
Reported-by: Dan Carpenter
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai
18 Dec, 2014
3 commits
-
This corresponds with updated asihpi firmware in alsa-firmware repo
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Increase size allocated for PAD (programme associated data) control.
This is used by newer tuner products.Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Some products firmware is no longer being updated
e.g. dsp5000, dsp8700 but it should continue to work
with updated HPI versions.
Avoid regression by allowing this firmware to be loaded as
long as major version is the same.
Warn about mismatching versions, as matching versions are
preferred.Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai
03 Dec, 2014
1 commit
-
The vfree() function performs also input parameter validation. Thus the test
around the call is not needed.This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring
Signed-off-by: Takashi Iwai
23 Nov, 2014
10 commits
-
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Only determining if low latency mode is enabled. Failure
indicates adapter has no modesSigned-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Prevents spewing of useless messages if app keeps trying to
access the card.Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Some cards have a so-called low-latency mode, in which they present
a single multichannel stream with no mixing or samplerate conversion.
In this mode the card can generate an interrupt per internal processing
block (typically 32 or 64 frames)Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Audio cards wth have AVB or BLU Link IO.
Tuner card with DAB receiverSigned-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai -
Signed-off-by: Eliot Blennerhassett
Signed-off-by: Takashi Iwai
10 Nov, 2014
1 commit
-
Add a new helper function snd_pcm_stop_xrun() to the standard sequnce
lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the
existing open codes with this helper.The function checks the PCM running state to prevent setting the wrong
state, too, for more safety.Signed-off-by: Takashi Iwai
21 Oct, 2014
1 commit
-
... and reduce the open codes.
Signed-off-by: Takashi Iwai
13 Aug, 2014
1 commit
-
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines. This issue was reported by checkpatch.A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/)://
@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;//
[bhelgaas: add semantic patch]
Signed-off-by: Benoit Taine
Signed-off-by: Bjorn Helgaas
31 Mar, 2014
1 commit
-
This used to be a part of a condition until f3d145aac913 ('ALSA: asihpi:
MMAP for non-busmaster cards') but now it's not and we can remove an
indent level.Signed-off-by: Dan Carpenter
Signed-off-by: Takashi Iwai
12 Feb, 2014
1 commit
-
Also remove superfluous snd_card_set_dev() calls.
Signed-off-by: Takashi Iwai
13 Sep, 2013
1 commit
-
These ->put() functions are called from snd_ctl_elem_write() with user
supplied data. snd_asihpi_tuner_band_put() is missing a limit check and
the check in snd_asihpi_clksrc_put() can underflow.Signed-off-by: Dan Carpenter
Signed-off-by: Takashi Iwai
16 Jul, 2013
1 commit
-
snd_pcm_stop() must be called in the PCM substream lock context.
Cc:
Signed-off-by: Takashi Iwai
28 Jun, 2013
1 commit
-
The char arrays with size 44 are for the name string of
snd_ctl_elem_id. Define the constant and replace the raw numbers with
it for clarifying better.Signed-off-by: Takashi Iwai
29 May, 2013
1 commit
-
As drvdata is cleared to NULL at probe failure or at removal by the
driver core, we don't have to call pci_set_drvdata(pci, NULL) any
longer in each driver.The only remaining pci_set_drvdata(NULL) is in azx_firmware_cb() in
hda_intel.c. Since this function itself releases the card instance,
we need to clear drvdata here as well, so that it won't be released
doubly in the remove callback.Signed-off-by: Takashi Iwai
29 Apr, 2013
2 commits
-
Some Asihpi formats are not supported or invalid, and their mapping to
ALSA format is set to -1.
Before performing the format conversion into ALSA bitwise formats,
add a consistency check for the requested format, as done in
snd_card_asihpi_playback_formats().Compile tested only.
Signed-off-by: Eldad Zack
Signed-off-by: Takashi Iwai -
Add a function to handle conversion from snd_pcm_format_t
to bitwise with proper typing.Change such conversions to use this function and silence sparse
warnings.Signed-off-by: Eldad Zack
Signed-off-by: Takashi Iwai