<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/sound/soc, branch linux-4.20.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-4.20.y</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-4.20.y'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2019-03-05T16:59:37+00:00</updated>
<entry>
<title>ASoC: imx-audmux: change snprintf to scnprintf for possible overflow</title>
<updated>2019-03-05T16:59:37+00:00</updated>
<author>
<name>Silvio Cesare</name>
<email>silvio.cesare@gmail.com</email>
</author>
<published>2019-01-15T03:27:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=30fc3790ffd33de60e38f63c4eec09321b215ef4'/>
<id>urn:sha1:30fc3790ffd33de60e38f63c4eec09321b215ef4</id>
<content type='text'>
[ Upstream commit c407cd008fd039320d147088b52d0fa34ed3ddcb ]

Change snprintf to scnprintf. There are generally two cases where using
snprintf causes problems.

1) Uses of size += snprintf(buf, SIZE - size, fmt, ...)
In this case, if snprintf would have written more characters than what the
buffer size (SIZE) is, then size will end up larger than SIZE. In later
uses of snprintf, SIZE - size will result in a negative number, leading
to problems. Note that size might already be too large by using
size = snprintf before the code reaches a case of size += snprintf.

2) If size is ultimately used as a length parameter for a copy back to user
space, then it will potentially allow for a buffer overflow and information
disclosure when size is greater than SIZE. When the size is used to index
the buffer directly, we can have memory corruption. This also means when
size = snprintf... is used, it may also cause problems since size may become
large.  Copying to userspace is mitigated by the HARDENED_USERCOPY kernel
configuration.

The solution to these issues is to use scnprintf which returns the number of
characters actually written to the buffer, so the size variable will never
exceed SIZE.

Signed-off-by: Silvio Cesare &lt;silvio.cesare@gmail.com&gt;
Cc: Timur Tabi &lt;timur@kernel.org&gt;
Cc: Nicolin Chen &lt;nicoleotsuka@gmail.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Xiubo Li &lt;Xiubo.Lee@gmail.com&gt;
Cc: Fabio Estevam &lt;fabio.estevam@nxp.com&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Acked-by: Nicolin Chen &lt;nicoleotsuka@gmail.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: dapm: change snprintf to scnprintf for possible overflow</title>
<updated>2019-03-05T16:59:37+00:00</updated>
<author>
<name>Silvio Cesare</name>
<email>silvio.cesare@gmail.com</email>
</author>
<published>2019-01-12T15:28:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=865db5a3a4f26373a8d19201e0b19e489e6a7d99'/>
<id>urn:sha1:865db5a3a4f26373a8d19201e0b19e489e6a7d99</id>
<content type='text'>
[ Upstream commit e581e151e965bf1f2815dd94620b638fec4d0a7e ]

Change snprintf to scnprintf. There are generally two cases where using
snprintf causes problems.

1) Uses of size += snprintf(buf, SIZE - size, fmt, ...)
In this case, if snprintf would have written more characters than what the
buffer size (SIZE) is, then size will end up larger than SIZE. In later
uses of snprintf, SIZE - size will result in a negative number, leading
to problems. Note that size might already be too large by using
size = snprintf before the code reaches a case of size += snprintf.

2) If size is ultimately used as a length parameter for a copy back to user
space, then it will potentially allow for a buffer overflow and information
disclosure when size is greater than SIZE. When the size is used to index
the buffer directly, we can have memory corruption. This also means when
size = snprintf... is used, it may also cause problems since size may become
large.  Copying to userspace is mitigated by the HARDENED_USERCOPY kernel
configuration.

The solution to these issues is to use scnprintf which returns the number of
characters actually written to the buffer, so the size variable will never
exceed SIZE.

Signed-off-by: Silvio Cesare &lt;silvio.cesare@gmail.com&gt;
Cc: Liam Girdwood &lt;lgirdwood@gmail.com&gt;
Cc: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5682: Fix PLL source register definitions</title>
<updated>2019-03-05T16:59:37+00:00</updated>
<author>
<name>Shuming Fan</name>
<email>shumingf@realtek.com</email>
</author>
<published>2019-01-15T03:27:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6993a8dc09753eed7aff3afaaba50e360754e006'/>
<id>urn:sha1:6993a8dc09753eed7aff3afaaba50e360754e006</id>
<content type='text'>
[ Upstream commit ee7ea2a9a318a89d21b156dc75e54d53904bdbe5 ]

Fix typo which causes headphone no sound while using BCLK
as PLL source.

Signed-off-by: Shuming Fan &lt;shumingf@realtek.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: core: Make snd_soc_find_component() more robust</title>
<updated>2019-03-05T16:59:36+00:00</updated>
<author>
<name>Mark Brown</name>
<email>broonie@kernel.org</email>
</author>
<published>2019-01-14T23:29:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c79841a7ce6db439aba9d944d520ca461c8c709b'/>
<id>urn:sha1:c79841a7ce6db439aba9d944d520ca461c8c709b</id>
<content type='text'>
[ Upstream commit 5a7b2aabc1aa0393f067d9325ada96fdf67f8cb7 ]

There are some use cases where you're checking for a lot of things on a
card and it makes sense that you might end up trying to call
snd_soc_find_component() without either a name or an of_node.  Currently
in that case we try to dereference the name and crash but it's more
useful to allow the caller to just treat that as a case where we don't
find anything, that error handling will already exist.

Inspired by a patch from Ajit Pandey fixing some callers.

Fixes: 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list")
Reported-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: Variable "val" in function rt274_i2c_probe() could be uninitialized</title>
<updated>2019-03-05T16:59:35+00:00</updated>
<author>
<name>Yizhuo</name>
<email>yzhai003@ucr.edu</email>
</author>
<published>2019-01-03T21:59:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=35f12da8d4a63ad59060f7849972e1d68fd2b200'/>
<id>urn:sha1:35f12da8d4a63ad59060f7849972e1d68fd2b200</id>
<content type='text'>
[ Upstream commit 8c3590de0a378c2449fc1aec127cc693632458e4 ]

Inside function rt274_i2c_probe(), if regmap_read() function
returns -EINVAL, then local variable "val" leaves uninitialized
but used in if statement. This is potentially unsafe.

Signed-off-by: Yizhuo &lt;yzhai003@ucr.edu&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: rt5682: Fix recording no sound issue</title>
<updated>2019-03-05T16:59:35+00:00</updated>
<author>
<name>Shuming Fan</name>
<email>shumingf@realtek.com</email>
</author>
<published>2019-01-02T09:18:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fbb47570f648fc5d5628071e7ff2934c16c23a53'/>
<id>urn:sha1:fbb47570f648fc5d5628071e7ff2934c16c23a53</id>
<content type='text'>
[ Upstream commit 22c7d5e7bad1fb2d8b9c611acb55a389f5d848d8 ]

The ADC mixer setting needs to restore to default value
after calibration.

Signed-off-by: Shuming Fan &lt;shumingf@realtek.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: Intel: Haswell/Broadwell: fix setting for .dynamic field</title>
<updated>2019-03-05T16:59:35+00:00</updated>
<author>
<name>Rander Wang</name>
<email>rander.wang@linux.intel.com</email>
</author>
<published>2018-12-18T08:24:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=84a6a91bf36cb73fe822afa70256d3b0556ff162'/>
<id>urn:sha1:84a6a91bf36cb73fe822afa70256d3b0556ff162</id>
<content type='text'>
[ Upstream commit 906a9abc5de73c383af518f5a806f4be2993a0c7 ]

For some reason this field was set to zero when all other drivers use
.dynamic = 1 for front-ends. This change was tested on Dell XPS13 and
has no impact with the existing legacy driver. The SOF driver also works
with this change which enables it to override the fixed topology.

Signed-off-by: Rander Wang &lt;rander.wang@linux.intel.com&gt;
Acked-by: Pierre-Louis Bossart &lt;pierre-louis.bossart@linux.intel.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ASoC: soc-core: fix init platform memory handling</title>
<updated>2019-02-27T09:09:56+00:00</updated>
<author>
<name>Curtis Malainey</name>
<email>cujomalainey@chromium.org</email>
</author>
<published>2019-01-11T00:21:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=df33b662c0f97a6506e4218070011cc19a171ac9'/>
<id>urn:sha1:df33b662c0f97a6506e4218070011cc19a171ac9</id>
<content type='text'>
commit 09ac6a817bd687e7f5dac00470262efdd72f9319 upstream.

snd_soc_init_platform initializes pointers to snd_soc_dai_link which is
statically allocated and it does this by devm_kzalloc. In the event of
an EPROBE_DEFER the memory will be freed and the pointers are left
dangling. snd_soc_init_platform sees the dangling pointers and assumes
they are pointing to initialized memory and does not reallocate them on
the second probe attempt which results in a use after free bug since
devm has freed the memory from the first probe attempt.

Since the intention for snd_soc_dai_link-&gt;platform is that it can be set
statically by the machine driver we need to respect the pointer in the
event we did not set it but still catch dangling pointers. The solution
is to add a flag to track whether the pointer was dynamically allocated
or not.

Signed-off-by: Curtis Malainey &lt;cujomalainey@chromium.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ASoC: hdmi-codec: fix oops on re-probe</title>
<updated>2019-02-20T09:29:10+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2019-01-17T17:32:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0a611997a9737c99f2bb5eefda836e0b5738a3d7'/>
<id>urn:sha1:0a611997a9737c99f2bb5eefda836e0b5738a3d7</id>
<content type='text'>
commit 0ce23d6d42147a692768e6baaaa3db75c44f4235 upstream.

hdmi-codec oopses the kernel when it is unbound from a successfully
bound audio subsystem, and is then rebound:

Unable to handle kernel NULL pointer dereference at virtual address 0000001c
pgd = ee3f0000
[0000001c] *pgd=3cc59831
Internal error: Oops: 817 [#1] PREEMPT ARM
Modules linked in: ext2 snd_soc_spdif_tx vmeta dove_thermal snd_soc_kirkwood ofpart marvell_cesa m25p80 orion_wdt mtd spi_nor des_generic gpio_ir_recv snd_soc_kirkwood_spdif bmm_dmabuf auth_rpcgss nfsd autofs4 etnaviv thermal_sys hwmon gpu_sched tda9950
CPU: 0 PID: 1005 Comm: bash Not tainted 4.20.0+ #1762
Hardware name: Marvell Dove (Cubox)
PC is at hdmi_dai_probe+0x68/0x80
LR is at find_held_lock+0x20/0x94
pc : [&lt;c04c7de0&gt;]    lr : [&lt;c0063bf4&gt;]    psr: 600f0013
sp : ee15bd28  ip : eebd8b1c  fp : c093b488
r10: ee048000  r9 : eebdab18  r8 : ee048600
r7 : 00000001  r6 : 00000000  r5 : 00000000  r4 : ee82c100
r3 : 00000006  r2 : 00000001  r1 : c067e38c  r0 : ee82c100
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none[  297.318599] Control: 10c5387d  Table: 2e3f0019  DAC: 00000051
Process bash (pid: 1005, stack limit = 0xee15a248)
...
[&lt;c04c7de0&gt;] (hdmi_dai_probe) from [&lt;c04b7060&gt;] (soc_probe_dai.part.9+0x34/0x70)
[&lt;c04b7060&gt;] (soc_probe_dai.part.9) from [&lt;c04b81a8&gt;] (snd_soc_instantiate_card+0x734/0xc9c)
[&lt;c04b81a8&gt;] (snd_soc_instantiate_card) from [&lt;c04b8b6c&gt;] (snd_soc_add_component+0x29c/0x378)
[&lt;c04b8b6c&gt;] (snd_soc_add_component) from [&lt;c04b8c8c&gt;] (snd_soc_register_component+0x44/0x54)
[&lt;c04b8c8c&gt;] (snd_soc_register_component) from [&lt;c04c64b4&gt;] (devm_snd_soc_register_component+0x48/0x84)
[&lt;c04c64b4&gt;] (devm_snd_soc_register_component) from [&lt;c04c7be8&gt;] (hdmi_codec_probe+0x150/0x260)
[&lt;c04c7be8&gt;] (hdmi_codec_probe) from [&lt;c0373124&gt;] (platform_drv_probe+0x48/0x98)

This happens because hdmi_dai_probe() attempts to access the HDMI
codec private data, but this has not been assigned by hdmi_dai_probe()
before it calls devm_snd_soc_register_component().  Move the call to
dev_set_drvdata() before devm_snd_soc_register_component() to avoid
this oops.

Signed-off-by: Russell King &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ASoC: fsl: Fix SND_SOC_EUKREA_TLV320 build error on i.MX8M</title>
<updated>2019-02-12T19:02:19+00:00</updated>
<author>
<name>Fabio Estevam</name>
<email>festevam@gmail.com</email>
</author>
<published>2018-12-13T02:08:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=1e2aaaf6ced2684f8c4f9a42367e8cacd17fccec'/>
<id>urn:sha1:1e2aaaf6ced2684f8c4f9a42367e8cacd17fccec</id>
<content type='text'>
[ Upstream commit add6883619a9e3bf9658eaff1a547354131bbcd9 ]

eukrea-tlv320.c machine driver runs on non-DT platforms
and include &lt;asm/mach-types.h&gt; header file in order to be able
to use some machine_is_eukrea_xxx() macros.

Building it for ARM64 causes the following build error:

sound/soc/fsl/eukrea-tlv320.c:28:10: fatal error: asm/mach-types.h: No such file or directory

Avoid this error by not allowing to build the SND_SOC_EUKREA_TLV320
driver when ARM64 is selected.

This is needed in preparation for the i.MX8M support.

Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Fabio Estevam &lt;festevam@gmail.com&gt;
Acked-by: Shawn Guo &lt;shawnguo@kernel.org&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
