<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/staging/most, branch linux-4.9.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>staging: most: sound: add sanity check for function argument</title>
<updated>2021-03-07T10:25:58+00:00</updated>
<author>
<name>Christian Gromm</name>
<email>christian.gromm@microchip.com</email>
</author>
<published>2021-02-02T16:21:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=671f2a7a4a37166d5c7fe7a99be85f3070105241'/>
<id>671f2a7a4a37166d5c7fe7a99be85f3070105241</id>
<content type='text'>
[ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ]

This patch checks the function parameter 'bytes' before doing the
subtraction to prevent memory corruption.

Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 45b754ae5b82949dca2b6e74fa680313cefdc813 ]

This patch checks the function parameter 'bytes' before doing the
subtraction to prevent memory corruption.

Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Link: https://lore.kernel.org/r/1612282865-21846-1-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: most: net: fix buffer overflow</title>
<updated>2020-02-05T13:05:36+00:00</updated>
<author>
<name>Andrey Shvetsov</name>
<email>andrey.shvetsov@k2l.de</email>
</author>
<published>2020-01-16T17:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8b6487d85ca9f9bfa9d75917451969a1d097a815'/>
<id>8b6487d85ca9f9bfa9d75917451969a1d097a815</id>
<content type='text'>
commit 4d1356ac12f4d5180d0df345d85ff0ee42b89c72 upstream.

If the length of the socket buffer is 0xFFFFFFFF (max size for an
unsigned int), then payload_len becomes 0xFFFFFFF1 after subtracting 14
(ETH_HLEN).  Then, mdp_len is set to payload_len + 16 (MDP_HDR_LEN)
which overflows and results in a value of 2.  These values for
payload_len and mdp_len will pass current buffer size checks.

This patch checks if derived from skb-&gt;len sum may overflow.

The check is based on the following idea:

For any `unsigned V1, V2` and derived `unsigned SUM = V1 + V2`,
`V1 + V2` overflows iif `SUM &lt; V1`.

Reported-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Andrey Shvetsov &lt;andrey.shvetsov@k2l.de&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200116172238.6046-1-andrey.shvetsov@microchip.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4d1356ac12f4d5180d0df345d85ff0ee42b89c72 upstream.

If the length of the socket buffer is 0xFFFFFFFF (max size for an
unsigned int), then payload_len becomes 0xFFFFFFF1 after subtracting 14
(ETH_HLEN).  Then, mdp_len is set to payload_len + 16 (MDP_HDR_LEN)
which overflows and results in a value of 2.  These values for
payload_len and mdp_len will pass current buffer size checks.

This patch checks if derived from skb-&gt;len sum may overflow.

The check is based on the following idea:

For any `unsigned V1, V2` and derived `unsigned SUM = V1 + V2`,
`V1 + V2` overflows iif `SUM &lt; V1`.

Reported-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Andrey Shvetsov &lt;andrey.shvetsov@k2l.de&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20200116172238.6046-1-andrey.shvetsov@microchip.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>staging: most: cdev: add missing check for cdev_add failure</title>
<updated>2020-01-29T09:24:14+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-02-02T22:34:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bff078e184d4daf437232dbe1199bc8c0bf277a6'/>
<id>bff078e184d4daf437232dbe1199bc8c0bf277a6</id>
<content type='text'>
[ Upstream commit 5ae890780e1b4d08f2c0c5d4ea96fc3928fc0ee9 ]

Currently the call to cdev_add is missing a check for failure. Fix this by
checking for failure and exiting via a new error path that ensures the
allocated comp_channel struct is kfree'd.

Detected by CoverityScan, CID#1462359 ("Unchecked return value")

Fixes: 9bc79bbcd0c5 ("Staging: most: add MOST driver's aim-cdev module")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 5ae890780e1b4d08f2c0c5d4ea96fc3928fc0ee9 ]

Currently the call to cdev_add is missing a check for failure. Fix this by
checking for failure and exiting via a new error path that ensures the
allocated comp_channel struct is kfree'd.

Detected by CoverityScan, CID#1462359 ("Unchecked return value")

Fixes: 9bc79bbcd0c5 ("Staging: most: add MOST driver's aim-cdev module")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Staging: most: hdm-dim2: constify attribute_group structures</title>
<updated>2016-10-02T15:24:00+00:00</updated>
<author>
<name>Bhumika Goyal</name>
<email>bhumirks@gmail.com</email>
</author>
<published>2016-09-29T14:58:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d983c597757883496a9e4956e308395f8ac53bf0'/>
<id>d983c597757883496a9e4956e308395f8ac53bf0</id>
<content type='text'>
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
(
sysfs_remove_group(e1,&amp;i@p)
|
sysfs_create_group(e1,&amp;i@p)
)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text	   data	    bss	    dec	    hex	filename
    509	    160	      0	    669	    29d
drivers/staging/most/hdm-dim2/dim2_sysfs.o

File size after:
   text	   data	    bss	    dec	    hex	filename
    565	     96	      0	    661	    295
drivers/staging/most/hdm-dim2/dim2_sysfs.o

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check for attribute_group structures that are only passed as a second
argument to the functions sysfs_remove_group and sysfs_create_group. As
these arguments are constant so, attribute_group structures having this
property can also be made constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct attribute_group i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
(
sysfs_remove_group(e1,&amp;i@p)
|
sysfs_create_group(e1,&amp;i@p)
)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct attribute_group i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct attribute_group i;

File size before:
   text	   data	    bss	    dec	    hex	filename
    509	    160	      0	    669	    29d
drivers/staging/most/hdm-dim2/dim2_sysfs.o

File size after:
   text	   data	    bss	    dec	    hex	filename
    565	     96	      0	    661	    295
drivers/staging/most/hdm-dim2/dim2_sysfs.o

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Acked-by: Julia Lawall &lt;julia.lawall@lip6.fr&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Staging: most: aim-v4l2: constify v4l2_file_operations structures</title>
<updated>2016-09-27T11:06:55+00:00</updated>
<author>
<name>Bhumika Goyal</name>
<email>bhumirks@gmail.com</email>
</author>
<published>2016-09-27T09:17:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=af2708f5e8a82ddad80ff3f32102defd4ffd87d7'/>
<id>af2708f5e8a82ddad80ff3f32102defd4ffd87d7</id>
<content type='text'>
Check for v4l2_file_operations structures that are only stored in the
fops field of video_device structures. As this field is constant, so
v4l2_file_operations structures having this property can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct v4l2_file_operations i@p = {...};

@ok1@
identifier r1.i;
position p;
struct video_device x;
@@
x.fops=&amp;i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct v4l2_file_operations i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct v4l2_file_operations i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   5608	    160	      4	   5772	   168c
drivers/staging/most/aim-v4l2/video.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5696	     96	      4	   5796	   16a4
drivers/staging/most/aim-v4l2/video.o

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check for v4l2_file_operations structures that are only stored in the
fops field of video_device structures. As this field is constant, so
v4l2_file_operations structures having this property can also be
declared constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct v4l2_file_operations i@p = {...};

@ok1@
identifier r1.i;
position p;
struct video_device x;
@@
x.fops=&amp;i@p;

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct v4l2_file_operations i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct v4l2_file_operations i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   5608	    160	      4	   5772	   168c
drivers/staging/most/aim-v4l2/video.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5696	     96	      4	   5796	   16a4
drivers/staging/most/aim-v4l2/video.o

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Staging: most: aim-sound: constify snd_pcm_ops structures</title>
<updated>2016-09-27T11:06:55+00:00</updated>
<author>
<name>Bhumika Goyal</name>
<email>bhumirks@gmail.com</email>
</author>
<published>2016-09-26T17:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cfb459edaa91d624e42a959f0356d341a3347c76'/>
<id>cfb459edaa91d624e42a959f0356d341a3347c76</id>
<content type='text'>
Check for snd_pcm_ops structures that are only passed as the third
argument to the function snd_pcm_set_ops. As this argument is
constant, so snd_pcm_ops structures having this property can also be
made constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
snd_pcm_set_ops(e1,e2,&amp;i@p)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct snd_pcm_ops i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_pcm_ops i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   4963	    192	     16	   5171	   1433
drivers/staging/most/aim-sound/sound.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5075	     64	     16	   5155	   1423
drivers/staging/most/aim-sound/sound.o

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Check for snd_pcm_ops structures that are only passed as the third
argument to the function snd_pcm_set_ops. As this argument is
constant, so snd_pcm_ops structures having this property can also be
made constant.
Done using coccinelle:

@r1 disable optional_qualifier @
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = {...};

@ok1@
identifier r1.i;
position p;
expression e1,e2;
@@
snd_pcm_set_ops(e1,e2,&amp;i@p)

@bad@
position p!={r1.p,ok1.p};
identifier r1.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
static
+const
struct snd_pcm_ops i={...};

@depends on !bad disable optional_qualifier@
identifier r1.i;
@@
+const
struct snd_pcm_ops i;

File size before:
   text	   data	    bss	    dec	    hex	filename
   4963	    192	     16	   5171	   1433
drivers/staging/most/aim-sound/sound.o

File size after:
   text	   data	    bss	    dec	    hex	filename
   5075	     64	     16	   5155	   1423
drivers/staging/most/aim-sound/sound.o

Signed-off-by: Bhumika Goyal &lt;bhumirks@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: most: fix error return code in audio_probe_channel()</title>
<updated>2016-09-27T11:06:55+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2016-09-25T15:41:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ca8b3fa7ea44738f02979dfdc72a1d75a27dcddb'/>
<id>ca8b3fa7ea44738f02979dfdc72a1d75a27dcddb</id>
<content type='text'>
Fix to return a negative error code from the audio_set_hw_params() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Andrey Shvetsov &lt;andrey.shvetsov@k2l.de&gt;
Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix to return a negative error code from the audio_set_hw_params() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Andrey Shvetsov &lt;andrey.shvetsov@k2l.de&gt;
Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: most: aim-cdev: make syscall write accept buffers of arbitrary size</title>
<updated>2016-09-23T17:00:44+00:00</updated>
<author>
<name>Christian Gromm</name>
<email>christian.gromm@microchip.com</email>
</author>
<published>2016-09-23T13:20:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=da2c08714c94780d81780dd8918c71d491f672f4'/>
<id>da2c08714c94780d81780dd8918c71d491f672f4</id>
<content type='text'>
This patch allows to call the write() function for synchronous and
isochronous channels with buffers of any size. The AIM simply waits for
data to fill up the MOST buffer object according to the network interface
controller specification for streaming channels, before it submits the
buffer to the HDM.

The new behavior is backward compatible to the old applications, since
all known applications needed to fill the buffer completely anyway.

Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch allows to call the write() function for synchronous and
isochronous channels with buffers of any size. The AIM simply waits for
data to fill up the MOST buffer object according to the network interface
controller specification for streaming channels, before it submits the
buffer to the HDM.

The new behavior is backward compatible to the old applications, since
all known applications needed to fill the buffer completely anyway.

Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOC</title>
<updated>2016-09-22T09:54:47+00:00</updated>
<author>
<name>Andrey Shvetsov</name>
<email>andrey.shvetsov@k2l.de</email>
</author>
<published>2016-09-21T12:49:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0540609fe217c3eed5804bcc095b0c41db5e63b0'/>
<id>0540609fe217c3eed5804bcc095b0c41db5e63b0</id>
<content type='text'>
This patch replaces the enum value MOST_CH_ISOC_AVP with the more
appropriate MOST_CH_ISOC.

Signed-off-by: Andrey Shvetsov &lt;andrey.shvetsov@k2l.de&gt;
Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch replaces the enum value MOST_CH_ISOC_AVP with the more
appropriate MOST_CH_ISOC.

Signed-off-by: Andrey Shvetsov &lt;andrey.shvetsov@k2l.de&gt;
Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: most: clean up configuration strings</title>
<updated>2016-09-22T09:54:47+00:00</updated>
<author>
<name>Christian Gromm</name>
<email>christian.gromm@microchip.com</email>
</author>
<published>2016-09-21T12:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=95f73013ed021ef30e787772ecf547c1355c4299'/>
<id>95f73013ed021ef30e787772ecf547c1355c4299</id>
<content type='text'>
This patch adds the strings 'rx', 'tx' and 'isoc' to the list of accepted
identifiers when setting up a channel configuration. To keep consistency it
removes the prefix "dir_" from strings returned by the attributes
set_direction and available_directions and it removes the suffix "_avp"
from the string "isoc_avp" returned by the attributes set_datatype and
available_datatypes.

Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds the strings 'rx', 'tx' and 'isoc' to the list of accepted
identifiers when setting up a channel configuration. To keep consistency it
removes the prefix "dir_" from strings returned by the attributes
set_direction and available_directions and it removes the suffix "_avp"
from the string "isoc_avp" returned by the attributes set_datatype and
available_datatypes.

Signed-off-by: Christian Gromm &lt;christian.gromm@microchip.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
