Update Linux CVE patches

This commit is contained in:
Tad 2017-10-29 22:14:37 -04:00
parent 12b63c12b7
commit 3989a1b20b
958 changed files with 21074 additions and 397 deletions

View File

@ -1 +0,0 @@
dHJlZSBjYjZkNjg0MTFmZjUwNmM0OWQ1Yzc3OThkZjQyNjM0MjQxN2NjNTEzCnBhcmVudCA1NjUyNWQ1ZmQzNzVlYWJlZjJiZjU5OGE2ZThiYzQ2NmRmZDY4ZjkxCmF1dGhvciBBbmRyZXcgQ2hhbnQgPGFjaGFudEBnb29nbGUuY29tPiAxNDg2NTk2ODI4IC0wODAwCmNvbW1pdHRlciBKb2huIERpYXMgPGpvYW9kaWFzQGdvb2dsZS5jb20+IDE0ODcyMTI0MjYgKzAwMDAKCnNkY2FyZGZzOiBsaW1pdCBzdGFja2luZyBkZXB0aAoKTGltaXQgZmlsZXN5c3RlbSBzdGFja2luZyB0byBwcmV2ZW50IHN0YWNrIG92ZXJmbG93LgoKQnVnOiAzMjc2MTQ2MwpDaGFuZ2UtSWQ6IEk4YjE0NjJiOWMwZDZjN2YwMGNmMTEwNzI0ZmZiMTdlN2YzMDdjNTFlClNpZ25lZC1vZmYtYnk6IEFuZHJldyBDaGFudCA8YWNoYW50QGdvb2dsZS5jb20+Cg==

View File

@ -1 +0,0 @@
dHJlZSBkZWNmNTU4OGI2YzA1NzM5ODg0YzViNThhYmY5YzE1ZTk2MmY2YTZlCnBhcmVudCBjODc1ZWViODY4MzUzZDNjYmVmMGVmNWRhYWJkYzU0ZTNkYzQyNTlmCmF1dGhvciBSaWxleSBBbmRyZXdzIDxyaWFuZHJld3NAYW5kcm9pZC5jb20+IDE0MzI4NTEwMTQgLTA3MDAKY29tbWl0dGVyIFRoaWVycnkgU3RydWRlbCA8dHN0cnVkZWxAZ29vZ2xlLmNvbT4gMTQzMzIwMzU4NiAtMDcwMAoKYW5kcm9pZDogZHJpdmVyczogd29ya2Fyb3VuZCBkZWJ1Z2ZzIHJhY2UgaW4gYmluZGVyCgpJZiBhIC9kL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jMTNmMjRhNjczNTFjMzgzMTUKU2lnbmVkLW9mZi1ieTogUmFnaGF2ZW5kcmEgQW1iYWRhcyA8cmFtYmFkQGNvZGVhdXJvcmEub3JnPgpTaWduZWQtb2ZmLWJ5OiBOYXNlZXIgQWhtZWQgPG5hc2VlckBjb2RlYXVyb3JhLm9yZz4KQlVHPTI2NDA0NTI1Cg==

View File

@ -1,58 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Diff - 8292fe595c99ccbcb5e73debdba21d5f1ad91ef6^! - kernel/msm.git - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.HLL9TqKl0YYybSzmT_wTdw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/kernel/msm.git/%2B/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6%255E%2521/">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/kernel/">kernel</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm.git/">msm.git</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm.git/+/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6%5E%21/">8292fe595c99ccbcb5e73debdba21d5f1ad91ef6^!</a> / <span class="Breadcrumbs-crumb">.</span></div><div class="u-monospace Metadata"><table><tr><th class="Metadata-title">commit</th><td>8292fe595c99ccbcb5e73debdba21d5f1ad91ef6</td><td><span>[<a href="/kernel/msm.git/+log/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6/">log</a>]</span> <span>[<a href="/kernel/msm.git/+archive/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6/.tar.gz">tgz</a>]</span></td></tr><tr><th class="Metadata-title">author</th><td>Ben Romberger &lt;bromberg@codeaurora.org&gt;</td><td>Thu Apr 14 14:35:10 2016 -0700</td></tr><tr><th class="Metadata-title">committer</th><td>Yuan Lin &lt;yualin@google.com&gt;</td><td>Wed Apr 20 17:53:33 2016 -0700</td></tr><tr><th class="Metadata-title">tree</th><td><a href="/kernel/msm.git/+/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6/">d43e1c522da03f52f6b6082235fc29fdde35cab3</a></td></tr><tr><th class="Metadata-title">parent</th><td><a href="/kernel/msm.git/+/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6%5E">27e5b60af8b7b1fd289b1438a69866a125dacbdc</a> <span>[<a href="/kernel/msm.git/+/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6%5E%21/">diff</a>]</span></td></tr></table></div><pre class="u-pre u-monospace MetadataMessage">ASoC: msm: Add bounds checking to ADM get params
Add additional bounds checking to ADM get params.
Validate that all buffer sizes are valid before
dereferencing.
BUG=27947307
Change-Id: <a href="https://android-review.googlesource.com/#/q/Iae3643985b5b72b78606f4dff94f8068ee0ddc09">Iae3643985b5b72b78606f4dff94f8068ee0ddc09</a>
</pre><pre class="u-pre u-monospace Diff"><a name="F0" class="Diff-fileIndex"></a>diff --git <a href="/kernel/msm.git/+/27e5b60af8b7b1fd289b1438a69866a125dacbdc/sound/soc/msm/qdsp6v2/q6adm.c">a/sound/soc/msm/qdsp6v2/q6adm.c</a> <a href="/kernel/msm.git/+/8292fe595c99ccbcb5e73debdba21d5f1ad91ef6/sound/soc/msm/qdsp6v2/q6adm.c">b/sound/soc/msm/qdsp6v2/q6adm.c</a>
index 08caf51..14565cc 100644
--- a/sound/soc/msm/qdsp6v2/q6adm.c
+++ b/sound/soc/msm/qdsp6v2/q6adm.c
</pre><pre class="u-pre u-monospace Diff-unified"><span class="Diff-hunk">@@ -508,9 +508,18 @@
</span><span class="Diff-change"> rc = -EINVAL;</span>
<span class="Diff-change"> goto adm_get_param_return;</span>
<span class="Diff-change"> }</span>
<span class="Diff-delete">- if (params_data) {</span>
<span class="Diff-insert">+ if ((params_data) &amp;&amp;</span>
<span class="Diff-insert">+ (ARRAY_SIZE(adm_get_parameters) &gt; 0) &amp;&amp;</span>
<span class="Diff-insert">+ (ARRAY_SIZE(adm_get_parameters) &gt;= 1+adm_get_parameters[0]) &amp;&amp;</span>
<span class="Diff-insert">+ (params_length/sizeof(int) &gt;= adm_get_parameters[0])) {</span>
<span class="Diff-change"> for (i = 0; i &lt; adm_get_parameters[0]; i++)</span>
<span class="Diff-change"> params_data[i] = adm_get_parameters[1+i];</span>
<span class="Diff-insert">+ } else {</span>
<span class="Diff-insert">+ pr_err(&quot;%s: Get param data not copied! get_param array size %zd, index %d, params array size %zd, index %d\n&quot;,</span>
<span class="Diff-insert">+ __func__, ARRAY_SIZE(adm_get_parameters),</span>
<span class="Diff-insert">+ (1+adm_get_parameters[0]),</span>
<span class="Diff-insert">+ params_length/sizeof(int),</span>
<span class="Diff-insert">+ adm_get_parameters[0]);</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> rc = 0;</span>
<span class="Diff-change"> adm_get_param_return:</span>
<span class="Diff-hunk">@@ -799,17 +808,18 @@
</span><span class="Diff-change"> data-&gt;payload_size))</span>
<span class="Diff-change"> break;</span>
<span class="Diff-change"> </span>
<span class="Diff-delete">- if (payload[0] == 0) {</span>
<span class="Diff-delete">- if (data-&gt;payload_size &gt;</span>
<span class="Diff-delete">- (4 * sizeof(uint32_t))) {</span>
<span class="Diff-delete">- adm_get_parameters[0] = payload[3];</span>
<span class="Diff-insert">+ if ((payload[0] == 0) &amp;&amp;</span>
<span class="Diff-insert">+ (data-&gt;payload_size &gt; (4 * sizeof(*payload))) &amp;&amp;</span>
<span class="Diff-insert">+ (data-&gt;payload_size/sizeof(*payload)-4 &gt;= payload[3]) &amp;&amp;</span>
<span class="Diff-insert">+ (ARRAY_SIZE(adm_get_parameters) &gt; 0) &amp;&amp;</span>
<span class="Diff-insert">+ (ARRAY_SIZE(adm_get_parameters)-1 &gt;= payload[3])) {</span>
<span class="Diff-insert">+ adm_get_parameters[0] = payload[3];</span>
<span class="Diff-change"> pr_debug(&quot;GET_PP PARAM:received parameter length: 0x%x\n&quot;,</span>
<span class="Diff-change"> adm_get_parameters[0]);</span>
<span class="Diff-change"> /* storing param size then params */</span>
<span class="Diff-change"> for (i = 0; i &lt; payload[3]; i++)</span>
<span class="Diff-change"> adm_get_parameters[1+i] =</span>
<span class="Diff-change"> payload[4+i];</span>
<span class="Diff-delete">- }</span>
<span class="Diff-change"> } else {</span>
<span class="Diff-change"> adm_get_parameters[0] = -1;</span>
<span class="Diff-change"> pr_err(&quot;%s: GET_PP_PARAMS failed, setting size to %d\n&quot;,</span>
</pre></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

View File

@ -1,37 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Diff - eb6cc9d4af6791d4d34075e3fa08f0c858087a8c^! - kernel/msm.git - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.HLL9TqKl0YYybSzmT_wTdw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/kernel/msm.git/%2B/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c%255E%2521/">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/kernel/">kernel</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm.git/">msm.git</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm.git/+/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c%5E%21/">eb6cc9d4af6791d4d34075e3fa08f0c858087a8c^!</a> / <span class="Breadcrumbs-crumb">.</span></div><div class="u-monospace Metadata"><table><tr><th class="Metadata-title">commit</th><td>eb6cc9d4af6791d4d34075e3fa08f0c858087a8c</td><td><span>[<a href="/kernel/msm.git/+log/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c/">log</a>]</span> <span>[<a href="/kernel/msm.git/+archive/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c/.tar.gz">tgz</a>]</span></td></tr><tr><th class="Metadata-title">author</th><td>Rajesh Kemisetti &lt;rajeshk@codeaurora.org&gt;</td><td>Tue Apr 19 15:42:12 2016 -0700</td></tr><tr><th class="Metadata-title">committer</th><td>Yuan Lin &lt;yualin@google.com&gt;</td><td>Tue Apr 19 22:46:09 2016 +0000</td></tr><tr><th class="Metadata-title">tree</th><td><a href="/kernel/msm.git/+/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c/">e573a8e6012cf35a0adc0983182fa3b007645d98</a></td></tr><tr><th class="Metadata-title">parent</th><td><a href="/kernel/msm.git/+/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c%5E">4029268991f478b98b6d37106af8f1f635c0b595</a> <span>[<a href="/kernel/msm.git/+/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c%5E%21/">diff</a>]</span></td></tr></table></div><pre class="u-pre u-monospace MetadataMessage">msm: kgsl: Add missing checks for alloc size and sglen
In _kgsl_sharedmem_page_alloc():
- Make len of type size_t to be in line with size.
- Check for boundary limits of requested alloc size before honoring.
- Make sure sglen is greater than zero before marking it as end
of sg list.
Bug: 27475454
Change-Id: <a href="https://android-review.googlesource.com/#/q/I5b2e6f657f532fc256627cb6b2ab3ca01938a11b">I5b2e6f657f532fc256627cb6b2ab3ca01938a11b</a>
Signed-off-by: Yuan Lin &lt;yualin@google.com&gt;
</pre><pre class="u-pre u-monospace Diff"><a name="F0" class="Diff-fileIndex"></a>diff --git <a href="/kernel/msm.git/+/4029268991f478b98b6d37106af8f1f635c0b595/drivers/gpu/msm/kgsl_sharedmem.c">a/drivers/gpu/msm/kgsl_sharedmem.c</a> <a href="/kernel/msm.git/+/eb6cc9d4af6791d4d34075e3fa08f0c858087a8c/drivers/gpu/msm/kgsl_sharedmem.c">b/drivers/gpu/msm/kgsl_sharedmem.c</a>
index 29f6162..a138719 100644
--- a/drivers/gpu/msm/kgsl_sharedmem.c
+++ b/drivers/gpu/msm/kgsl_sharedmem.c
</pre><pre class="u-pre u-monospace Diff-unified"><span class="Diff-hunk">@@ -592,13 +592,18 @@
</span><span class="Diff-change"> size_t size)</span>
<span class="Diff-change"> {</span>
<span class="Diff-change"> int pcount = 0, order, ret = 0;</span>
<span class="Diff-delete">- int j, len, page_size, sglen_alloc, sglen = 0;</span>
<span class="Diff-insert">+ int j, page_size, sglen_alloc, sglen = 0;</span>
<span class="Diff-change"> struct page **pages = NULL;</span>
<span class="Diff-change"> pgprot_t page_prot = pgprot_writecombine(PAGE_KERNEL);</span>
<span class="Diff-change"> void *ptr;</span>
<span class="Diff-insert">+ size_t len;</span>
<span class="Diff-change"> unsigned int align;</span>
<span class="Diff-change"> int step = SZ_2M &gt;&gt; PAGE_SHIFT;</span>
<span class="Diff-change"> </span>
<span class="Diff-insert">+ size = PAGE_ALIGN(size);</span>
<span class="Diff-insert">+ if (size == 0 || size &gt; UINT_MAX)</span>
<span class="Diff-insert">+ return -EINVAL;</span>
<span class="Diff-insert">+</span>
<span class="Diff-change"> align = (memdesc-&gt;flags &amp; KGSL_MEMALIGN_MASK) &gt;&gt; KGSL_MEMALIGN_SHIFT;</span>
<span class="Diff-change"> </span>
<span class="Diff-change"> page_size = (align &gt;= ilog2(SZ_64K) &amp;&amp; size &gt;= SZ_64K)</span>
</pre></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

View File

@ -1 +0,0 @@
dHJlZSBmM2U3ZWU2ZDlmNWFhOTc4ZDQ1ZTg0YTA2NDA2MWZjODJkZjMxNTY4CnBhcmVudCA5OTk2N2Y1ZGVkOGEzMTMzZDFmM2FiNmQ2NmM0YjI3MDM0MTAzYzdmCmF1dGhvciB2aXZlayBtZWh0YSA8bXZpdmVrQGNvZGVhdXJvcmEub3JnPiAxNDYwNTg0NDQ4IC0wNzAwCmNvbW1pdHRlciBZdWFuIExpbiA8eXVhbGluQGdvb2dsZS5jb20+IDE0NjA3Njc2MzYgLTA3MDAKCkFTb0M6IG1zbTogZGlzYWJsZSB1bndhbnRlZCBtb2R1bGUKCi0gZGlzYWJsZSBjb21waWxhdGlvbiBvZiB1bndhbnRlZCBtb2R1bGVzCgpCdWc6IDI3NTMxOTkyCkNoYW5nZS1JZDogSTlkZjRlZmQ4OTkwMzJmYjkyMTlhMjg2ZmU0NjlkN2IyZjQ3NjY4NmYKU2lnbmVkLW9mZi1ieTogdml2ZWsgbWVodGEgPG12aXZla0Bjb2RlYXVyb3JhLm9yZz4K

View File

@ -1 +0,0 @@
dHJlZSBmMTE4YzIzODJmNGE0YjE3YjdkNzRlNTAxZTVjOTJjZWQwNzM2MzA0CnBhcmVudCAzNWMzYjc1ZWQyNmUyNDhjNjBmNjQ5MTc1NWFhY2Y2OWIyZWY4NmE0CmF1dGhvciBUaGllcnJ5IFN0cnVkZWwgPHRzdHJ1ZGVsQGdvb2dsZS5jb20+IDE0NjA1NjY5NTUgLTA3MDAKY29tbWl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ciBpb2N0bCBjYWxscwoKU2lnbmVkLW9mZi1ieTogSmVycnkgTGVlIDxqZXJyeWxlZUBicm9hZGNvbS5jb20+CkJ1ZzogMjY0MjU3NjUKQnVnOiAyNzk5NzA3NQpDaGFuZ2UtSWQ6IElhZTFiNTNhYTYyZmRjMjQ1MzBiYjFiODVjYjY5NzQwYzg3ZDE4MmU5Cg==

View File

@ -1,20 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Diff - f2152040cb3c13fa846914df1ad44a8a7fd2e935^! - kernel/msm - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.HLL9TqKl0YYybSzmT_wTdw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/kernel/msm/%2B/f2152040cb3c13fa846914df1ad44a8a7fd2e935%255E%2521/">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/kernel/">kernel</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm/">msm</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm/+/f2152040cb3c13fa846914df1ad44a8a7fd2e935%5E%21/">f2152040cb3c13fa846914df1ad44a8a7fd2e935^!</a> / <span class="Breadcrumbs-crumb">.</span></div><div class="u-monospace Metadata"><table><tr><th class="Metadata-title">commit</th><td>f2152040cb3c13fa846914df1ad44a8a7fd2e935</td><td><span>[<a href="/kernel/msm/+log/f2152040cb3c13fa846914df1ad44a8a7fd2e935/">log</a>]</span> <span>[<a href="/kernel/msm/+archive/f2152040cb3c13fa846914df1ad44a8a7fd2e935/.tar.gz">tgz</a>]</span></td></tr><tr><th class="Metadata-title">author</th><td>Mohamad Ayyash &lt;mkayyash@google.com&gt;</td><td>Tue May 24 15:44:24 2016 -0700</td></tr><tr><th class="Metadata-title">committer</th><td>Patrick Tjin &lt;pattjin@google.com&gt;</td><td>Wed Jun 08 09:40:11 2016 -0700</td></tr><tr><th class="Metadata-title">tree</th><td><a href="/kernel/msm/+/f2152040cb3c13fa846914df1ad44a8a7fd2e935/">94cdf0453986ab2673284370ede95824fff017f9</a></td></tr><tr><th class="Metadata-title">parent</th><td><a href="/kernel/msm/+/f2152040cb3c13fa846914df1ad44a8a7fd2e935%5E">4641bdfd4961b71547571a20e664f4831715b651</a> <span>[<a href="/kernel/msm/+/f2152040cb3c13fa846914df1ad44a8a7fd2e935%5E%21/">diff</a>]</span></td></tr></table></div><pre class="u-pre u-monospace MetadataMessage">Don&#39;t show empty tag stats for unprivileged uids
BUG: 27577101
BUG: 27532522
Change-Id: <a href="https://android-review.googlesource.com/#/q/I890831a72e5ad4485fdf30e51a146712b18052ed">I890831a72e5ad4485fdf30e51a146712b18052ed</a>
Signed-off-by: Mohamad Ayyash &lt;mkayyash@google.com
</pre><pre class="u-pre u-monospace Diff"><a name="F0" class="Diff-fileIndex"></a>diff --git <a href="/kernel/msm/+/4641bdfd4961b71547571a20e664f4831715b651/net/netfilter/xt_qtaguid.c">a/net/netfilter/xt_qtaguid.c</a> <a href="/kernel/msm/+/f2152040cb3c13fa846914df1ad44a8a7fd2e935/net/netfilter/xt_qtaguid.c">b/net/netfilter/xt_qtaguid.c</a>
index c690e0f..9ce6228 100644
--- a/net/netfilter/xt_qtaguid.c
+++ b/net/netfilter/xt_qtaguid.c
</pre><pre class="u-pre u-monospace Diff-unified"><span class="Diff-hunk">@@ -2521,7 +2521,7 @@
</span><span class="Diff-change"> uid_t stat_uid = get_uid_from_tag(tag);</span>
<span class="Diff-change"> struct proc_print_info *ppi = m-&gt;private;</span>
<span class="Diff-change"> /* Detailed tags are not available to everybody */</span>
<span class="Diff-delete">- if (get_atag_from_tag(tag) &amp;&amp; !can_read_other_uid_stats(stat_uid)) {</span>
<span class="Diff-insert">+ if (!can_read_other_uid_stats(stat_uid)) {</span>
<span class="Diff-change"> CT_DEBUG(&quot;qtaguid: stats line: &quot;</span>
<span class="Diff-change"> &quot;%s 0x%llx %u: insufficient priv &quot;</span>
<span class="Diff-change"> &quot;from pid=%u tgid=%u uid=%u stats.gid=%u\n&quot;,</span>
</pre></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

View File

@ -1 +0,0 @@
dHJlZSBkNjgwZmM2NWNhN2M2NTA0NzdiNmNkNjRlNjI4ZjUwNWNhZTY4OWVmCnBhcmVudCAzODk3MWZmZWMyNWIyZGVlZjEzNDNhZmJlMzk0NzMzY2JmZDNjNTA3CmF1dGhvciBQaGlsIFR1cm5idWxsIDxwaGlsLnR1cm5idWxsQG9yYWNsZS5jb20+IDE0NTQ0MzgyMDUgLTA1MDAKY29tbWl0dGVyIFBhdCBUamluIDxwYXR0amluQGdvb2dsZS5jb20+IDE0NzQxMDA5ODQgKzAwMDAKCkJBQ0tQT1JUOiBuZXRmaWx0ZXI6IG5mbmV0bGluazogY29ycmVjdGx5IHZhbGlkYXRlIGxlbmd0aCBvZiBiYXRjaCBtZXNzYWdlcwoKKGNoZXJyeSBwaWNrZWQgZnJvbSBjb21taXQgYzU4ZDZjOTM2ODBmMjhhYzU4OTg0YWY2MWQwYTdlYmY0MzE5YzI0MSkKCklmIG5saC0+bmxtc2dfbGVuIGlzIHplcm8gdGhlbiBhbiBpbmZpbml0ZSBsb29wIGlzIHRyaWdnZXJlZCBiZWNhdXNlCidza2JfcHVsbChza2IsIG1zZ2xlbik7JyBwdWxsc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dsZS5jb20+IDE0ODM2MzE2NzQgKzAwMDAKCnJ0NTUwNjogbGltaXQgc2V0IG1vZGUgY2FsbCB0byBNQVhfUkVHX0RBVEEKClNpZ25lZC1vZmYtYnk6IE5hdGhhbiBDcmFuZGFsbCA8bmF0aGFuY3JhbmRhbGwxQGdtYWlsLmNvbT4KQnVnOiAzMzU0NzI0NwpDaGFuZ2UtSWQ6IEk0ZTQ2NjMxNjVmZDIxMzA3MzU2NTJkZDVjZjUzZDgwMTQyN2YwYjJlCihjaGVycnkgcGlja2VkIGZyb20gY29tbWl0IDJmYjNlMDMwYmJkZGE5OGUxMzQ4MWY2ZDgyNGNiYjU5ZGNlYzJmZjEpCg==

View File

@ -1,152 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Diff - 51e09571eef7a6a36c238130575fc11b291afff3^! - kernel/msm.git - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.HLL9TqKl0YYybSzmT_wTdw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/kernel/msm.git/%2B/51e09571eef7a6a36c238130575fc11b291afff3%255E%2521/">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/kernel/">kernel</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm.git/">msm.git</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm.git/+/51e09571eef7a6a36c238130575fc11b291afff3%5E%21/">51e09571eef7a6a36c238130575fc11b291afff3^!</a> / <span class="Breadcrumbs-crumb">.</span></div><div class="u-monospace Metadata"><table><tr><th class="Metadata-title">commit</th><td>51e09571eef7a6a36c238130575fc11b291afff3</td><td><span>[<a href="/kernel/msm.git/+log/51e09571eef7a6a36c238130575fc11b291afff3/">log</a>]</span> <span>[<a href="/kernel/msm.git/+archive/51e09571eef7a6a36c238130575fc11b291afff3/.tar.gz">tgz</a>]</span></td></tr><tr><th class="Metadata-title">author</th><td>Nick Desaulniers &lt;ndesaulniers@google.com&gt;</td><td>Fri Feb 10 10:54:56 2017 -0800</td></tr><tr><th class="Metadata-title">committer</th><td>John Dias &lt;joaodias@google.com&gt;</td><td>Wed Feb 15 20:53:36 2017 +0000</td></tr><tr><th class="Metadata-title">tree</th><td><a href="/kernel/msm.git/+/51e09571eef7a6a36c238130575fc11b291afff3/">d8ba7e3a5de3bd46ca42b0fa541e087dc5a20426</a></td></tr><tr><th class="Metadata-title">parent</th><td><a href="/kernel/msm.git/+/51e09571eef7a6a36c238130575fc11b291afff3%5E">3f41af6608b7ed506d3982b57cf34c70ff098f09</a> <span>[<a href="/kernel/msm.git/+/51e09571eef7a6a36c238130575fc11b291afff3%5E%21/">diff</a>]</span></td></tr></table></div><pre class="u-pre u-monospace MetadataMessage">ANDROID: ion: Protect kref from userspace manipulation
This separates the kref for ion handles into two components.
Userspace requests through the ioctl will hold at most one
reference to the internally used kref. All additional requests
will increment a separate counter, and the original reference is
only put once that counter hits 0. This protects the kernel from
a poorly behaving userspace.
Bug: 34276203
Change-Id: <a href="https://android-review.googlesource.com/#/q/Ibc36bc4405788ed0fea7337b541cad3be2b934c0">Ibc36bc4405788ed0fea7337b541cad3be2b934c0</a>
Signed-off-by: Daniel Rosenberg &lt;drosen@google.com&gt;
</pre><pre class="u-pre u-monospace Diff"><a name="F0" class="Diff-fileIndex"></a>diff --git <a href="/kernel/msm.git/+/3f41af6608b7ed506d3982b57cf34c70ff098f09/drivers/staging/android/ion/ion.c">a/drivers/staging/android/ion/ion.c</a> <a href="/kernel/msm.git/+/51e09571eef7a6a36c238130575fc11b291afff3/drivers/staging/android/ion/ion.c">b/drivers/staging/android/ion/ion.c</a>
index ee1c2f3..e99ea9a 100755
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
</pre><pre class="u-pre u-monospace Diff-unified"><span class="Diff-hunk">@@ -116,6 +116,7 @@
</span><span class="Diff-change"> */</span>
<span class="Diff-change"> struct ion_handle {</span>
<span class="Diff-change"> struct kref ref;</span>
<span class="Diff-insert">+ unsigned int user_ref_count;</span>
<span class="Diff-change"> struct ion_client *client;</span>
<span class="Diff-change"> struct ion_buffer *buffer;</span>
<span class="Diff-change"> struct rb_node node;</span>
<span class="Diff-hunk">@@ -429,6 +430,50 @@
</span><span class="Diff-change"> return ret;</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> </span>
<span class="Diff-insert">+/* Must hold the client lock */</span>
<span class="Diff-insert">+static void user_ion_handle_get(struct ion_handle *handle)</span>
<span class="Diff-insert">+{</span>
<span class="Diff-insert">+ if (handle-&gt;user_ref_count++ == 0) {</span>
<span class="Diff-insert">+ kref_get(&amp;handle-&gt;ref);</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-insert">+}</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+/* Must hold the client lock */</span>
<span class="Diff-insert">+static struct ion_handle* user_ion_handle_get_check_overflow(struct ion_handle *handle)</span>
<span class="Diff-insert">+{</span>
<span class="Diff-insert">+ if (handle-&gt;user_ref_count + 1 == 0)</span>
<span class="Diff-insert">+ return ERR_PTR(-EOVERFLOW);</span>
<span class="Diff-insert">+ user_ion_handle_get(handle);</span>
<span class="Diff-insert">+ return handle;</span>
<span class="Diff-insert">+}</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+/* passes a kref to the user ref count.</span>
<span class="Diff-insert">+ * We know we're holding a kref to the object before and</span>
<span class="Diff-insert">+ * after this call, so no need to reverify handle. */</span>
<span class="Diff-insert">+static struct ion_handle* pass_to_user(struct ion_handle *handle)</span>
<span class="Diff-insert">+{</span>
<span class="Diff-insert">+ struct ion_client *client = handle-&gt;client;</span>
<span class="Diff-insert">+ struct ion_handle *ret;</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ mutex_lock(&amp;client-&gt;lock);</span>
<span class="Diff-insert">+ ret = user_ion_handle_get_check_overflow(handle);</span>
<span class="Diff-insert">+ ion_handle_put_nolock(handle);</span>
<span class="Diff-insert">+ mutex_unlock(&amp;client-&gt;lock);</span>
<span class="Diff-insert">+ return ret;</span>
<span class="Diff-insert">+}</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+/* Must hold the client lock */</span>
<span class="Diff-insert">+static int user_ion_handle_put_nolock(struct ion_handle *handle)</span>
<span class="Diff-insert">+{</span>
<span class="Diff-insert">+ int ret;</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ if (--handle-&gt;user_ref_count == 0) {</span>
<span class="Diff-insert">+ ret = ion_handle_put_nolock(handle);</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ return ret;</span>
<span class="Diff-insert">+}</span>
<span class="Diff-insert">+</span>
<span class="Diff-change"> static struct ion_handle *ion_handle_lookup(struct ion_client *client,</span>
<span class="Diff-change"> struct ion_buffer *buffer)</span>
<span class="Diff-change"> {</span>
<span class="Diff-hunk">@@ -645,6 +690,24 @@
</span><span class="Diff-change"> ion_handle_put_nolock(handle);</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> </span>
<span class="Diff-insert">+static void user_ion_free_nolock(struct ion_client *client, struct ion_handle *handle)</span>
<span class="Diff-insert">+{</span>
<span class="Diff-insert">+ bool valid_handle;</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ BUG_ON(client != handle-&gt;client);</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ valid_handle = ion_handle_validate(client, handle);</span>
<span class="Diff-insert">+ if (!valid_handle) {</span>
<span class="Diff-insert">+ WARN(1, &quot;%s: invalid handle passed to free.\n&quot;, __func__);</span>
<span class="Diff-insert">+ return;</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-insert">+ if (!handle-&gt;user_ref_count &gt; 0) {</span>
<span class="Diff-insert">+ WARN(1, &quot;%s: User does not have access!\n&quot;, __func__);</span>
<span class="Diff-insert">+ return;</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-insert">+ user_ion_handle_put_nolock(handle);</span>
<span class="Diff-insert">+}</span>
<span class="Diff-insert">+</span>
<span class="Diff-change"> void ion_free(struct ion_client *client, struct ion_handle *handle)</span>
<span class="Diff-change"> {</span>
<span class="Diff-change"> BUG_ON(client != handle-&gt;client);</span>
<span class="Diff-hunk">@@ -1439,7 +1502,7 @@
</span><span class="Diff-change"> data.allocation.flags, true);</span>
<span class="Diff-change"> if (IS_ERR(handle))</span>
<span class="Diff-change"> return PTR_ERR(handle);</span>
<span class="Diff-delete">-</span>
<span class="Diff-insert">+ pass_to_user(handle);</span>
<span class="Diff-change"> data.allocation.handle = handle-&gt;id;</span>
<span class="Diff-change"> </span>
<span class="Diff-change"> cleanup_handle = handle;</span>
<span class="Diff-hunk">@@ -1455,7 +1518,7 @@
</span><span class="Diff-change"> mutex_unlock(&amp;client-&gt;lock);</span>
<span class="Diff-change"> return PTR_ERR(handle);</span>
<span class="Diff-change"> }</span>
<span class="Diff-delete">- ion_free_nolock(client, handle);</span>
<span class="Diff-insert">+ user_ion_free_nolock(client, handle);</span>
<span class="Diff-change"> ion_handle_put_nolock(handle);</span>
<span class="Diff-change"> mutex_unlock(&amp;client-&gt;lock);</span>
<span class="Diff-change"> break;</span>
<span class="Diff-hunk">@@ -1478,10 +1541,15 @@
</span><span class="Diff-change"> {</span>
<span class="Diff-change"> struct ion_handle *handle;</span>
<span class="Diff-change"> handle = ion_import_dma_buf(client, data.fd.fd);</span>
<span class="Diff-delete">- if (IS_ERR(handle))</span>
<span class="Diff-insert">+ if (IS_ERR(handle)) {</span>
<span class="Diff-change"> ret = PTR_ERR(handle);</span>
<span class="Diff-delete">- else</span>
<span class="Diff-delete">- data.handle.handle = handle-&gt;id;</span>
<span class="Diff-insert">+ } else {</span>
<span class="Diff-insert">+ handle = pass_to_user(handle);</span>
<span class="Diff-insert">+ if (IS_ERR(handle))</span>
<span class="Diff-insert">+ ret = PTR_ERR(handle);</span>
<span class="Diff-insert">+ else</span>
<span class="Diff-insert">+ data.handle.handle = handle-&gt;id;</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-change"> break;</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> case ION_IOC_SYNC:</span>
<span class="Diff-hunk">@@ -1518,8 +1586,10 @@
</span><span class="Diff-change"> if (dir &amp; _IOC_READ) {</span>
<span class="Diff-change"> if (copy_to_user((void __user *)arg, &amp;data, _IOC_SIZE(cmd))) {</span>
<span class="Diff-change"> if (cleanup_handle) {</span>
<span class="Diff-delete">- ion_free(client, cleanup_handle);</span>
<span class="Diff-delete">- ion_handle_put(cleanup_handle);</span>
<span class="Diff-insert">+ mutex_lock(&amp;client-&gt;lock);</span>
<span class="Diff-insert">+ user_ion_free_nolock(client, cleanup_handle);</span>
<span class="Diff-insert">+ ion_handle_put_nolock(cleanup_handle);</span>
<span class="Diff-insert">+ mutex_unlock(&amp;client-&gt;lock);</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> return -EFAULT;</span>
<span class="Diff-change"> }</span>
</pre></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

View File

@ -1 +0,0 @@
dHJlZSBhMzEwMTdjMTdlMDgxMDNlMTQzZTUxZTZjZjVjMzgyYTI0MjM4ZTM5CnBhcmVudCAwYTIxOTllN2ZmNGUwY2EwYmZkODI2MWIwNGQ1ZTg5ZDE5MzAyNjA2CmF1dGhvciBNYXJrIFNhbHl6eW4gPHNhbHl6eW5A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1ZDJkYWFmMDgwMjcwMDg4MjZlMGEyZjBiNmUyM2ZlYjNlZTgxN2ZlCg==

View File

@ -1,24 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Diff - 6a469209ac014b6d93f373e042500f6e8cd6a04a^! - kernel/msm - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.HLL9TqKl0YYybSzmT_wTdw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/kernel/msm/%2B/6a469209ac014b6d93f373e042500f6e8cd6a04a%255E%2521/">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/kernel/">kernel</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm/">msm</a> / <a class="Breadcrumbs-crumb" href="/kernel/msm/+/6a469209ac014b6d93f373e042500f6e8cd6a04a%5E%21/">6a469209ac014b6d93f373e042500f6e8cd6a04a^!</a> / <span class="Breadcrumbs-crumb">.</span></div><div class="u-monospace Metadata"><table><tr><th class="Metadata-title">commit</th><td>6a469209ac014b6d93f373e042500f6e8cd6a04a</td><td><span>[<a href="/kernel/msm/+log/6a469209ac014b6d93f373e042500f6e8cd6a04a/">log</a>]</span> <span>[<a href="/kernel/msm/+archive/6a469209ac014b6d93f373e042500f6e8cd6a04a/.tar.gz">tgz</a>]</span></td></tr><tr><th class="Metadata-title">author</th><td>Insun Song &lt;insun.song@broadcom.com&gt;</td><td>Wed May 03 16:20:41 2017 -0700</td></tr><tr><th class="Metadata-title">committer</th><td>Stuart Scott &lt;stuartscott@google.com&gt;</td><td>Tue May 16 20:12:20 2017 +0000</td></tr><tr><th class="Metadata-title">tree</th><td><a href="/kernel/msm/+/6a469209ac014b6d93f373e042500f6e8cd6a04a/">4d3e208308055cf10fab20c863fa3adfdaadb6fc</a></td></tr><tr><th class="Metadata-title">parent</th><td><a href="/kernel/msm/+/6a469209ac014b6d93f373e042500f6e8cd6a04a%5E">6cda862834f58f5cba217f445c00bb83aaa8a32a</a> <span>[<a href="/kernel/msm/+/6a469209ac014b6d93f373e042500f6e8cd6a04a%5E%21/">diff</a>]</span></td></tr></table></div><pre class="u-pre u-monospace MetadataMessage">net: wireless: bcmdhd: adding boundary check in wl_cfg80211_mgmt_tx
added boundary check for user-input parameter not to corrupt kernel
memmory.
Signed-off-by: Insun Song &lt;insun.song@broadcom.com&gt;
Bug: 35195787
Change-Id: <a href="https://android-review.googlesource.com/#/q/Ia497feae5f502c9a650e50a39fd0620fa976d908">Ia497feae5f502c9a650e50a39fd0620fa976d908</a>
</pre><pre class="u-pre u-monospace Diff"><a name="F0" class="Diff-fileIndex"></a>diff --git <a href="/kernel/msm/+/6cda862834f58f5cba217f445c00bb83aaa8a32a/drivers/net/wireless/bcmdhd/wl_cfg80211.c">a/drivers/net/wireless/bcmdhd/wl_cfg80211.c</a> <a href="/kernel/msm/+/6a469209ac014b6d93f373e042500f6e8cd6a04a/drivers/net/wireless/bcmdhd/wl_cfg80211.c">b/drivers/net/wireless/bcmdhd/wl_cfg80211.c</a>
index 9081988..a73b030 100644
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
</pre><pre class="u-pre u-monospace Diff-unified"><span class="Diff-hunk">@@ -5830,6 +5830,10 @@
</span><span class="Diff-change"> </span>
<span class="Diff-change"> WL_DBG((&quot;Enter \n&quot;));</span>
<span class="Diff-change"> </span>
<span class="Diff-insert">+ if (len &gt; (ACTION_FRAME_SIZE + DOT11_MGMT_HDR_LEN)) {</span>
<span class="Diff-insert">+ WL_ERR((&quot;bad length:%zu\n&quot;, len));</span>
<span class="Diff-insert">+ return BCME_BADARG;</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-change"> dev = cfgdev_to_wlc_ndev(cfgdev, cfg);</span>
<span class="Diff-change"> </span>
<span class="Diff-change"> /* set bsscfg idx for iovar (wlan0: P2PAPI_BSSCFG_PRIMARY, p2p: P2PAPI_BSSCFG_DEVICE) */</span>
</pre></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

View File

@ -1 +0,0 @@
dHJlZSA3OWY2Zjc0YzFjN2UwY2NhNzFmNDU0YmZhZGVhNmY1N2JmYmJhNjBjCnBhcmVudCBlN2Y2MjNhYTFiOGJhM2I4NDNjNzBlZWFlOTlhYWU5NWJkZGZlMDNkCmF1dGhvciBOaWNrIERlc2F1bG5pZXJzIDxuZGVzYXVsbmllcnNAZ29vZ2xlLmNvbT4gMTQ5MzkyOTU0NCAtMDcwMApjb21taXR0ZXIgQW5kcmV3IENoYW50IDxhY2hhbnRAZ29vZ2xlLmNvbT4gMTQ5NDk5MDY5MiArMDAwMAoKUmV2ZXJ0ICJwcm9jOiBzbWFwczogQWxsb3cgc21hcHMgYWNjZXNzIGZvciBDQVBfU1lTX1JFU09VUkNFIgoKVGhpcyByZXZlcnRzIGNvbW1pdCBmMGNlMGVlZTZiNzFiYzMxMDE1M2VkYjg3ZTY2ZTZiMjVlMTJmZWNlLgoKQnVnOiAzNDk1MTg2NApCdWc6IDM2NDY4NDQ3CkNoYW5nZS1JZDogSTg3YmQ5MmUwOTZjNmMyOGE1M2I5ZWNmMzAyYWUwMDhmNWU1OGViYTEKU2lnbmVkLW9mZi1ieTogTmljayBEZXNhdWxuaWVycyA8bmRlc2F1bG5pZX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Q5Njg2NzM0NCArMDAwMAoKdHJhY2luZzogZml4IHJhY2UgY29uZGl0aW9uIHJlYWRpbmcgc2F2ZWQgdGdpZHMKCkNvbW1pdCA5MzljN2E0ZjA0ZmMgKCJ0cmFjaW5nOiBJbnRyb2R1Y2Ugc2F2ZWRfY21kbGluZXNfc2l6ZSBmaWxlIikKaW50cm9kdWNlZCBhYmlsaXR5IHRvIGNoYW5nZSBzYXZlZCBjbWRsaW5lcyBzaXplLiBUaGlzIHJlc2l6ZWQgc2F2ZWQKY29tbWFuZCBsaW5lcyBidXQgbWlzc2VkIHJlc2l6aW5nIHRnaWQgbWFwcGluZyBhcyB3ZWxsLgoKQW5vdGhlciBpc3N1ZSBpcyB0aGF0IHdoZW4gdGhlIHJlc2l6ZSBoYXBwZW5zLCBpdCByZW1vdmVzIHNhdmVkIGNvbW1hbmQKbGluZXMgYW5kIHJlYWxsb2NhdGVzIG5ldyBtZW1vcnkgZm9yIGl0LiBUaGlzIGludHJvZHVjZWQgYSByYWNlCmNvbmRpdGlvbiB3aGVuIHJlYWRpbmcgdGhlIGdsb2JhbCBzYXZlY21kIGFzIHRoaXMgY2FuIGJlIGZyZWVkIGluIHRoZQptaWRkbGUgb2YgYWNjZXNzaW5nIGl0IGNhdXNpbmcgYSB1c2UgYWZ0ZXIgZnJlZSBhY2Nlc3MuIEZpeCB0aGlzIGJ5CmltcGxlbWVudGluZyBsb2NraW5nLgoKU2lnbmVkLW9mZi1ieTogQWRyaWFuIFNhbGlkbyA8c2FsaWRvYUBnb29nbGUuY29tPgpCdWc6IDM2MDA3NzM1CkNoYW5nZS1JZDogSTMzNDc5MWFjMzVmOGJjYmQzNDM2MmVkMTEyYWE2MjQyNzVhNDY5NDcK

View File

@ -1,78 +0,0 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Diff - be671c7e17454b4f144a8e05268a6071748a8791^! - kernel/common - Git at Google</title><link rel="stylesheet" type="text/css" href="/+static/base.HLL9TqKl0YYybSzmT_wTdw.cache.css"><!-- default customHeadTagPart --></head><body class="Site"><header class="Site-header"><div class="Header"><a class="Header-image" href="/"><img src="//www.gstatic.com/images/branding/lockups/2x/lockup_git_color_108x24dp.png" width="108" height="24" alt="Google Git"></a><div class="Header-menu"> <a class="Header-menuItem" href="https://accounts.google.com/AccountChooser?service=gerritcodereview&amp;continue=https://android.googlesource.com/login/kernel/common/%2B/be671c7e17454b4f144a8e05268a6071748a8791%255E%2521/">Sign in</a> </div></div></header><div class="Site-content"><div class="Container "><div class="Breadcrumbs"><a class="Breadcrumbs-crumb" href="/?format=HTML">android</a> / <a class="Breadcrumbs-crumb" href="/kernel/">kernel</a> / <a class="Breadcrumbs-crumb" href="/kernel/common/">common</a> / <a class="Breadcrumbs-crumb" href="/kernel/common/+/be671c7e17454b4f144a8e05268a6071748a8791%5E%21/">be671c7e17454b4f144a8e05268a6071748a8791^!</a> / <span class="Breadcrumbs-crumb">.</span></div><div class="u-monospace Metadata"><table><tr><th class="Metadata-title">commit</th><td>be671c7e17454b4f144a8e05268a6071748a8791</td><td><span>[<a href="/kernel/common/+log/be671c7e17454b4f144a8e05268a6071748a8791/">log</a>]</span> <span>[<a href="/kernel/common/+archive/be671c7e17454b4f144a8e05268a6071748a8791/.tar.gz">tgz</a>]</span></td></tr><tr><th class="Metadata-title">author</th><td>Eric Dumazet &lt;edumazet@google.com&gt;</td><td>Tue Feb 14 09:03:51 2017 -0800</td></tr><tr><th class="Metadata-title">committer</th><td>Daniel Rosenberg &lt;drosen@google.com&gt;</td><td>Wed Jun 28 16:12:27 2017 -0700</td></tr><tr><th class="Metadata-title">tree</th><td><a href="/kernel/common/+/be671c7e17454b4f144a8e05268a6071748a8791/">7d6651acb88f24380c4371dd42644dc7417c5cf6</a></td></tr><tr><th class="Metadata-title">parent</th><td><a href="/kernel/common/+/be671c7e17454b4f144a8e05268a6071748a8791%5E">bd64c0db093a25b3a58eca9742f8d442fd376d2a</a> <span>[<a href="/kernel/common/+/be671c7e17454b4f144a8e05268a6071748a8791%5E%21/">diff</a>]</span></td></tr></table></div><pre class="u-pre u-monospace MetadataMessage">UPSTREAM: packet: fix races in fanout_add()
commit d199fab63c11998a602205f7ee7ff7c05c97164b upstream.
Multiple threads can call fanout_add() at the same time.
We need to grab fanout_mutex earlier to avoid races that could
lead to one thread freeing po-&gt;rollover that was set by another thread.
Do the same in fanout_release(), for peace of mind, and to help us
finding lockdep issues earlier.
[js] no rollover in 3.12
Fixes: dc99f600698d (&quot;packet: Add fanout support.&quot;)
Fixes: 0648ab70afe6 (&quot;packet: rollover prepare: per-socket state&quot;)
Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Willem de Bruijn &lt;willemb@google.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Willy Tarreau &lt;w@1wt.eu&gt;
(cherry picked from commit 2a272abc4e543f488b3a73292ee75a06f20d077a)
Bug: 37897645
Change-Id: <a href="https://android-review.googlesource.com/#/q/I3b021869ee26b88d10f4d6408ce34d351543ce74">I3b021869ee26b88d10f4d6408ce34d351543ce74</a>
</pre><pre class="u-pre u-monospace Diff"><a name="F0" class="Diff-fileIndex"></a>diff --git <a href="/kernel/common/+/bd64c0db093a25b3a58eca9742f8d442fd376d2a/net/packet/af_packet.c">a/net/packet/af_packet.c</a> <a href="/kernel/common/+/be671c7e17454b4f144a8e05268a6071748a8791/net/packet/af_packet.c">b/net/packet/af_packet.c</a>
index 05cfee7..2ae5ae2 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
</pre><pre class="u-pre u-monospace Diff-unified"><span class="Diff-hunk">@@ -1429,13 +1429,16 @@
</span><span class="Diff-change"> return -EINVAL;</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> </span>
<span class="Diff-delete">- if (!po-&gt;running)</span>
<span class="Diff-delete">- return -EINVAL;</span>
<span class="Diff-delete">-</span>
<span class="Diff-delete">- if (po-&gt;fanout)</span>
<span class="Diff-delete">- return -EALREADY;</span>
<span class="Diff-delete">-</span>
<span class="Diff-change"> mutex_lock(&amp;fanout_mutex);</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ err = -EINVAL;</span>
<span class="Diff-insert">+ if (!po-&gt;running)</span>
<span class="Diff-insert">+ goto out;</span>
<span class="Diff-insert">+</span>
<span class="Diff-insert">+ err = -EALREADY;</span>
<span class="Diff-insert">+ if (po-&gt;fanout)</span>
<span class="Diff-insert">+ goto out;</span>
<span class="Diff-insert">+</span>
<span class="Diff-change"> match = NULL;</span>
<span class="Diff-change"> list_for_each_entry(f, &amp;fanout_list, list) {</span>
<span class="Diff-change"> if (f-&gt;id == id &amp;&amp;</span>
<span class="Diff-hunk">@@ -1491,17 +1494,16 @@
</span><span class="Diff-change"> struct packet_sock *po = pkt_sk(sk);</span>
<span class="Diff-change"> struct packet_fanout *f;</span>
<span class="Diff-change"> </span>
<span class="Diff-delete">- f = po-&gt;fanout;</span>
<span class="Diff-delete">- if (!f)</span>
<span class="Diff-delete">- return;</span>
<span class="Diff-delete">-</span>
<span class="Diff-change"> mutex_lock(&amp;fanout_mutex);</span>
<span class="Diff-delete">- po-&gt;fanout = NULL;</span>
<span class="Diff-insert">+ f = po-&gt;fanout;</span>
<span class="Diff-insert">+ if (f) {</span>
<span class="Diff-insert">+ po-&gt;fanout = NULL;</span>
<span class="Diff-change"> </span>
<span class="Diff-delete">- if (atomic_dec_and_test(&amp;f-&gt;sk_ref)) {</span>
<span class="Diff-delete">- list_del(&amp;f-&gt;list);</span>
<span class="Diff-delete">- dev_remove_pack(&amp;f-&gt;prot_hook);</span>
<span class="Diff-delete">- kfree(f);</span>
<span class="Diff-insert">+ if (atomic_dec_and_test(&amp;f-&gt;sk_ref)) {</span>
<span class="Diff-insert">+ list_del(&amp;f-&gt;list);</span>
<span class="Diff-insert">+ dev_remove_pack(&amp;f-&gt;prot_hook);</span>
<span class="Diff-insert">+ kfree(f);</span>
<span class="Diff-insert">+ }</span>
<span class="Diff-change"> }</span>
<span class="Diff-change"> mutex_unlock(&amp;fanout_mutex);</span>
<span class="Diff-change"> }</span>
</pre></div> <!-- Container --></div> <!-- Site-content --><!-- default customFooter --><footer class="Site-footer"><div class="Footer"><span class="Footer-poweredBy">Powered by <a href="https://gerrit.googlesource.com/gitiles/">Gitiles</a></span><span class="Footer-formats"><a class="u-monospace Footer-formatsItem" href="?format=TEXT">txt</a> <a class="u-monospace Footer-formatsItem" href="?format=JSON">json</a></span></div></footer></body></html>

View File

@ -1 +0,0 @@
dHJlZSBjOTQ3NDNhNDAzZWI0MmJlMjI5Y2QzMGE3NTFkOGU2YzRmZjg0MmYxCnBhcmVudCA3YjkxZDk3ODM5YThjZWU3NmU3M2RlMTFkMTdiYTQ3MGE3N2UwMTdiCmF1dGhvciBBbmRyZXkgS29ub3ZhbG92IDxhbmRyZXlrbnZsQGdvb2dsZS5jb20+IDE0OTA3OTY2ODAgKzAyMDAKY29tbWl0dGVyIEdyZWcgS3JvYWgtSGFydG1hbiA8Z3JlZ2toQGxpbnV4Zm91bmRhdGlvbi5vcmc+IDE0OTI0OTQ5NTIgKzAyMDAKCm5ldC9wYWNrZXQ6IGZpeCBvdmVyZmxvdyBpbiBjaGVjayBmb3IgcHJpdiBhcmVhIHNpemUKCmNvbW1pdCAyYjY4NjdjMmNlNzZjNTk2Njc2YmVjN2QyZDUyNWFmNTI1ZmRjNmUyIHVwc3RyZWFtLgoKU3VidHJhY3RpbmcgdHBfc2l6ZW9mX3ByaXYgZnJvbSB0cF9ibG9ja19zaXplIGFuZCBjYXN0aW5nIHRvIGludAp0byBjaGVjayB3aGV0aGVyIG9uZSBpcyBsZXNzIHRoZW4gdGhlIG90aGVyIGRvZXNuJ3QgYWx3YXlzIHdvcmsKKGJvdGggb2YgdGhlbSBhcmUgdW5zaWduZWQgaW50cykuCgpDb21wYXJlIHRoZW0gYXMgaXMgaW5zdGVhZC4KCkFsc28gY2FzdCB0cF9zaXplb2ZfcHJp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penter <dan.carpenter@oracle.com>
Date: Wed, 5 Sep 2012 15:32:18 +0300
Subject: [PATCH] ALSA: compress_core: integer overflow in
snd_compr_allocate_buffer()
These are 32 bit values that come from the user, we need to check for
integer overflows or we could end up allocating a smaller buffer than
expected.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/compress_offload.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index eb60cb8dbb8a6..68fe02c7400a2 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -407,6 +407,10 @@ static int snd_compr_allocate_buffer(struct snd_compr_stream *stream,
unsigned int buffer_size;
void *buffer;
+ if (params->buffer.fragment_size == 0 ||
+ params->buffer.fragments > SIZE_MAX / params->buffer.fragment_size)
+ return -EINVAL;
+
buffer_size = params->buffer.fragment_size * params->buffer.fragments;
if (stream->ops->copy) {
buffer = NULL;

Some files were not shown because too many files have changed in this diff Show More