mirror of
https://git.yoctoproject.org/poky
synced 2026-01-30 05:18:43 +01:00
Compare commits
197 Commits
3.4_M1
...
jethro-14.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1f23d1254 | ||
|
|
7fe17a2942 | ||
|
|
50700a7da6 | ||
|
|
1f0e615bec | ||
|
|
dc5f155e15 | ||
|
|
ef135112fd | ||
|
|
ae57ea03c6 | ||
|
|
eb9666a3e2 | ||
|
|
5b12268f6e | ||
|
|
a3a374a639 | ||
|
|
f4341a9b6f | ||
|
|
35f4306ed4 | ||
|
|
3e8a07b901 | ||
|
|
5ffc3267e7 | ||
|
|
5cc5f99bba | ||
|
|
21a816c73a | ||
|
|
6a0fbfaeb5 | ||
|
|
d57aaf7a39 | ||
|
|
941874ae29 | ||
|
|
d74a3cb765 | ||
|
|
12fae23964 | ||
|
|
67ac9d6254 | ||
|
|
5812fc9e20 | ||
|
|
3de249206e | ||
|
|
79de8cf5fa | ||
|
|
a23d2625e2 | ||
|
|
b6def81ff5 | ||
|
|
db0f8ac8b3 | ||
|
|
c8122a088f | ||
|
|
cdeb2415dd | ||
|
|
52cd219877 | ||
|
|
a88d6cb170 | ||
|
|
4e74b36458 | ||
|
|
66807731c7 | ||
|
|
4c075e7114 | ||
|
|
ee52ac6e85 | ||
|
|
e9f95df962 | ||
|
|
e63bab1a09 | ||
|
|
64a492097f | ||
|
|
5b043dafa3 | ||
|
|
655c8a5c9d | ||
|
|
96fda8c8f6 | ||
|
|
ae037d974e | ||
|
|
26eb877e18 | ||
|
|
e632cdb031 | ||
|
|
e8c96131d9 | ||
|
|
108ea6d05f | ||
|
|
9a88c1d255 | ||
|
|
443b09a61d | ||
|
|
6c910685ec | ||
|
|
9fd2349842 | ||
|
|
5a40d9fb69 | ||
|
|
1bbf18385b | ||
|
|
2ec6d1dcbc | ||
|
|
55aafb547d | ||
|
|
029948bc8e | ||
|
|
2bcf141c77 | ||
|
|
cc3a391bd9 | ||
|
|
049be17b53 | ||
|
|
5e94ac7ba9 | ||
|
|
7ee1828d30 | ||
|
|
ca6ec2e392 | ||
|
|
b55a677699 | ||
|
|
4922f470dd | ||
|
|
3ec0e95fed | ||
|
|
942ce53beb | ||
|
|
ce8ae1c164 | ||
|
|
080e027d14 | ||
|
|
c6ae9c1fae | ||
|
|
049b7db30c | ||
|
|
d632a923dc | ||
|
|
5b993ed429 | ||
|
|
27ee5b4f0e | ||
|
|
a4134af78b | ||
|
|
e10ec6f3be | ||
|
|
a5a965d409 | ||
|
|
2fb7ee2628 | ||
|
|
b9ad87b18f | ||
|
|
0a1c63ad6b | ||
|
|
d4b400e1c7 | ||
|
|
8c8c4ede3f | ||
|
|
b83220257a | ||
|
|
dd0ba9ea4a | ||
|
|
325d205769 | ||
|
|
53b114b55f | ||
|
|
02be35d1ad | ||
|
|
f5551f85aa | ||
|
|
aa179aeede | ||
|
|
20007c87b2 | ||
|
|
2dd7f469f5 | ||
|
|
81cc737056 | ||
|
|
2b1dce5a3c | ||
|
|
a6f52930a6 | ||
|
|
e79a538a54 | ||
|
|
b171076f46 | ||
|
|
255115f6e4 | ||
|
|
3f691055c5 | ||
|
|
5ba94af1e6 | ||
|
|
d03d145410 | ||
|
|
00ff950d3c | ||
|
|
22446c6f44 | ||
|
|
8597a616f3 | ||
|
|
95cc641ec3 | ||
|
|
84d48acb01 | ||
|
|
4369329b76 | ||
|
|
4c3191f9ab | ||
|
|
caca77eb17 | ||
|
|
383159ef64 | ||
|
|
be40baa5a0 | ||
|
|
a897bfdbdc | ||
|
|
9c4b61e919 | ||
|
|
4c07dd2172 | ||
|
|
83b72d8d1f | ||
|
|
44639bd817 | ||
|
|
a0be9bd862 | ||
|
|
53f0290658 | ||
|
|
f4b0c49145 | ||
|
|
fb409c9d17 | ||
|
|
55d097a106 | ||
|
|
8e6b2d6823 | ||
|
|
332eb1dcce | ||
|
|
cbc4e832d1 | ||
|
|
c4b71e1a6a | ||
|
|
fdea03df12 | ||
|
|
6fc1109f5d | ||
|
|
9eb4ce0a81 | ||
|
|
6880f826c3 | ||
|
|
7dcaa840ff | ||
|
|
435139b2a9 | ||
|
|
5f49c0a248 | ||
|
|
a29ec8108e | ||
|
|
b1e980f33b | ||
|
|
ed8269010c | ||
|
|
9a620dada4 | ||
|
|
f8280717e4 | ||
|
|
49858bdc02 | ||
|
|
d2134528a6 | ||
|
|
fec97f6fa2 | ||
|
|
3b4f65968e | ||
|
|
61a7de097a | ||
|
|
82c0072033 | ||
|
|
f181e72cb8 | ||
|
|
4b5d4ca1c9 | ||
|
|
d2ea8f1041 | ||
|
|
02ef437608 | ||
|
|
3653b17aea | ||
|
|
8879571d11 | ||
|
|
eeda3c66a2 | ||
|
|
dee9fbe044 | ||
|
|
d001d46d17 | ||
|
|
777451ca43 | ||
|
|
cb0ca7264d | ||
|
|
8970ad60f5 | ||
|
|
4f7fdd0a59 | ||
|
|
3b7df55075 | ||
|
|
f3d7c3f385 | ||
|
|
96b1b5c127 | ||
|
|
7aecb577e0 | ||
|
|
75ca2c8682 | ||
|
|
02c7b3f271 | ||
|
|
003c94f7d9 | ||
|
|
ad6db0121f | ||
|
|
f0d87fea69 | ||
|
|
35f34a61b3 | ||
|
|
3b77e205c0 | ||
|
|
e2d441275d | ||
|
|
ef69078072 | ||
|
|
4700e404f3 | ||
|
|
743ee049b8 | ||
|
|
8a3deca4a4 | ||
|
|
0073b234d7 | ||
|
|
71dbbcd0c8 | ||
|
|
41f1026849 | ||
|
|
38e3c6e6dd | ||
|
|
b99ec284c4 | ||
|
|
c670dc77fe | ||
|
|
b968190e84 | ||
|
|
1278753c37 | ||
|
|
7b25b70884 | ||
|
|
d9423fbd54 | ||
|
|
347347ad78 | ||
|
|
5935783f21 | ||
|
|
7fdad70111 | ||
|
|
0cb2fa5f73 | ||
|
|
5b52e9b086 | ||
|
|
59bdde4327 | ||
|
|
8ad2bcca49 | ||
|
|
c3087bd977 | ||
|
|
d2bf9fb2ca | ||
|
|
0556c58bff | ||
|
|
e683dac7ab | ||
|
|
092757ec5b | ||
|
|
dab55553b2 | ||
|
|
1753d4a5da | ||
|
|
9dd3422bc6 | ||
|
|
1401976a02 | ||
|
|
a54a0dba10 |
@@ -955,7 +955,7 @@ def try_mirror_url(fetch, origud, ud, ld, check = False):
|
||||
origud.method.download(origud, ld)
|
||||
if hasattr(origud.method,"build_mirror_data"):
|
||||
origud.method.build_mirror_data(origud, ld)
|
||||
return ud.localpath
|
||||
return origud.localpath
|
||||
# Otherwise the result is a local file:// and we symlink to it
|
||||
if not os.path.exists(origud.localpath):
|
||||
if os.path.islink(origud.localpath):
|
||||
|
||||
@@ -376,3 +376,206 @@ do_functionname() {
|
||||
(updated, newlines) = bb.utils.edit_metadata(self._origfile.splitlines(True), varlist, handle_var)
|
||||
self.assertTrue(updated, 'List should be updated but isn\'t')
|
||||
self.assertEqual(newlines, newfile5.splitlines(True))
|
||||
|
||||
|
||||
class EditBbLayersConf(unittest.TestCase):
|
||||
|
||||
def _test_bblayers_edit(self, before, after, add, remove, notadded, notremoved):
|
||||
with tempfile.NamedTemporaryFile('w', delete=False) as tf:
|
||||
tf.write(before)
|
||||
tf.close()
|
||||
try:
|
||||
actual_notadded, actual_notremoved = bb.utils.edit_bblayers_conf(tf.name, add, remove)
|
||||
with open(tf.name) as f:
|
||||
actual_after = f.readlines()
|
||||
self.assertEqual(after.splitlines(True), actual_after)
|
||||
self.assertEqual(notadded, actual_notadded)
|
||||
self.assertEqual(notremoved, actual_notremoved)
|
||||
finally:
|
||||
os.remove(tf.name)
|
||||
|
||||
|
||||
def test_bblayers_remove(self):
|
||||
before = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/subpath/layer3 \
|
||||
/home/user/path/layer4 \
|
||||
"
|
||||
"""
|
||||
after = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/subpath/layer3 \
|
||||
/home/user/path/layer4 \
|
||||
"
|
||||
"""
|
||||
self._test_bblayers_edit(before, after,
|
||||
None,
|
||||
'/home/user/path/layer2',
|
||||
[],
|
||||
[])
|
||||
|
||||
|
||||
def test_bblayers_add(self):
|
||||
before = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/subpath/layer3 \
|
||||
/home/user/path/layer4 \
|
||||
"
|
||||
"""
|
||||
after = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/subpath/layer3 \
|
||||
/home/user/path/layer4 \
|
||||
/other/path/to/layer5 \
|
||||
"
|
||||
"""
|
||||
self._test_bblayers_edit(before, after,
|
||||
'/other/path/to/layer5/',
|
||||
None,
|
||||
[],
|
||||
[])
|
||||
|
||||
|
||||
def test_bblayers_add_remove(self):
|
||||
before = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/subpath/layer3 \
|
||||
/home/user/path/layer4 \
|
||||
"
|
||||
"""
|
||||
after = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/layer4 \
|
||||
/other/path/to/layer5 \
|
||||
"
|
||||
"""
|
||||
self._test_bblayers_edit(before, after,
|
||||
['/other/path/to/layer5', '/home/user/path/layer2/'], '/home/user/path/subpath/layer3/',
|
||||
['/home/user/path/layer2'],
|
||||
[])
|
||||
|
||||
|
||||
def test_bblayers_add_remove_home(self):
|
||||
before = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
~/path/layer1 \
|
||||
~/path/layer2 \
|
||||
~/otherpath/layer3 \
|
||||
~/path/layer4 \
|
||||
"
|
||||
"""
|
||||
after = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS = " \
|
||||
~/path/layer2 \
|
||||
~/path/layer4 \
|
||||
~/path2/layer5 \
|
||||
"
|
||||
"""
|
||||
self._test_bblayers_edit(before, after,
|
||||
[os.environ['HOME'] + '/path/layer4', '~/path2/layer5'],
|
||||
[os.environ['HOME'] + '/otherpath/layer3', '~/path/layer1', '~/path/notinlist'],
|
||||
[os.environ['HOME'] + '/path/layer4'],
|
||||
['~/path/notinlist'])
|
||||
|
||||
|
||||
def test_bblayers_add_remove_plusequals(self):
|
||||
before = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS += " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
"
|
||||
"""
|
||||
after = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS += " \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/layer3 \
|
||||
"
|
||||
"""
|
||||
self._test_bblayers_edit(before, after,
|
||||
'/home/user/path/layer3',
|
||||
'/home/user/path/layer1',
|
||||
[],
|
||||
[])
|
||||
|
||||
|
||||
def test_bblayers_add_remove_plusequals2(self):
|
||||
before = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS += " \
|
||||
/home/user/path/layer1 \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/layer3 \
|
||||
"
|
||||
BBLAYERS += "/home/user/path/layer4"
|
||||
BBLAYERS += "/home/user/path/layer5"
|
||||
"""
|
||||
after = r"""
|
||||
# A comment
|
||||
|
||||
BBPATH = "${TOPDIR}"
|
||||
BBFILES ?= ""
|
||||
BBLAYERS += " \
|
||||
/home/user/path/layer2 \
|
||||
/home/user/path/layer3 \
|
||||
"
|
||||
BBLAYERS += "/home/user/path/layer5"
|
||||
BBLAYERS += "/home/user/otherpath/layer6"
|
||||
"""
|
||||
self._test_bblayers_edit(before, after,
|
||||
['/home/user/otherpath/layer6', '/home/user/path/layer3'], ['/home/user/path/layer1', '/home/user/path/layer4', '/home/user/path/layer7'],
|
||||
['/home/user/path/layer3'],
|
||||
['/home/user/path/layer7'])
|
||||
|
||||
@@ -1177,7 +1177,7 @@ def edit_metadata(meta_lines, variables, varfunc, match_overrides=False):
|
||||
if not skip:
|
||||
if checkspc:
|
||||
checkspc = False
|
||||
if newlines[-1] == '\n' and line == '\n':
|
||||
if newlines and newlines[-1] == '\n' and line == '\n':
|
||||
# Squash blank line if there are two consecutive blanks after a removal
|
||||
continue
|
||||
newlines.append(line)
|
||||
@@ -1201,7 +1201,19 @@ def edit_metadata_file(meta_file, variables, varfunc):
|
||||
|
||||
|
||||
def edit_bblayers_conf(bblayers_conf, add, remove):
|
||||
"""Edit bblayers.conf, adding and/or removing layers"""
|
||||
"""Edit bblayers.conf, adding and/or removing layers
|
||||
Parameters:
|
||||
bblayers_conf: path to bblayers.conf file to edit
|
||||
add: layer path (or list of layer paths) to add; None or empty
|
||||
list to add nothing
|
||||
remove: layer path (or list of layer paths) to remove; None or
|
||||
empty list to remove nothing
|
||||
Returns a tuple:
|
||||
notadded: list of layers specified to be added but weren't
|
||||
(because they were already in the list)
|
||||
notremoved: list of layers that were specified to be removed
|
||||
but weren't (because they weren't in the list)
|
||||
"""
|
||||
|
||||
import fnmatch
|
||||
|
||||
@@ -1210,6 +1222,13 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
|
||||
pth = pth[:-1]
|
||||
return pth
|
||||
|
||||
approved = bb.utils.approved_variables()
|
||||
def canonicalise_path(pth):
|
||||
pth = remove_trailing_sep(pth)
|
||||
if 'HOME' in approved and '~' in pth:
|
||||
pth = os.path.expanduser(pth)
|
||||
return pth
|
||||
|
||||
def layerlist_param(value):
|
||||
if not value:
|
||||
return []
|
||||
@@ -1218,49 +1237,80 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
|
||||
else:
|
||||
return [remove_trailing_sep(value)]
|
||||
|
||||
notadded = []
|
||||
notremoved = []
|
||||
|
||||
addlayers = layerlist_param(add)
|
||||
removelayers = layerlist_param(remove)
|
||||
|
||||
# Need to use a list here because we can't set non-local variables from a callback in python 2.x
|
||||
bblayercalls = []
|
||||
removed = []
|
||||
plusequals = False
|
||||
orig_bblayers = []
|
||||
|
||||
def handle_bblayers_firstpass(varname, origvalue, op, newlines):
|
||||
bblayercalls.append(op)
|
||||
if op == '=':
|
||||
del orig_bblayers[:]
|
||||
orig_bblayers.extend([canonicalise_path(x) for x in origvalue.split()])
|
||||
return (origvalue, None, 2, False)
|
||||
|
||||
def handle_bblayers(varname, origvalue, op, newlines):
|
||||
bblayercalls.append(varname)
|
||||
updated = False
|
||||
bblayers = [remove_trailing_sep(x) for x in origvalue.split()]
|
||||
if removelayers:
|
||||
for removelayer in removelayers:
|
||||
matched = False
|
||||
for layer in bblayers:
|
||||
if fnmatch.fnmatch(layer, removelayer):
|
||||
if fnmatch.fnmatch(canonicalise_path(layer), canonicalise_path(removelayer)):
|
||||
updated = True
|
||||
matched = True
|
||||
bblayers.remove(layer)
|
||||
removed.append(removelayer)
|
||||
break
|
||||
if not matched:
|
||||
notremoved.append(removelayer)
|
||||
if addlayers:
|
||||
if addlayers and not plusequals:
|
||||
for addlayer in addlayers:
|
||||
if addlayer not in bblayers:
|
||||
updated = True
|
||||
bblayers.append(addlayer)
|
||||
else:
|
||||
notadded.append(addlayer)
|
||||
del addlayers[:]
|
||||
|
||||
if updated:
|
||||
if op == '+=' and not bblayers:
|
||||
bblayers = None
|
||||
return (bblayers, None, 2, False)
|
||||
else:
|
||||
return (origvalue, None, 2, False)
|
||||
|
||||
edit_metadata_file(bblayers_conf, ['BBLAYERS'], handle_bblayers)
|
||||
with open(bblayers_conf, 'r') as f:
|
||||
(_, newlines) = edit_metadata(f, ['BBLAYERS'], handle_bblayers_firstpass)
|
||||
|
||||
if not bblayercalls:
|
||||
raise Exception('Unable to find BBLAYERS in %s' % bblayers_conf)
|
||||
|
||||
# Try to do the "smart" thing depending on how the user has laid out
|
||||
# their bblayers.conf file
|
||||
if bblayercalls.count('+=') > 1:
|
||||
plusequals = True
|
||||
|
||||
removelayers_canon = [canonicalise_path(layer) for layer in removelayers]
|
||||
notadded = []
|
||||
for layer in addlayers:
|
||||
layer_canon = canonicalise_path(layer)
|
||||
if layer_canon in orig_bblayers and not layer_canon in removelayers_canon:
|
||||
notadded.append(layer)
|
||||
notadded_canon = [canonicalise_path(layer) for layer in notadded]
|
||||
addlayers[:] = [layer for layer in addlayers if canonicalise_path(layer) not in notadded_canon]
|
||||
|
||||
(updated, newlines) = edit_metadata(newlines, ['BBLAYERS'], handle_bblayers)
|
||||
if addlayers:
|
||||
# Still need to add these
|
||||
for addlayer in addlayers:
|
||||
newlines.append('BBLAYERS += "%s"\n' % addlayer)
|
||||
updated = True
|
||||
|
||||
if updated:
|
||||
with open(bblayers_conf, 'w') as f:
|
||||
f.writelines(newlines)
|
||||
|
||||
notremoved = list(set(removelayers) - set(removed))
|
||||
|
||||
return (notadded, notremoved)
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdExcep
|
||||
from bldcontrol.models import BuildRequest, BuildEnvironment, BRError, BRVariable
|
||||
import os
|
||||
import logging
|
||||
import time
|
||||
|
||||
logger = logging.getLogger("ToasterScheduler")
|
||||
|
||||
@@ -128,6 +129,12 @@ class Command(NoArgsCommand):
|
||||
|
||||
|
||||
def handle_noargs(self, **options):
|
||||
self.cleanup()
|
||||
self.archive()
|
||||
self.schedule()
|
||||
while True:
|
||||
try:
|
||||
self.cleanup()
|
||||
self.archive()
|
||||
self.schedule()
|
||||
except:
|
||||
pass
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<legalnotice>
|
||||
<para>
|
||||
Permission is granted to copy, distribute and/or modify this document under
|
||||
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Non-Commercial-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons.
|
||||
the terms of the <ulink type="http" url="http://creativecommons.org/licenses/by-nc-sa/2.0/uk/">Creative Commons Attribution-Share Alike 2.0 UK: England & Wales</ulink> as published by Creative Commons.
|
||||
</para>
|
||||
<note>
|
||||
For the latest version of this manual associated with this
|
||||
|
||||
@@ -4558,9 +4558,17 @@
|
||||
option or the equivalent rootfs derived from the
|
||||
<filename>-e</filename> command-line
|
||||
option.
|
||||
Exactly what those contents and
|
||||
filesystem type end up being are dependent
|
||||
on the given plugin implementation.
|
||||
Exactly what those contents and filesystem type end
|
||||
up being are dependent on the given plugin
|
||||
implementation.
|
||||
</para>
|
||||
<para>If you do not use the
|
||||
<filename>--source</filename> option, the
|
||||
<filename>wic</filename> command creates an empty
|
||||
partition.
|
||||
Consequently, you must use the
|
||||
<filename>--size</filename> option to specify the
|
||||
size of the empty partition.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>--ondisk</filename> or <filename>--ondrive</filename>:</emphasis>
|
||||
Forces the partition to be created on a particular
|
||||
@@ -4604,6 +4612,49 @@
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option that says to start a partition on an
|
||||
x KBytes boundary.</para></listitem>
|
||||
<listitem><para><emphasis><filename>--no-table</filename>:</emphasis>
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option.
|
||||
Using the option reserves space for the partition
|
||||
and causes it to become populated.
|
||||
However, the partition is not added to the
|
||||
partition table.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>--extra-space</filename>:</emphasis>
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option that adds extra space after the space
|
||||
filled by the content of the partition.
|
||||
The final size can go beyond the size specified
|
||||
by the <filename>--size</filename> option.
|
||||
The default value is 10 Mbytes.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>--overhead-factor</filename>:</emphasis>
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option that multiplies the size of the partition by
|
||||
the option's value.
|
||||
You must supply a value greater than or equal to
|
||||
"1".
|
||||
The default value is "1.3".
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>--part-type</filename>:</emphasis>
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option that specifies the partition type globally
|
||||
unique identifier (GUID) for GPT partitions.
|
||||
You can find the list of partition type GUIDs
|
||||
at
|
||||
<ulink url='http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs'></ulink>.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>--use-uuid</filename>:</emphasis>
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option that causes <filename>wic</filename> to
|
||||
generate a random GUID for the partition.
|
||||
The generated identifier is used in the bootloader
|
||||
configuration to specify the root partition.
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis><filename>--uuid</filename>:</emphasis>
|
||||
This option is a <filename>wic</filename>-specific
|
||||
option that specifies the partition UUID.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -197,28 +197,40 @@
|
||||
but also is not as easy to use or comprehensive
|
||||
as the default.
|
||||
</para></listitem>
|
||||
<listitem><para><filename>kvm</filename>:
|
||||
<listitem><para id='kvm-cond'><filename>kvm</filename>:
|
||||
Enables KVM when running "qemux86" or "qemux86-64"
|
||||
QEMU architectures.
|
||||
For KVM to work, all the following conditions must be met:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Your <replaceable>MACHINE</replaceable> must be either
|
||||
"qemux86" or "qemux86-64".
|
||||
qemux86" or "qemux86-64".
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Your build host has to have the KVM modules
|
||||
installed, which are
|
||||
<filename>/dev/kvm</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Your build host has to have virtio net device, which
|
||||
are <filename>/dev/vhost-net</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The build host <filename>/dev/kvm</filename>
|
||||
directory has to be both writable and readable.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para></listitem>
|
||||
<listitem><para><filename>kvm-vhost</filename>:
|
||||
Enables KVM with VHOST support when running "qemux86" or "qemux86-64"
|
||||
QEMU architectures.
|
||||
For KVM with VHOST to work, the following conditions must
|
||||
be met:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
<link linkend='kvm-cond'>kvm</link> option
|
||||
conditions must be met.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Your build host has to have virtio net device, which
|
||||
are <filename>/dev/vhost-net</filename>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The build host <filename>/dev/vhost-net</filename>
|
||||
directory has to be either readable or writable
|
||||
|
||||
BIN
documentation/mega-manual/figures/add-variable.png
Normal file
BIN
documentation/mega-manual/figures/add-variable.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 108 KiB |
BIN
documentation/mega-manual/figures/bash-oecore.png
Normal file
BIN
documentation/mega-manual/figures/bash-oecore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 135 KiB |
BIN
documentation/mega-manual/figures/set-variable.png
Normal file
BIN
documentation/mega-manual/figures/set-variable.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
BIN
documentation/mega-manual/figures/variable-added.png
Normal file
BIN
documentation/mega-manual/figures/variable-added.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
@@ -2,7 +2,7 @@
|
||||
<!ENTITY DISTRO_COMPRESSED "20">
|
||||
<!ENTITY DISTRO_NAME "jethro">
|
||||
<!ENTITY YOCTO_DOC_VERSION "2.0">
|
||||
<!ENTITY POKYVERSION "15.0.0">
|
||||
<!ENTITY POKYVERSION "14.0.0">
|
||||
<!ENTITY POKYVERSION_COMPRESSED "1400">
|
||||
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
|
||||
<!ENTITY COPYRIGHT_YEAR "2010-2015">
|
||||
@@ -67,4 +67,5 @@
|
||||
<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
|
||||
diffstat makeinfo python-curses patch socat">
|
||||
<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat">
|
||||
diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat \
|
||||
perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue">
|
||||
|
||||
@@ -154,11 +154,14 @@
|
||||
<listitem><para>Ubuntu 13.10</para></listitem> -->
|
||||
<listitem><para>Ubuntu 14.04 (LTS)</para></listitem>
|
||||
<listitem><para>Ubuntu 14.10</para></listitem>
|
||||
<listitem><para>Ubuntu 15.04</para></listitem>
|
||||
<listitem><para>Ubuntu 15.10</para></listitem>
|
||||
<!-- <listitem><para>Fedora 16 (Verne)</para></listitem>
|
||||
<listitem><para>Fedora 17 (Spherical)</para></listitem>
|
||||
<listitem><para>Fedora release 19 (Schrödinger's Cat)</para></listitem>
|
||||
<listitem><para>Fedora release 20 (Heisenbug)</para></listitem> -->
|
||||
<listitem><para>Fedora release 21</para></listitem>
|
||||
<listitem><para>Fedora release 22</para></listitem>
|
||||
<!-- <listitem><para>CentOS release 5.6 (Final)</para></listitem>
|
||||
<listitem><para>CentOS release 5.7 (Final)</para></listitem>
|
||||
<listitem><para>CentOS release 5.8 (Final)</para></listitem>
|
||||
@@ -281,7 +284,7 @@
|
||||
support or if you are going to use the Eclipse
|
||||
IDE:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install SDL-devel xterm perl-Thread-Queue
|
||||
$ sudo dnf install SDL-devel xterm
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Documentation:</emphasis>
|
||||
Packages needed if you are going to build out the
|
||||
@@ -356,14 +359,14 @@
|
||||
The following list shows the required packages by function
|
||||
given a supported CentOS Linux distribution:
|
||||
<note>
|
||||
For CentOS 6.x, some of the versions of the components
|
||||
provided by the distribution are too old (e.g. Git, Python,
|
||||
and tar).
|
||||
It is recommended that you install the buildtools in order
|
||||
to provide versions that will work with the OpenEmbedded
|
||||
build system.
|
||||
For information on how to install the buildtools tarball,
|
||||
see the
|
||||
For CentOS 6.x, some of the versions
|
||||
of the components provided by the distribution are
|
||||
too old (e.g. Git, Python, and tar).
|
||||
It is recommended that you install the buildtools
|
||||
in order to provide versions that will work with
|
||||
the OpenEmbedded build system.
|
||||
For information on how to install the buildtools
|
||||
tarball, see the
|
||||
"<link linkend='required-git-tar-and-python-versions'>Required Git, Tar, and Python Versions</link>"
|
||||
section.
|
||||
</note>
|
||||
@@ -372,33 +375,42 @@
|
||||
Packages needed to build an image for a headless
|
||||
system:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install &CENTOS_HOST_PACKAGES_ESSENTIAL;
|
||||
$ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL;
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
||||
Packages recommended if the host system has graphics
|
||||
support or if you are going to use the Eclipse
|
||||
IDE:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install SDL-devel xterm
|
||||
$ sudo yum install SDL-devel xterm
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>Documentation:</emphasis>
|
||||
Packages needed if you are going to build out the
|
||||
Yocto Project documentation manuals:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install make docbook-style-dsssl docbook-style-xsl \
|
||||
$ sudo yum install make docbook-style-dsssl docbook-style-xsl \
|
||||
docbook-dtds docbook-utils fop libxslt dblatex xmlto xsltproc
|
||||
</literallayout></para></listitem>
|
||||
<listitem><para><emphasis>ADT Installer Extras:</emphasis>
|
||||
Packages needed if you are going to be using the
|
||||
<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Application Development Toolkit (ADT) Installer</ulink>:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install autoconf automake libtool glib2-devel libarchive-devel
|
||||
</literallayout></para></listitem>
|
||||
$ sudo yum install autoconf automake libtool glib2-devel libarchive-devel
|
||||
</literallayout>
|
||||
<note>
|
||||
For CentOS 6.x, in order for the
|
||||
ADT installer script to work, you must have
|
||||
installed the <filename>liblzma5</filename>,
|
||||
<filename>libarchive3.x</filename>, and
|
||||
<filename>libarchive-devel-3.1.3</filename>
|
||||
(or older) packages, in that order.
|
||||
</note>
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
||||
Packages needed if you are going to run
|
||||
<filename>oe-selftest</filename>:
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install GitPython
|
||||
$ sudo yum install GitPython
|
||||
</literallayout>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
|
||||
@@ -2343,8 +2343,10 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For further details, please see
|
||||
<ulink url='https://gcc.gnu.org/gcc-5/changes.html'></ulink>.
|
||||
For further details, see
|
||||
<ulink url='https://gcc.gnu.org/gcc-5/changes.html'></ulink> and
|
||||
the porting guide at
|
||||
<ulink url='https://gcc.gnu.org/gcc-5/porting_to.html'></ulink>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
@@ -5768,32 +5768,45 @@
|
||||
Specifies the complete list of supported image types
|
||||
by default:
|
||||
<literallayout class='monospaced'>
|
||||
jffs2
|
||||
jffs2.sum
|
||||
cramfs
|
||||
ext2
|
||||
ext2.gz
|
||||
ext2.bz2
|
||||
ext3
|
||||
ext3.gz
|
||||
ext2.lzma
|
||||
btrfs
|
||||
live
|
||||
squashfs
|
||||
squashfs-xz
|
||||
ubi
|
||||
ubifs
|
||||
tar
|
||||
tar.gz
|
||||
tar.bz2
|
||||
tar.xz
|
||||
cpio
|
||||
cpio.gz
|
||||
cpio.xz
|
||||
cpio.lz4
|
||||
cpio.lzma
|
||||
cpio.xz
|
||||
cramfs
|
||||
elf
|
||||
ext2
|
||||
ext2.bz2
|
||||
ext2.gz
|
||||
ext2.lzma
|
||||
ext3
|
||||
ext3.gz
|
||||
ext4
|
||||
ext4.gz
|
||||
hdddirect
|
||||
hddimg
|
||||
iso
|
||||
jffs2
|
||||
jffs2.sum
|
||||
multiubi
|
||||
qcow2
|
||||
squashfs
|
||||
squashfs-lzo
|
||||
squashfs-xz
|
||||
tar
|
||||
tar.bz2
|
||||
tar.gz
|
||||
tar.lz4
|
||||
tar.xz
|
||||
ubi
|
||||
ubifs
|
||||
vdi
|
||||
vmdk
|
||||
elf
|
||||
wic
|
||||
wic.bz2
|
||||
wic.gz
|
||||
wic.lzma
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
|
||||
@@ -662,7 +662,6 @@
|
||||
"IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
|
||||
"IMAGE_INSTALL_append": "",
|
||||
"PACKAGE_CLASSES": "package_rpm",
|
||||
"SDKMACHINE" : "x86_64"
|
||||
},
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
@@ -318,6 +318,7 @@
|
||||
'PASSWORD': 'yourpasswordhere',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '3306',
|
||||
}
|
||||
}
|
||||
</literallayout>
|
||||
</para></listitem>
|
||||
@@ -347,7 +348,7 @@
|
||||
server defined earlier:
|
||||
<literallayout class='monospaced'>
|
||||
$ mysql -u root -p
|
||||
mysql> CREATE DATABASE toaster;
|
||||
mysql> CREATE DATABASE toaster_data;
|
||||
mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
|
||||
mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
|
||||
mysql> quit
|
||||
@@ -358,9 +359,9 @@
|
||||
default data, and gather the statically-served files:
|
||||
<literallayout class='monospaced'>
|
||||
$ cd /var/www/toaster/poky/
|
||||
$ ./bitbake/lib/toaster/manage.py syncdb --migrate
|
||||
$ ./bitbake/lib/toaster/manage.py loadconf ./meta-yocto/conf/toasterconf.json
|
||||
$ ./bitbake/lib/toaster/manage.py lsupdates
|
||||
$ ./bitbake/lib/toaster/manage.py syncdb
|
||||
$ ./bitbake/lib/toaster/manage.py migrate
|
||||
$ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-yocto/conf/toasterconf.json ./bitbake/lib/toaster/manage.py checksettings
|
||||
$ ./bitbake/lib/toaster/manage.py collectstatic
|
||||
</literallayout>
|
||||
</para>
|
||||
@@ -368,33 +369,41 @@
|
||||
<para>
|
||||
For the above set of commands, after moving to the
|
||||
<filename>poky</filename> directory,
|
||||
the <filename>syncdb</filename> command with the
|
||||
<filename>migrate</filename> option makes sure the database
|
||||
the <filename>syncdb</filename> and <filename>migrate</filename>
|
||||
commands ensure the database
|
||||
schema has had changes propagated correctly (i.e.
|
||||
migrations).
|
||||
See the
|
||||
<ulink url='https://south.readthedocs.org/en/latest/commands.html#syncdb'><filename>syncdb</filename></ulink>
|
||||
command for more information.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The
|
||||
<link linkend='toaster-command-loadconf'><filename>loadconf</filename></link>
|
||||
command loads the
|
||||
<filename>./meta-yocto/conf/toasterconf.json</filename>
|
||||
JSON file.
|
||||
The next line sets the Toaster root directory
|
||||
<filename>TOASTER_DIR</filename> and the location of
|
||||
the Toaster configuration file
|
||||
<filename>TOASTER_CONF</filename>, which is
|
||||
relative to the Toaster root directory
|
||||
<filename>TOASTER_DIR</filename>.
|
||||
For more information on the Toaster configuration file
|
||||
<filename>TOASTER_CONF</filename>, see the
|
||||
<link linkend='toaster-json-files'>JSON Files</link>
|
||||
section of this manual.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The <filename>lsupdates</filename> command fetches
|
||||
information about machines, recipes and
|
||||
layers available as part of OpenEmbedded.
|
||||
The information is fetched from the
|
||||
<ulink url='http://layers.openembedded.org/'>OpenEmbedded Metadata Index</ulink>.
|
||||
This information provides easy access to metadata
|
||||
from Toaster, and it is key for Toaster's usability.
|
||||
It is not recommended that you use Toaster without
|
||||
fetching this information."
|
||||
This line also runs the <filename>checksettings</filename>
|
||||
command, which configures the location of the Toaster
|
||||
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build directory</ulink>.
|
||||
The Toaster root directory <filename>TOASTER_DIR</filename>
|
||||
determines where the Toaster build directory
|
||||
is created on the file system.
|
||||
In the example above,
|
||||
<filename>TOASTER_DIR</filename> is set as follows:
|
||||
<literallayout class="monospaced">
|
||||
/var/www/toaster/poky
|
||||
</literallayout>
|
||||
This setting causes the Toaster build directory to be:
|
||||
<literallayout class="monospaced">
|
||||
/var/www/toaster/poky/build
|
||||
</literallayout>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -402,8 +411,6 @@
|
||||
is a Django framework command that collects all the
|
||||
statically served files into a designated directory to
|
||||
be served up by the Apache web server.
|
||||
For more information on this Django command, see
|
||||
<ulink url='https://docs.djangoproject.com/en/1.7/ref/contrib/staticfiles/'></ulink>.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Add an Apache configuration file for Toaster to your Apache web
|
||||
@@ -438,6 +445,7 @@
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo a2enmod wsgi
|
||||
$ sudo a2enconf toaster
|
||||
$ chmod +x bitbake/lib/toaster/toastermain/wsgi.py
|
||||
</literallayout>
|
||||
Finally, restart Apache to make sure all new configuration
|
||||
is loaded.
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
</para></listitem>
|
||||
<listitem><para><emphasis>CentOS</emphasis>
|
||||
<literallayout class='monospaced'>
|
||||
$ sudo dnf install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
|
||||
$ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
|
||||
</literallayout>
|
||||
<note>
|
||||
CentOS 6.x users need to ensure that the required
|
||||
|
||||
@@ -13,7 +13,7 @@ XSERVER ?= "${XSERVER_X86_BASE} \
|
||||
${XSERVER_X86_MODESETTING} \
|
||||
"
|
||||
|
||||
MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d eee-acpi-scripts"
|
||||
MACHINE_EXTRA_RRECOMMENDS += "linux-firmware eee-acpi-scripts"
|
||||
|
||||
GLIBC_ADDONS = "nptl"
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
|
||||
KMACHINE_genericx86 ?= "common-pc"
|
||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||
|
||||
SRCREV_machine_genericx86 ?= "af1f7f586bd32d39c057f17606991b887eadb389"
|
||||
SRCREV_machine_genericx86-64 ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
||||
SRCREV_machine_genericx86 ?= "d9bf859dfae6f88b88b157119c20ae4d5e51420a"
|
||||
SRCREV_machine_genericx86-64 ?= "93b2b800d85c1565af7d96f3776dc38c85ae1902"
|
||||
SRCREV_machine_edgerouter ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
||||
SRCREV_machine_beaglebone ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
||||
SRCREV_machine_mpc8315e-rdb ?= "1cb1bbaf63cecc918cf36c89819a7464af4c4b13"
|
||||
@@ -18,3 +18,6 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
|
||||
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
||||
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
|
||||
COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
|
||||
|
||||
LINUX_VERSION_genericx86 = "3.14.39"
|
||||
LINUX_VERSION_genericx86-64 = "3.14.39"
|
||||
|
||||
@@ -7,8 +7,8 @@ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
|
||||
KMACHINE_genericx86 ?= "common-pc"
|
||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||
|
||||
SRCREV_machine_genericx86 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
||||
SRCREV_machine_genericx86-64 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
||||
SRCREV_machine_genericx86 ?= "1583bf79b946cd5581d84d8c369b819a5ecb94b4"
|
||||
SRCREV_machine_genericx86-64 ?= "1583bf79b946cd5581d84d8c369b819a5ecb94b4"
|
||||
SRCREV_machine_edgerouter ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
||||
SRCREV_machine_beaglebone ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
||||
SRCREV_machine_mpc8315e-rdb ?= "2893f3e8ece72f6f47329714d6afe4c9c545bbf9"
|
||||
|
||||
@@ -7,8 +7,8 @@ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
|
||||
KMACHINE_genericx86 ?= "common-pc"
|
||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||
|
||||
SRCREV_machine_genericx86 ?= "dbe692d91c8e55d1430f2c45fd578c8e4e71e482"
|
||||
SRCREV_machine_genericx86-64 ?= "dbe692d91c8e55d1430f2c45fd578c8e4e71e482"
|
||||
SRCREV_machine_genericx86 ?= "2e0ac7b6c4e3ada23a84756287e9b7051ace939a"
|
||||
SRCREV_machine_genericx86-64 ?= "2e0ac7b6c4e3ada23a84756287e9b7051ace939a"
|
||||
SRCREV_machine_edgerouter ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
|
||||
SRCREV_machine_beaglebone ?= "efb6ffb2ca96a364f916c9890ad023fc595e0e6e"
|
||||
SRCREV_machine_mpc8315e-rdb ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
|
||||
@@ -18,3 +18,6 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
|
||||
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
||||
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
|
||||
COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
|
||||
|
||||
LINUX_VERSION_genericx86 = "4.1.17"
|
||||
LINUX_VERSION_genericx86-64 = "4.1.17"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
DISTRO = "poky"
|
||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||
DISTRO_VERSION = "2.0"
|
||||
DISTRO_VERSION = "2.0.1"
|
||||
DISTRO_CODENAME = "jethro"
|
||||
SDK_VENDOR = "-pokysdk"
|
||||
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
||||
|
||||
@@ -27,6 +27,10 @@ python () {
|
||||
d.setVar("PACKAGE_EXTRA_ARCHS", "")
|
||||
d.setVar("SDK_ARCH", "none")
|
||||
d.setVar("SDK_CC_ARCH", "none")
|
||||
d.setVar("TARGET_CPPFLAGS", "none")
|
||||
d.setVar("TARGET_CFLAGS", "none")
|
||||
d.setVar("TARGET_CXXFLAGS", "none")
|
||||
d.setVar("TARGET_LDFLAGS", "none")
|
||||
|
||||
# Avoid this being unnecessarily different due to nuances of
|
||||
# the target machine that aren't important for "all" arch
|
||||
|
||||
@@ -77,16 +77,20 @@ CONFIGUREOPTS = " --build=${BUILD_SYS} \
|
||||
${@append_libtool_sysroot(d)}"
|
||||
CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
|
||||
|
||||
AUTOTOOLS_SCRIPT_PATH ?= "${S}"
|
||||
CONFIGURE_SCRIPT ?= "${AUTOTOOLS_SCRIPT_PATH}/configure"
|
||||
|
||||
AUTOTOOLS_AUXDIR ?= "${AUTOTOOLS_SCRIPT_PATH}"
|
||||
|
||||
oe_runconf () {
|
||||
cfgscript="${S}/configure"
|
||||
cfgscript="${CONFIGURE_SCRIPT}"
|
||||
if [ -x "$cfgscript" ] ; then
|
||||
bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
|
||||
set +e
|
||||
${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
|
||||
if [ "$?" != "0" ]; then
|
||||
echo "Configure failed. The contents of all config.log files follows to aid debugging"
|
||||
find ${S} -ignore_readdir_race -name config.log -print -exec cat {} \;
|
||||
find ${B} -ignore_readdir_race -name config.log -print -exec cat {} \;
|
||||
die "oe_runconf failed"
|
||||
fi
|
||||
set -e
|
||||
@@ -95,8 +99,6 @@ oe_runconf () {
|
||||
fi
|
||||
}
|
||||
|
||||
AUTOTOOLS_AUXDIR ?= "${S}"
|
||||
|
||||
CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
|
||||
|
||||
autotools_preconfigure() {
|
||||
@@ -134,7 +136,7 @@ do_configure[postfuncs] += "autotools_postconfigure"
|
||||
ACLOCALDIR = "${B}/aclocal-copy"
|
||||
|
||||
python autotools_copy_aclocals () {
|
||||
s = d.getVar("S", True)
|
||||
s = d.getVar("AUTOTOOLS_SCRIPT_PATH", True)
|
||||
if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
|
||||
if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
|
||||
return
|
||||
@@ -228,13 +230,13 @@ autotools_do_configure() {
|
||||
( for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do
|
||||
rm -f `dirname $ac`/configure
|
||||
done )
|
||||
if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
|
||||
if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
|
||||
olddir=`pwd`
|
||||
cd ${S}
|
||||
cd ${AUTOTOOLS_SCRIPT_PATH}
|
||||
ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
|
||||
if [ x"${acpaths}" = xdefault ]; then
|
||||
acpaths=
|
||||
for i in `find ${S} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
|
||||
for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
|
||||
grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
|
||||
acpaths="$acpaths -I $i"
|
||||
done
|
||||
@@ -265,21 +267,20 @@ autotools_do_configure() {
|
||||
bbnote Executing glib-gettextize --force --copy
|
||||
echo "no" | glib-gettextize --force --copy
|
||||
fi
|
||||
else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
|
||||
elif grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
|
||||
# We'd call gettextize here if it wasn't so broken...
|
||||
cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
|
||||
if [ -d ${S}/po/ ]; then
|
||||
cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
|
||||
if [ ! -e ${S}/po/remove-potcdate.sin ]; then
|
||||
cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
|
||||
fi
|
||||
cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
|
||||
if [ -d ${S}/po/ ]; then
|
||||
cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
|
||||
if [ ! -e ${S}/po/remove-potcdate.sin ]; then
|
||||
cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
|
||||
fi
|
||||
for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
|
||||
for j in `find ${S} -ignore_readdir_race -name $i | grep -v aclocal-copy`; do
|
||||
rm $j
|
||||
done
|
||||
done
|
||||
fi
|
||||
for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
|
||||
for j in `find ${S} -ignore_readdir_race -name $i | grep -v aclocal-copy`; do
|
||||
rm $j
|
||||
done
|
||||
done
|
||||
fi
|
||||
mkdir -p m4
|
||||
if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
|
||||
@@ -290,7 +291,7 @@ autotools_do_configure() {
|
||||
ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
|
||||
cd $olddir
|
||||
fi
|
||||
if [ -e ${S}/configure ]; then
|
||||
if [ -e ${CONFIGURE_SCRIPT} ]; then
|
||||
oe_runconf
|
||||
else
|
||||
bbnote "nothing to configure"
|
||||
|
||||
@@ -521,7 +521,7 @@ POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_targ
|
||||
POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host ;\
|
||||
buildhistory_get_sdk_installed_host ; "
|
||||
|
||||
SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "
|
||||
SDK_POSTPROCESS_COMMAND_append = " buildhistory_get_sdkinfo ; "
|
||||
|
||||
def buildhistory_get_build_id(d):
|
||||
if d.getVar('BB_WORKERCONTEXT', True) != '1':
|
||||
|
||||
@@ -271,9 +271,9 @@ python do_checkpkg() {
|
||||
from bb.fetch2 import FetchError, NoMethodError, decodeurl
|
||||
|
||||
"""first check whether a uri is provided"""
|
||||
src_uri = d.getVar('SRC_URI', True)
|
||||
src_uri = (d.getVar('SRC_URI', True) or '').split()
|
||||
if src_uri:
|
||||
uri_type, _, _, _, _, _ = decodeurl(src_uri)
|
||||
uri_type, _, _, _, _, _ = decodeurl(src_uri[0])
|
||||
else:
|
||||
uri_type = "none"
|
||||
|
||||
|
||||
@@ -21,7 +21,9 @@ def map_kernel_arch(a, d):
|
||||
|
||||
valid_archs = d.getVar('valid_archs', True).split()
|
||||
|
||||
if re.match('(i.86|athlon|x86.64)$', a): return 'x86'
|
||||
if re.match('i.86$', a): return 'i386'
|
||||
elif re.match('x86.64$', a): return 'x86_64'
|
||||
elif re.match('athlon$', a): return 'x86'
|
||||
elif re.match('armeb$', a): return 'arm'
|
||||
elif re.match('aarch64$', a): return 'arm64'
|
||||
elif re.match('aarch64_be$', a): return 'arm64'
|
||||
|
||||
@@ -184,11 +184,18 @@ do_kernel_checkout() {
|
||||
source_dir=`echo ${S} | sed 's%/$%%'`
|
||||
source_workdir="${WORKDIR}/git"
|
||||
if [ -d "${WORKDIR}/git/" ]; then
|
||||
# case: git repository (bare or non-bare)
|
||||
# case: git repository
|
||||
# if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
|
||||
if [ "${source_dir}" != "${source_workdir}" ]; then
|
||||
rm -rf ${S}
|
||||
mv ${WORKDIR}/git ${S}
|
||||
if [ -d "${source_workdir}/.git" ]; then
|
||||
# regular git repository with .git
|
||||
rm -rf ${S}
|
||||
mv ${WORKDIR}/git ${S}
|
||||
else
|
||||
# create source for bare cloned git repository
|
||||
git clone ${WORKDIR}/git ${S}
|
||||
rm -rf ${WORKDIR}/git
|
||||
fi
|
||||
fi
|
||||
cd ${S}
|
||||
else
|
||||
|
||||
@@ -309,9 +309,18 @@ do_shared_workdir () {
|
||||
cp -fR include/generated/* $kerneldir/include/generated/
|
||||
fi
|
||||
|
||||
if [ -d arch/${ARCH}/include/generated ]; then
|
||||
mkdir -p $kerneldir/arch/${ARCH}/include/generated/
|
||||
cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
|
||||
# When ARCH is set to i386 or x86_64, we need to map ARCH to the real name of src
|
||||
# dir (x86) under arch/ of kenrel tree, so that we can find correct source to copy.
|
||||
|
||||
if [ "${ARCH}" = "i386" ] || [ "${ARCH}" = "x86_64" ]; then
|
||||
KERNEL_SRCARCH=x86
|
||||
else
|
||||
KERNEL_SRCARCH=${ARCH}
|
||||
fi
|
||||
|
||||
if [ -d arch/${KERNEL_SRCARCH}/include/generated ]; then
|
||||
mkdir -p $kerneldir/arch/${KERNEL_SRCARCH}/include/generated/
|
||||
cp -fR arch/${KERNEL_SRCARCH}/include/generated/* $kerneldir/arch/${KERNEL_SRCARCH}/include/generated/
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -474,6 +474,7 @@ do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
|
||||
do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/"
|
||||
|
||||
ROOTFS_POSTPROCESS_COMMAND_prepend = "write_package_manifest; license_create_manifest; "
|
||||
do_rootfs[recrdeptask] += "do_populate_lic"
|
||||
|
||||
do_populate_lic_setscene[dirs] = "${LICSSTATEDIR}/${PN}"
|
||||
do_populate_lic_setscene[cleandirs] = "${LICSSTATEDIR}"
|
||||
|
||||
@@ -65,19 +65,19 @@ def base_get_metadata_svn_revision(path, d):
|
||||
return revision
|
||||
|
||||
def base_get_metadata_git_branch(path, d):
|
||||
import subprocess
|
||||
import bb.process
|
||||
|
||||
try:
|
||||
return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
||||
cwd=path).strip()
|
||||
except:
|
||||
return "<unknown>"
|
||||
rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path)
|
||||
except bb.process.ExecutionError:
|
||||
rev = '<unknown>'
|
||||
return rev.strip()
|
||||
|
||||
def base_get_metadata_git_revision(path, d):
|
||||
import subprocess
|
||||
import bb.process
|
||||
|
||||
try:
|
||||
return subprocess.check_output(["git", "rev-parse", "HEAD"],
|
||||
cwd=path).strip()
|
||||
except:
|
||||
return "<unknown>"
|
||||
rev, _ = bb.process.run('git rev-parse HEAD', cwd=path)
|
||||
except bb.process.ExecutionError:
|
||||
rev = '<unknown>'
|
||||
return rev.strip()
|
||||
|
||||
@@ -51,7 +51,7 @@ python copy_buildsystem () {
|
||||
core_meta_subdir = ''
|
||||
|
||||
# Copy in all metadata layers + bitbake (as repositories)
|
||||
buildsystem = oe.copy_buildsystem.BuildSystem(d)
|
||||
buildsystem = oe.copy_buildsystem.BuildSystem('extensible SDK', d)
|
||||
baseoutpath = d.getVar('SDK_OUTPUT', True) + '/' + d.getVar('SDKPATH', True)
|
||||
layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers')
|
||||
|
||||
@@ -155,7 +155,7 @@ python copy_buildsystem () {
|
||||
f.write('NATIVELSBSTRING_forcevariable = "%s"\n\n' % fixedlsbstring)
|
||||
|
||||
# Ensure locked sstate cache objects are re-used without error
|
||||
f.write('SIGGEN_LOCKEDSIGS_CHECK_LEVEL = "warn"\n\n')
|
||||
f.write('SIGGEN_LOCKEDSIGS_CHECK_LEVEL = "none"\n\n')
|
||||
|
||||
# If you define a sdk_extraconf() function then it can contain additional config
|
||||
extraconf = (d.getVar('sdk_extraconf', True) or '').strip()
|
||||
@@ -187,10 +187,7 @@ python copy_buildsystem () {
|
||||
}
|
||||
|
||||
def extsdk_get_buildtools_filename(d):
|
||||
# This is somewhat of a hack
|
||||
localdata = bb.data.createCopy(d)
|
||||
localdata.setVar('PN', 'buildtools-tarball')
|
||||
return localdata.expand('${SDK_NAME}-buildtools-nativesdk-standalone-*.sh')
|
||||
return '*-buildtools-nativesdk-standalone-*.sh'
|
||||
|
||||
install_tools() {
|
||||
install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
|
||||
@@ -222,7 +219,7 @@ SDK_PRE_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_preinst}"
|
||||
sdk_ext_postinst() {
|
||||
printf "\nExtracting buildtools...\n"
|
||||
cd $target_sdk_dir
|
||||
printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > /dev/null
|
||||
printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > /dev/null || ( printf 'ERROR: buildtools installation failed\n' ; exit 1 )
|
||||
|
||||
# Make sure when the user sets up the environment, they also get
|
||||
# the buildtools-tarball tools in their path.
|
||||
@@ -249,7 +246,8 @@ sdk_ext_postinst() {
|
||||
# dash which is /bin/sh on Ubuntu will not preserve the
|
||||
# current working directory when first ran, nor will it set $1 when
|
||||
# sourcing a script. That is why this has to look so ugly.
|
||||
sh -c ". buildtools/environment-setup* > preparing_build_system.log && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> preparing_build_system.log && $target_sdk_dir/ext-sdk-prepare.sh $target_sdk_dir '${SDK_TARGETS}' >> preparing_build_system.log 2>&1" || { echo "SDK preparation failed: see `pwd`/preparing_build_system.log" ; exit 1 ; }
|
||||
LOGFILE="$target_sdk_dir/preparing_build_system.log"
|
||||
sh -c ". buildtools/environment-setup* > $LOGFILE && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> $LOGFILE && $target_sdk_dir/ext-sdk-prepare.sh $target_sdk_dir '${SDK_TARGETS}' >> $LOGFILE 2>&1" || { echo "ERROR: SDK preparation failed: see $LOGFILE"; echo "printf 'ERROR: this SDK was not fully installed and needs reinstalling\n'" >> $env_setup_script ; exit 1 ; }
|
||||
fi
|
||||
rm -f $target_sdk_dir/ext-sdk-prepare.sh
|
||||
echo done
|
||||
@@ -260,6 +258,11 @@ SDK_POST_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_postinst}"
|
||||
SDK_POSTPROCESS_COMMAND_prepend_task-populate-sdk-ext = "copy_buildsystem; install_tools; "
|
||||
|
||||
fakeroot python do_populate_sdk_ext() {
|
||||
# FIXME hopefully we can remove this restriction at some point, but uninative
|
||||
# currently forces this upon us
|
||||
if d.getVar('SDK_ARCH', True) != d.getVar('BUILD_ARCH', True):
|
||||
bb.fatal('The extensible SDK can currently only be built for the same architecture as the machine being built on - SDK_ARCH is set to %s (likely via setting SDKMACHINE) which is different from the architecture of the build machine (%s). Unable to continue.' % (d.getVar('SDK_ARCH', True), d.getVar('BUILD_ARCH', True)))
|
||||
|
||||
bb.build.exec_func("do_populate_sdk", d)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ toolchain_create_sdk_env_script () {
|
||||
echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
|
||||
echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
|
||||
echo "export PYTHONHOME=$sdkpathnative$prefix" >> $script
|
||||
echo 'unset command_not_found_handle' >> $script
|
||||
|
||||
toolchain_shared_env_script
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
NATIVELSBSTRING = "universal"
|
||||
|
||||
UNINATIVE_LOADER = "${STAGING_DIR_NATIVE}/lib/ld-linux-x86-64.so.2"
|
||||
UNINATIVE_LOADER ?= "${@bb.utils.contains('BUILD_ARCH', 'x86_64', '${STAGING_DIR_NATIVE}/lib/ld-linux-x86-64.so.2', '${STAGING_DIR_NATIVE}/lib/ld-linux.so.2', d)}"
|
||||
|
||||
addhandler uninative_eventhandler
|
||||
uninative_eventhandler[eventmask] = "bb.event.BuildStarted"
|
||||
|
||||
@@ -101,9 +101,9 @@ fi
|
||||
|
||||
if [ "$SDK_EXTENSIBLE" = "1" ]; then
|
||||
# We're going to be running the build system, additional restrictions apply
|
||||
if echo "$target_sdk_dir" | grep -q '[+\ @]'; then
|
||||
if echo "$target_sdk_dir" | grep -q '[+\ @$]'; then
|
||||
echo "The target directory path ($target_sdk_dir) contains illegal" \
|
||||
"characters such as spaces, @ or +. Abort!"
|
||||
"characters such as spaces, @, \$ or +. Abort!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
@@ -169,9 +169,20 @@ echo "done"
|
||||
|
||||
printf "Setting it up..."
|
||||
# fix environment paths
|
||||
real_env_setup_script=""
|
||||
for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
|
||||
if grep -q 'OECORE_NATIVE_SYSROOT=' $env_setup_script; then
|
||||
# Handle custom env setup scripts that are only named
|
||||
# environment-setup-* so that they have relocation
|
||||
# applied - what we want beyond here is the main one
|
||||
# rather than the one that simply sorts last
|
||||
real_env_setup_script="$env_setup_script"
|
||||
fi
|
||||
$SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $env_setup_script
|
||||
done
|
||||
if [ -n "$real_env_setup_script" ] ; then
|
||||
env_setup_script="$real_env_setup_script"
|
||||
fi
|
||||
|
||||
@SDK_POST_INSTALL_COMMAND@
|
||||
|
||||
|
||||
@@ -14,8 +14,9 @@ def _smart_copy(src, dest):
|
||||
shutil.copymode(src, dest)
|
||||
|
||||
class BuildSystem(object):
|
||||
def __init__(self, d):
|
||||
def __init__(self, context, d):
|
||||
self.d = d
|
||||
self.context = context
|
||||
self.layerdirs = d.getVar('BBLAYERS', True).split()
|
||||
|
||||
def copy_bitbake_and_layers(self, destdir):
|
||||
@@ -38,7 +39,7 @@ class BuildSystem(object):
|
||||
if os.path.exists(layerconf):
|
||||
with open(layerconf, 'r') as f:
|
||||
if f.readline().startswith("# ### workspace layer auto-generated by devtool ###"):
|
||||
bb.warn("Skipping local workspace layer %s" % layer)
|
||||
bb.plain("NOTE: Excluding local workspace layer %s from %s" % (layer, self.context))
|
||||
continue
|
||||
|
||||
# If the layer was already under corebase, leave it there
|
||||
|
||||
@@ -1471,6 +1471,16 @@ class OpkgPM(PackageManager):
|
||||
self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True),
|
||||
arch))
|
||||
|
||||
if self.opkg_dir != '/var/lib/opkg':
|
||||
# There is no command line option for this anymore, we need to add
|
||||
# info_dir and status_file to config file, if OPKGLIBDIR doesn't have
|
||||
# the default value of "/var/lib" as defined in opkg:
|
||||
# libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info"
|
||||
# libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status"
|
||||
cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
|
||||
cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
|
||||
|
||||
|
||||
def _create_config(self):
|
||||
with open(self.config_file, "w+") as config_file:
|
||||
priority = 1
|
||||
@@ -1486,6 +1496,15 @@ class OpkgPM(PackageManager):
|
||||
config_file.write("src oe-%s file:%s\n" %
|
||||
(arch, pkgs_dir))
|
||||
|
||||
if self.opkg_dir != '/var/lib/opkg':
|
||||
# There is no command line option for this anymore, we need to add
|
||||
# info_dir and status_file to config file, if OPKGLIBDIR doesn't have
|
||||
# the default value of "/var/lib" as defined in opkg:
|
||||
# libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info"
|
||||
# libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status"
|
||||
config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'info'))
|
||||
config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR', True), 'opkg', 'status'))
|
||||
|
||||
def insert_feeds_uris(self):
|
||||
if self.feed_uris == "":
|
||||
return
|
||||
|
||||
@@ -582,7 +582,7 @@ class DevtoolTests(DevtoolBase):
|
||||
# Now try with auto mode
|
||||
runCmd('cd %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, os.path.basename(recipefile)))
|
||||
result = runCmd('devtool update-recipe %s' % testrecipe)
|
||||
result = runCmd('git rev-parse --show-toplevel')
|
||||
result = runCmd('git rev-parse --show-toplevel', cwd=os.path.dirname(recipefile))
|
||||
topleveldir = result.output.strip()
|
||||
relpatchpath = os.path.join(os.path.relpath(os.path.dirname(recipefile), topleveldir), testrecipe)
|
||||
expected_status = [(' M', os.path.relpath(recipefile, topleveldir)),
|
||||
|
||||
@@ -46,10 +46,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI_append += "file://appendtest.txt"
|
||||
"""
|
||||
layerappend = "BBLAYERS += \"COREBASE/meta-layertest0 COREBASE/meta-layertest1 COREBASE/meta-layertest2\""
|
||||
layerappend = ''
|
||||
|
||||
def tearDownLocal(self):
|
||||
ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
|
||||
if self.layerappend:
|
||||
ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
|
||||
|
||||
@testcase(1196)
|
||||
def test_layer_appends(self):
|
||||
@@ -79,7 +80,9 @@ SRC_URI_append += "file://appendtest.txt"
|
||||
with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
|
||||
f.write("Layer 2 test")
|
||||
self.track_for_cleanup(layer)
|
||||
ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
|
||||
|
||||
self.layerappend = "BBLAYERS += \"{0}/meta-layertest0 {0}/meta-layertest1 {0}/meta-layertest2\"".format(corebase)
|
||||
ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend)
|
||||
bitbake("layerappendtest")
|
||||
data = ftools.read_file(stagingdir + "/appendtest.txt")
|
||||
self.assertEqual(data, "Layer 2 test")
|
||||
|
||||
59
meta/recipes-bsp/grub/files/CVE-2015-8370.patch
Normal file
59
meta/recipes-bsp/grub/files/CVE-2015-8370.patch
Normal file
@@ -0,0 +1,59 @@
|
||||
From 451d80e52d851432e109771bb8febafca7a5f1f2 Mon Sep 17 00:00:00 2001
|
||||
From: Hector Marco-Gisbert <hecmargi@upv.es>
|
||||
Date: Wed, 16 Dec 2015 07:57:18 +0300
|
||||
Subject: [PATCH] Fix security issue when reading username and password
|
||||
|
||||
This patch fixes two integer underflows at:
|
||||
* grub-core/lib/crypto.c
|
||||
* grub-core/normal/auth.c
|
||||
|
||||
CVE-2015-8370
|
||||
|
||||
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
|
||||
Signed-off-by: Ismael Ripoll-Ripoll <iripoll@disca.upv.es>
|
||||
Also-By: Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=451d80e52d851432e109771bb8febafca7a5f1f2
|
||||
|
||||
CVE: CVE-2015-8370
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
grub-core/lib/crypto.c | 3 ++-
|
||||
grub-core/normal/auth.c | 7 +++++--
|
||||
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: git/grub-core/lib/crypto.c
|
||||
===================================================================
|
||||
--- git.orig/grub-core/lib/crypto.c
|
||||
+++ git/grub-core/lib/crypto.c
|
||||
@@ -458,7 +458,8 @@ grub_password_get (char buf[], unsigned
|
||||
|
||||
if (key == '\b')
|
||||
{
|
||||
- cur_len--;
|
||||
+ if (cur_len)
|
||||
+ cur_len--;
|
||||
continue;
|
||||
}
|
||||
|
||||
Index: git/grub-core/normal/auth.c
|
||||
===================================================================
|
||||
--- git.orig/grub-core/normal/auth.c
|
||||
+++ git/grub-core/normal/auth.c
|
||||
@@ -174,8 +174,11 @@ grub_username_get (char buf[], unsigned
|
||||
|
||||
if (key == '\b')
|
||||
{
|
||||
- cur_len--;
|
||||
- grub_printf ("\b");
|
||||
+ if (cur_len)
|
||||
+ {
|
||||
+ cur_len--;
|
||||
+ grub_printf ("\b");
|
||||
+ }
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
|
||||
file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
|
||||
file://0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch \
|
||||
file://grub2-fix-initrd-size-bug.patch \
|
||||
file://CVE-2015-8370.patch \
|
||||
"
|
||||
|
||||
DEPENDS = "flex-native bison-native xz"
|
||||
|
||||
278
meta/recipes-connectivity/bind/bind/CVE-2015-8000.patch
Normal file
278
meta/recipes-connectivity/bind/bind/CVE-2015-8000.patch
Normal file
@@ -0,0 +1,278 @@
|
||||
From 8259daad7242ab2af8731681177ef7e948a15ece Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Mon, 16 Nov 2015 13:12:20 +1100
|
||||
Subject: [PATCH] 4260. [security] Insufficient testing when parsing a
|
||||
message allowed records with an incorrect class to be
|
||||
be accepted, triggering a REQUIRE failure when those
|
||||
records were subsequently cached. (CVE-2015-8000) [RT
|
||||
#4098]
|
||||
|
||||
(cherry picked from commit c8821d124c532e0a65752b378f924d4259499fd3)
|
||||
(cherry picked from commit 3a4c24c4a52d4a2d21d2decbde3d4e514e27d51c)
|
||||
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=commit;h=8259daad7242ab2af8731681177ef7e948a15ece
|
||||
|
||||
CVE: CVE-2015-8000
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
CHANGES | 5 +++++
|
||||
bin/tests/system/start.pl | 5 ++++-
|
||||
doc/arm/notes.xml | 9 +++++++++
|
||||
lib/dns/include/dns/message.h | 13 +++++++++++--
|
||||
lib/dns/message.c | 45 ++++++++++++++++++++++++++++++++++++++-----
|
||||
lib/dns/resolver.c | 9 +++++++++
|
||||
lib/dns/xfrin.c | 2 ++
|
||||
7 files changed, 80 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: bind-9.10.2-P4/bin/tests/system/start.pl
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/bin/tests/system/start.pl
|
||||
+++ bind-9.10.2-P4/bin/tests/system/start.pl
|
||||
@@ -68,6 +68,7 @@ my $NAMED = $ENV{'NAMED'};
|
||||
my $LWRESD = $ENV{'LWRESD'};
|
||||
my $DIG = $ENV{'DIG'};
|
||||
my $PERL = $ENV{'PERL'};
|
||||
+my $PYTHON = $ENV{'PYTHON'};
|
||||
|
||||
# Start the server(s)
|
||||
|
||||
@@ -213,7 +214,9 @@ sub start_server {
|
||||
$pid_file = "lwresd.pid";
|
||||
} elsif ($server =~ /^ans/) {
|
||||
$cleanup_files = "{ans.run}";
|
||||
- if (-e "$testdir/$server/ans.pl") {
|
||||
+ if (-e "$testdir/$server/ans.py") {
|
||||
+ $command = "$PYTHON ans.py 10.53.0.$' 5300";
|
||||
+ } elsif (-e "$testdir/$server/ans.pl") {
|
||||
$command = "$PERL ans.pl";
|
||||
} else {
|
||||
$command = "$PERL $topdir/ans.pl 10.53.0.$'";
|
||||
Index: bind-9.10.2-P4/doc/arm/notes.xml
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/doc/arm/notes.xml
|
||||
+++ bind-9.10.2-P4/doc/arm/notes.xml
|
||||
@@ -62,6 +62,15 @@
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
+ Insufficient testing when parsing a message allowed
|
||||
+ records with an incorrect class to be be accepted,
|
||||
+ triggering a REQUIRE failure when those records
|
||||
+ were subsequently cached. This flaw is disclosed
|
||||
+ in CVE-2015-8000. [RT #4098]
|
||||
+ </para>
|
||||
+ </listitem>
|
||||
+ <listitem>
|
||||
+ <para>
|
||||
An incorrect boundary check in the OPENPGPKEY rdatatype
|
||||
could trigger an assertion failure. This flaw is disclosed
|
||||
in CVE-2015-5986. [RT #40286]
|
||||
Index: bind-9.10.2-P4/lib/dns/include/dns/message.h
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/lib/dns/include/dns/message.h
|
||||
+++ bind-9.10.2-P4/lib/dns/include/dns/message.h
|
||||
@@ -15,8 +15,6 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
-/* $Id$ */
|
||||
-
|
||||
#ifndef DNS_MESSAGE_H
|
||||
#define DNS_MESSAGE_H 1
|
||||
|
||||
@@ -221,6 +219,8 @@ struct dns_message {
|
||||
unsigned int free_saved : 1;
|
||||
unsigned int sitok : 1;
|
||||
unsigned int sitbad : 1;
|
||||
+ unsigned int tkey : 1;
|
||||
+ unsigned int rdclass_set : 1;
|
||||
|
||||
unsigned int opt_reserved;
|
||||
unsigned int sig_reserved;
|
||||
@@ -1400,6 +1400,15 @@ dns_message_buildopt(dns_message_t *msg,
|
||||
* \li other.
|
||||
*/
|
||||
|
||||
+void
|
||||
+dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass);
|
||||
+/*%<
|
||||
+ * Set the expected class of records in the response.
|
||||
+ *
|
||||
+ * Requires:
|
||||
+ * \li msg be a valid message with parsing intent.
|
||||
+ */
|
||||
+
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
#endif /* DNS_MESSAGE_H */
|
||||
Index: bind-9.10.2-P4/lib/dns/message.c
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/lib/dns/message.c
|
||||
+++ bind-9.10.2-P4/lib/dns/message.c
|
||||
@@ -439,6 +439,8 @@ msginit(dns_message_t *m) {
|
||||
m->free_saved = 0;
|
||||
m->sitok = 0;
|
||||
m->sitbad = 0;
|
||||
+ m->tkey = 0;
|
||||
+ m->rdclass_set = 0;
|
||||
m->querytsig = NULL;
|
||||
}
|
||||
|
||||
@@ -1091,13 +1093,19 @@ getquestions(isc_buffer_t *source, dns_m
|
||||
* If this class is different than the one we already read,
|
||||
* this is an error.
|
||||
*/
|
||||
- if (msg->state == DNS_SECTION_ANY) {
|
||||
- msg->state = DNS_SECTION_QUESTION;
|
||||
+ if (msg->rdclass_set == 0) {
|
||||
msg->rdclass = rdclass;
|
||||
+ msg->rdclass_set = 1;
|
||||
} else if (msg->rdclass != rdclass)
|
||||
DO_FORMERR;
|
||||
|
||||
/*
|
||||
+ * Is this a TKEY query?
|
||||
+ */
|
||||
+ if (rdtype == dns_rdatatype_tkey)
|
||||
+ msg->tkey = 1;
|
||||
+
|
||||
+ /*
|
||||
* Can't ask the same question twice.
|
||||
*/
|
||||
result = dns_message_find(name, rdclass, rdtype, 0, NULL);
|
||||
@@ -1241,12 +1249,12 @@ getsection(isc_buffer_t *source, dns_mes
|
||||
* If there was no question section, we may not yet have
|
||||
* established a class. Do so now.
|
||||
*/
|
||||
- if (msg->state == DNS_SECTION_ANY &&
|
||||
+ if (msg->rdclass_set == 0 &&
|
||||
rdtype != dns_rdatatype_opt && /* class is UDP SIZE */
|
||||
rdtype != dns_rdatatype_tsig && /* class is ANY */
|
||||
rdtype != dns_rdatatype_tkey) { /* class is undefined */
|
||||
msg->rdclass = rdclass;
|
||||
- msg->state = DNS_SECTION_QUESTION;
|
||||
+ msg->rdclass_set = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1256,7 +1264,7 @@ getsection(isc_buffer_t *source, dns_mes
|
||||
if (msg->opcode != dns_opcode_update
|
||||
&& rdtype != dns_rdatatype_tsig
|
||||
&& rdtype != dns_rdatatype_opt
|
||||
- && rdtype != dns_rdatatype_dnskey /* in a TKEY query */
|
||||
+ && rdtype != dns_rdatatype_key /* in a TKEY query */
|
||||
&& rdtype != dns_rdatatype_sig /* SIG(0) */
|
||||
&& rdtype != dns_rdatatype_tkey /* Win2000 TKEY */
|
||||
&& msg->rdclass != dns_rdataclass_any
|
||||
@@ -1264,6 +1272,16 @@ getsection(isc_buffer_t *source, dns_mes
|
||||
DO_FORMERR;
|
||||
|
||||
/*
|
||||
+ * If this is not a TKEY query/response then the KEY
|
||||
+ * record's class needs to match.
|
||||
+ */
|
||||
+ if (msg->opcode != dns_opcode_update && !msg->tkey &&
|
||||
+ rdtype == dns_rdatatype_key &&
|
||||
+ msg->rdclass != dns_rdataclass_any &&
|
||||
+ msg->rdclass != rdclass)
|
||||
+ DO_FORMERR;
|
||||
+
|
||||
+ /*
|
||||
* Special type handling for TSIG, OPT, and TKEY.
|
||||
*/
|
||||
if (rdtype == dns_rdatatype_tsig) {
|
||||
@@ -1377,6 +1395,10 @@ getsection(isc_buffer_t *source, dns_mes
|
||||
skip_name_search = ISC_TRUE;
|
||||
skip_type_search = ISC_TRUE;
|
||||
issigzero = ISC_TRUE;
|
||||
+ } else {
|
||||
+ if (msg->rdclass != dns_rdataclass_any &&
|
||||
+ msg->rdclass != rdclass)
|
||||
+ DO_FORMERR;
|
||||
}
|
||||
} else
|
||||
covers = 0;
|
||||
@@ -1625,6 +1647,7 @@ dns_message_parse(dns_message_t *msg, is
|
||||
msg->counts[DNS_SECTION_ADDITIONAL] = isc_buffer_getuint16(source);
|
||||
|
||||
msg->header_ok = 1;
|
||||
+ msg->state = DNS_SECTION_QUESTION;
|
||||
|
||||
/*
|
||||
* -1 means no EDNS.
|
||||
@@ -3706,3 +3729,15 @@ dns_message_buildopt(dns_message_t *mess
|
||||
dns_message_puttemprdatalist(message, &rdatalist);
|
||||
return (result);
|
||||
}
|
||||
+
|
||||
+void
|
||||
+dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass) {
|
||||
+
|
||||
+ REQUIRE(DNS_MESSAGE_VALID(msg));
|
||||
+ REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTPARSE);
|
||||
+ REQUIRE(msg->state == DNS_SECTION_ANY);
|
||||
+ REQUIRE(msg->rdclass_set == 0);
|
||||
+
|
||||
+ msg->rdclass = rdclass;
|
||||
+ msg->rdclass_set = 1;
|
||||
+}
|
||||
Index: bind-9.10.2-P4/lib/dns/resolver.c
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/lib/dns/resolver.c
|
||||
+++ bind-9.10.2-P4/lib/dns/resolver.c
|
||||
@@ -7309,6 +7309,8 @@ resquery_response(isc_task_t *task, isc_
|
||||
goto done;
|
||||
}
|
||||
|
||||
+ dns_message_setclass(message, fctx->res->rdclass);
|
||||
+
|
||||
if ((options & DNS_FETCHOPT_TCP) == 0) {
|
||||
if ((options & DNS_FETCHOPT_NOEDNS0) == 0)
|
||||
dns_adb_setudpsize(fctx->adb, query->addrinfo,
|
||||
@@ -7391,6 +7393,13 @@ resquery_response(isc_task_t *task, isc_
|
||||
&dns_master_style_comment,
|
||||
ISC_LOG_DEBUG(10),
|
||||
fctx->res->mctx);
|
||||
+
|
||||
+ if (message->rdclass != fctx->res->rdclass) {
|
||||
+ resend = ISC_TRUE;
|
||||
+ FCTXTRACE("bad class");
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Process receive opt record.
|
||||
*/
|
||||
Index: bind-9.10.2-P4/lib/dns/xfrin.c
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/lib/dns/xfrin.c
|
||||
+++ bind-9.10.2-P4/lib/dns/xfrin.c
|
||||
@@ -1225,6 +1225,8 @@ xfrin_recv_done(isc_task_t *task, isc_ev
|
||||
msg->tsigctx = xfr->tsigctx;
|
||||
xfr->tsigctx = NULL;
|
||||
|
||||
+ dns_message_setclass(msg, xfr->rdclass);
|
||||
+
|
||||
if (xfr->nmsg > 0)
|
||||
msg->tcp_continuation = 1;
|
||||
|
||||
Index: bind-9.10.2-P4/CHANGES
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/CHANGES
|
||||
+++ bind-9.10.2-P4/CHANGES
|
||||
@@ -1,4 +1,9 @@
|
||||
- --- 9.10.2-P4 released ---
|
||||
+4260. [security] Insufficient testing when parsing a message allowed
|
||||
+ records with an incorrect class to be be accepted,
|
||||
+ triggering a REQUIRE failure when those records
|
||||
+ were subsequently cached. (CVE-2015-8000) [RT #4098]
|
||||
+
|
||||
+ --- 9.10.2-P4 released ---
|
||||
|
||||
4170. [security] An incorrect boundary check in the OPENPGPKEY
|
||||
rdatatype could trigger an assertion failure.
|
||||
44
meta/recipes-connectivity/bind/bind/CVE-2015-8461.patch
Normal file
44
meta/recipes-connectivity/bind/bind/CVE-2015-8461.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
From adbf81335b67be0cebdcf9f1f4fcb38ef4814f4d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Thu, 25 Jun 2015 18:36:27 +1000
|
||||
Subject: [PATCH] 4146. [bug] Address reference leak that could
|
||||
prevent a clean shutdown. [RT #37125]
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=commit;h=adbf81335b67be0cebdcf9f1f4fcb38ef4814f4d
|
||||
|
||||
CVE: CVE-2015-8461
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
---
|
||||
CHANGES | 3 +++
|
||||
lib/dns/resolver.c | 5 +++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
Index: bind-9.10.2-P4/CHANGES
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/CHANGES
|
||||
+++ bind-9.10.2-P4/CHANGES
|
||||
@@ -1,3 +1,6 @@
|
||||
+4146. [bug] Address reference leak that could prevent a clean
|
||||
+ shutdown. [RT #37125]
|
||||
+
|
||||
4260. [security] Insufficient testing when parsing a message allowed
|
||||
records with an incorrect class to be be accepted,
|
||||
triggering a REQUIRE failure when those records
|
||||
Index: bind-9.10.2-P4/lib/dns/resolver.c
|
||||
===================================================================
|
||||
--- bind-9.10.2-P4.orig/lib/dns/resolver.c
|
||||
+++ bind-9.10.2-P4/lib/dns/resolver.c
|
||||
@@ -1649,6 +1649,11 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr
|
||||
if (query->dispatch != NULL)
|
||||
dns_dispatch_detach(&query->dispatch);
|
||||
|
||||
+ LOCK(&res->buckets[fctx->bucketnum].lock);
|
||||
+ INSIST(fctx->references > 1);
|
||||
+ fctx->references--;
|
||||
+ UNLOCK(&res->buckets[fctx->bucketnum].lock);
|
||||
+
|
||||
cleanup_query:
|
||||
if (query->connects == 0) {
|
||||
query->magic = 0;
|
||||
28
meta/recipes-connectivity/bind/bind/CVE-2015-8704.patch
Normal file
28
meta/recipes-connectivity/bind/bind/CVE-2015-8704.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
a buffer size check can cause denial of service under certain circumstances
|
||||
|
||||
[security]
|
||||
The following flaw in BIND was reported by ISC:
|
||||
|
||||
A buffer size check used to guard against overflow could cause named to exit with an INSIST failure In apl_42.c.
|
||||
|
||||
A server could exit due to an INSIST failure in apl_42.c when performing certain string formatting operations.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-8704
|
||||
|
||||
[The patch is taken from BIND 9.10.3:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2015-8704]
|
||||
|
||||
Signed-off-by: Derek Straka <derek@asterius.io>
|
||||
diff --git a/lib/dns/rdata/in_1/apl_42.c b/lib/dns/rdata/in_1/apl_42.c
|
||||
index bedd38e..28eb7f2 100644
|
||||
--- a/lib/dns/rdata/in_1/apl_42.c
|
||||
+++ b/lib/dns/rdata/in_1/apl_42.c
|
||||
@@ -116,7 +116,7 @@ totext_in_apl(ARGS_TOTEXT) {
|
||||
isc_uint8_t len;
|
||||
isc_boolean_t neg;
|
||||
unsigned char buf[16];
|
||||
- char txt[sizeof(" !64000")];
|
||||
+ char txt[sizeof(" !64000:")];
|
||||
const char *sep = "";
|
||||
int n;
|
||||
44
meta/recipes-connectivity/bind/bind/CVE-2015-8705.patch
Normal file
44
meta/recipes-connectivity/bind/bind/CVE-2015-8705.patch
Normal file
@@ -0,0 +1,44 @@
|
||||
a crash or assertion failure can during format processing
|
||||
|
||||
[security]
|
||||
The following flaw in BIND was reported by ISC:
|
||||
|
||||
In versions of BIND 9.10, errors can occur when OPT pseudo-RR data or ECS options are formatted to text. In 9.10.3 through 9.10.3-P2, the issue may result in a REQUIRE assertion failure in buffer.c.
|
||||
|
||||
This issue can affect both authoritative and recursive servers if they are performing debug logging. (It may also crash related tools which use the same code, such as dig or delv.)
|
||||
|
||||
A server could exit due to an INSIST failure in apl_42.c when performing certain string formatting operations.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-8705
|
||||
|
||||
[The patch is taken from BIND 9.10.3:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2015-8705]
|
||||
|
||||
Signed-off-by: Derek Straka <derek@asterius.io>
|
||||
diff --git a/lib/dns/message.c b/lib/dns/message.c
|
||||
index ea7b93a..810c58e 100644
|
||||
--- a/lib/dns/message.c
|
||||
+++ b/lib/dns/message.c
|
||||
@@ -3310,9 +3310,19 @@
|
||||
} else if (optcode == DNS_OPT_SIT) {
|
||||
ADD_STRING(target, "; SIT");
|
||||
} else if (optcode == DNS_OPT_CLIENT_SUBNET) {
|
||||
+ isc_buffer_t ecsbuf;
|
||||
ADD_STRING(target, "; CLIENT-SUBNET: ");
|
||||
- render_ecs(&optbuf, target);
|
||||
- ADD_STRING(target, "\n");
|
||||
+ isc_buffer_init(&ecsbuf,
|
||||
+ isc_buffer_current(&optbuf),
|
||||
+ optlen);
|
||||
+ isc_buffer_add(&ecsbuf, optlen);
|
||||
+ result = render_ecs(&ecsbuf, target);
|
||||
+ if (result == ISC_R_NOSPACE)
|
||||
+ return (result);
|
||||
+ if (result == ISC_R_SUCCESS) {
|
||||
+ isc_buffer_forward(&optbuf, optlen);
|
||||
+ ADD_STRING(target, "\n");
|
||||
+ }
|
||||
continue;
|
||||
} else if (optcode == DNS_OPT_EXPIRE) {
|
||||
if (optlen == 4) {
|
||||
@@ -21,6 +21,10 @@ SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
||||
file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
|
||||
file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
|
||||
file://0001-lib-dns-gen.c-fix-too-long-error.patch \
|
||||
file://CVE-2015-8704.patch \
|
||||
file://CVE-2015-8705.patch \
|
||||
file://CVE-2015-8000.patch \
|
||||
file://CVE-2015-8461.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "8b1f5064837756c938eadc1537dec5c7"
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From f98a09cacff7baad8748c9aa217afd155a4d493f Mon Sep 17 00:00:00 2001
|
||||
From: "mmcc@openbsd.org" <mmcc@openbsd.org>
|
||||
Date: Tue, 20 Oct 2015 03:36:35 +0000
|
||||
Subject: [PATCH] upstream commit
|
||||
|
||||
Replace a function-local allocation with stack memory.
|
||||
|
||||
ok djm@
|
||||
|
||||
Upstream-ID: c09fbbab637053a2ab9f33ca142b4e20a4c5a17e
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2016-1907
|
||||
|
||||
[YOCTO #8935]
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
clientloop.c | 9 ++-------
|
||||
1 file changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/clientloop.c b/clientloop.c
|
||||
index 87ceb3d..1e05cba 100644
|
||||
--- a/clientloop.c
|
||||
+++ b/clientloop.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $OpenBSD: clientloop.c,v 1.275 2015/07/10 06:21:53 markus Exp $ */
|
||||
+/* $OpenBSD: clientloop.c,v 1.276 2015/10/20 03:36:35 mmcc Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@@ -311,11 +311,10 @@ client_x11_get_proto(const char *display, const char *xauth_path,
|
||||
static char proto[512], data[512];
|
||||
FILE *f;
|
||||
int got_data = 0, generated = 0, do_unlink = 0, i;
|
||||
- char *xauthdir, *xauthfile;
|
||||
+ char xauthdir[PATH_MAX] = "", xauthfile[PATH_MAX] = "";
|
||||
struct stat st;
|
||||
u_int now, x11_timeout_real;
|
||||
|
||||
- xauthdir = xauthfile = NULL;
|
||||
*_proto = proto;
|
||||
*_data = data;
|
||||
proto[0] = data[0] = '\0';
|
||||
@@ -343,8 +342,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
|
||||
display = xdisplay;
|
||||
}
|
||||
if (trusted == 0) {
|
||||
- xauthdir = xmalloc(PATH_MAX);
|
||||
- xauthfile = xmalloc(PATH_MAX);
|
||||
mktemp_proto(xauthdir, PATH_MAX);
|
||||
/*
|
||||
* The authentication cookie should briefly outlive
|
||||
@@ -407,8 +404,6 @@ client_x11_get_proto(const char *display, const char *xauth_path,
|
||||
unlink(xauthfile);
|
||||
rmdir(xauthdir);
|
||||
}
|
||||
- free(xauthdir);
|
||||
- free(xauthfile);
|
||||
|
||||
/*
|
||||
* If we didn't get authentication data, just make up some
|
||||
--
|
||||
1.9.1
|
||||
|
||||
329
meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_3.patch
Normal file
329
meta/recipes-connectivity/openssh/openssh/CVE-2016-1907_3.patch
Normal file
@@ -0,0 +1,329 @@
|
||||
From ed4ce82dbfa8a3a3c8ea6fa0db113c71e234416c Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Wed, 13 Jan 2016 23:04:47 +0000
|
||||
Subject: [PATCH] upstream commit
|
||||
|
||||
eliminate fallback from untrusted X11 forwarding to trusted
|
||||
forwarding when the X server disables the SECURITY extension; Reported by
|
||||
Thomas Hoger; ok deraadt@
|
||||
|
||||
Upstream-ID: f76195bd2064615a63ef9674a0e4096b0713f938
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2016-1907
|
||||
|
||||
[YOCTO #8935]
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
clientloop.c | 114 ++++++++++++++++++++++++++++++++++++-----------------------
|
||||
clientloop.h | 4 +--
|
||||
mux.c | 22 ++++++------
|
||||
ssh.c | 23 +++++-------
|
||||
4 files changed, 93 insertions(+), 70 deletions(-)
|
||||
|
||||
Index: openssh-7.1p2/clientloop.c
|
||||
===================================================================
|
||||
--- openssh-7.1p2.orig/clientloop.c
|
||||
+++ openssh-7.1p2/clientloop.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $OpenBSD: clientloop.c,v 1.276 2015/10/20 03:36:35 mmcc Exp $ */
|
||||
+/* $OpenBSD: clientloop.c,v 1.279 2016/01/13 23:04:47 djm Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@@ -288,6 +288,9 @@ client_x11_display_valid(const char *dis
|
||||
{
|
||||
size_t i, dlen;
|
||||
|
||||
+ if (display == NULL)
|
||||
+ return 0;
|
||||
+
|
||||
dlen = strlen(display);
|
||||
for (i = 0; i < dlen; i++) {
|
||||
if (!isalnum((u_char)display[i]) &&
|
||||
@@ -301,34 +304,33 @@ client_x11_display_valid(const char *dis
|
||||
|
||||
#define SSH_X11_PROTO "MIT-MAGIC-COOKIE-1"
|
||||
#define X11_TIMEOUT_SLACK 60
|
||||
-void
|
||||
+int
|
||||
client_x11_get_proto(const char *display, const char *xauth_path,
|
||||
u_int trusted, u_int timeout, char **_proto, char **_data)
|
||||
{
|
||||
- char cmd[1024];
|
||||
- char line[512];
|
||||
- char xdisplay[512];
|
||||
+ char cmd[1024], line[512], xdisplay[512];
|
||||
+ char xauthfile[PATH_MAX], xauthdir[PATH_MAX];
|
||||
static char proto[512], data[512];
|
||||
FILE *f;
|
||||
- int got_data = 0, generated = 0, do_unlink = 0, i;
|
||||
- char xauthdir[PATH_MAX] = "", xauthfile[PATH_MAX] = "";
|
||||
+ int got_data = 0, generated = 0, do_unlink = 0, i, r;
|
||||
struct stat st;
|
||||
u_int now, x11_timeout_real;
|
||||
|
||||
*_proto = proto;
|
||||
*_data = data;
|
||||
- proto[0] = data[0] = '\0';
|
||||
+ proto[0] = data[0] = xauthfile[0] = xauthdir[0] = '\0';
|
||||
|
||||
- if (xauth_path == NULL ||(stat(xauth_path, &st) == -1)) {
|
||||
- debug("No xauth program.");
|
||||
- } else if (!client_x11_display_valid(display)) {
|
||||
- logit("DISPLAY '%s' invalid, falling back to fake xauth data",
|
||||
+ if (!client_x11_display_valid(display)) {
|
||||
+ logit("DISPLAY \"%s\" invalid; disabling X11 forwarding",
|
||||
display);
|
||||
- } else {
|
||||
- if (display == NULL) {
|
||||
- debug("x11_get_proto: DISPLAY not set");
|
||||
- return;
|
||||
- }
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (xauth_path != NULL && stat(xauth_path, &st) == -1) {
|
||||
+ debug("No xauth program.");
|
||||
+ xauth_path = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (xauth_path != NULL) {
|
||||
/*
|
||||
* Handle FamilyLocal case where $DISPLAY does
|
||||
* not match an authorization entry. For this we
|
||||
@@ -337,43 +339,60 @@ client_x11_get_proto(const char *display
|
||||
* is not perfect.
|
||||
*/
|
||||
if (strncmp(display, "localhost:", 10) == 0) {
|
||||
- snprintf(xdisplay, sizeof(xdisplay), "unix:%s",
|
||||
- display + 10);
|
||||
+ if ((r = snprintf(xdisplay, sizeof(xdisplay), "unix:%s",
|
||||
+ display + 10)) < 0 ||
|
||||
+ (size_t)r >= sizeof(xdisplay)) {
|
||||
+ error("%s: display name too long", __func__);
|
||||
+ return -1;
|
||||
+ }
|
||||
display = xdisplay;
|
||||
}
|
||||
if (trusted == 0) {
|
||||
- mktemp_proto(xauthdir, PATH_MAX);
|
||||
/*
|
||||
+ * Generate an untrusted X11 auth cookie.
|
||||
+ *
|
||||
* The authentication cookie should briefly outlive
|
||||
* ssh's willingness to forward X11 connections to
|
||||
* avoid nasty fail-open behaviour in the X server.
|
||||
*/
|
||||
+ mktemp_proto(xauthdir, sizeof(xauthdir));
|
||||
+ if (mkdtemp(xauthdir) == NULL) {
|
||||
+ error("%s: mkdtemp: %s",
|
||||
+ __func__, strerror(errno));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ do_unlink = 1;
|
||||
+ if ((r = snprintf(xauthfile, sizeof(xauthfile),
|
||||
+ "%s/xauthfile", xauthdir)) < 0 ||
|
||||
+ (size_t)r >= sizeof(xauthfile)) {
|
||||
+ error("%s: xauthfile path too long", __func__);
|
||||
+ unlink(xauthfile);
|
||||
+ rmdir(xauthdir);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
if (timeout >= UINT_MAX - X11_TIMEOUT_SLACK)
|
||||
x11_timeout_real = UINT_MAX;
|
||||
else
|
||||
x11_timeout_real = timeout + X11_TIMEOUT_SLACK;
|
||||
- if (mkdtemp(xauthdir) != NULL) {
|
||||
- do_unlink = 1;
|
||||
- snprintf(xauthfile, PATH_MAX, "%s/xauthfile",
|
||||
- xauthdir);
|
||||
- snprintf(cmd, sizeof(cmd),
|
||||
- "%s -f %s generate %s " SSH_X11_PROTO
|
||||
- " untrusted timeout %u 2>" _PATH_DEVNULL,
|
||||
- xauth_path, xauthfile, display,
|
||||
- x11_timeout_real);
|
||||
- debug2("x11_get_proto: %s", cmd);
|
||||
- if (x11_refuse_time == 0) {
|
||||
- now = monotime() + 1;
|
||||
- if (UINT_MAX - timeout < now)
|
||||
- x11_refuse_time = UINT_MAX;
|
||||
- else
|
||||
- x11_refuse_time = now + timeout;
|
||||
- channel_set_x11_refuse_time(
|
||||
- x11_refuse_time);
|
||||
- }
|
||||
- if (system(cmd) == 0)
|
||||
- generated = 1;
|
||||
+ if ((r = snprintf(cmd, sizeof(cmd),
|
||||
+ "%s -f %s generate %s " SSH_X11_PROTO
|
||||
+ " untrusted timeout %u 2>" _PATH_DEVNULL,
|
||||
+ xauth_path, xauthfile, display,
|
||||
+ x11_timeout_real)) < 0 ||
|
||||
+ (size_t)r >= sizeof(cmd))
|
||||
+ fatal("%s: cmd too long", __func__);
|
||||
+ debug2("%s: %s", __func__, cmd);
|
||||
+ if (x11_refuse_time == 0) {
|
||||
+ now = monotime() + 1;
|
||||
+ if (UINT_MAX - timeout < now)
|
||||
+ x11_refuse_time = UINT_MAX;
|
||||
+ else
|
||||
+ x11_refuse_time = now + timeout;
|
||||
+ channel_set_x11_refuse_time(x11_refuse_time);
|
||||
}
|
||||
+ if (system(cmd) == 0)
|
||||
+ generated = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -395,9 +414,7 @@ client_x11_get_proto(const char *display
|
||||
got_data = 1;
|
||||
if (f)
|
||||
pclose(f);
|
||||
- } else
|
||||
- error("Warning: untrusted X11 forwarding setup failed: "
|
||||
- "xauth key data not generated");
|
||||
+ }
|
||||
}
|
||||
|
||||
if (do_unlink) {
|
||||
@@ -405,6 +422,13 @@ client_x11_get_proto(const char *display
|
||||
rmdir(xauthdir);
|
||||
}
|
||||
|
||||
+ /* Don't fall back to fake X11 data for untrusted forwarding */
|
||||
+ if (!trusted && !got_data) {
|
||||
+ error("Warning: untrusted X11 forwarding setup failed: "
|
||||
+ "xauth key data not generated");
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* If we didn't get authentication data, just make up some
|
||||
* data. The forwarding code will check the validity of the
|
||||
@@ -427,6 +451,8 @@ client_x11_get_proto(const char *display
|
||||
rnd >>= 8;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Index: openssh-7.1p2/clientloop.h
|
||||
===================================================================
|
||||
--- openssh-7.1p2.orig/clientloop.h
|
||||
+++ openssh-7.1p2/clientloop.h
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $OpenBSD: clientloop.h,v 1.31 2013/06/02 23:36:29 dtucker Exp $ */
|
||||
+/* $OpenBSD: clientloop.h,v 1.32 2016/01/13 23:04:47 djm Exp $ */
|
||||
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/* Client side main loop for the interactive session. */
|
||||
int client_loop(int, int, int);
|
||||
-void client_x11_get_proto(const char *, const char *, u_int, u_int,
|
||||
+int client_x11_get_proto(const char *, const char *, u_int, u_int,
|
||||
char **, char **);
|
||||
void client_global_request_reply_fwd(int, u_int32_t, void *);
|
||||
void client_session2_setup(int, int, int, const char *, struct termios *,
|
||||
Index: openssh-7.1p2/mux.c
|
||||
===================================================================
|
||||
--- openssh-7.1p2.orig/mux.c
|
||||
+++ openssh-7.1p2/mux.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $OpenBSD: mux.c,v 1.54 2015/08/19 23:18:26 djm Exp $ */
|
||||
+/* $OpenBSD: mux.c,v 1.58 2016/01/13 23:04:47 djm Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
|
||||
*
|
||||
@@ -1354,16 +1354,18 @@ mux_session_confirm(int id, int success,
|
||||
char *proto, *data;
|
||||
|
||||
/* Get reasonable local authentication information. */
|
||||
- client_x11_get_proto(display, options.xauth_location,
|
||||
+ if (client_x11_get_proto(display, options.xauth_location,
|
||||
options.forward_x11_trusted, options.forward_x11_timeout,
|
||||
- &proto, &data);
|
||||
- /* Request forwarding with authentication spoofing. */
|
||||
- debug("Requesting X11 forwarding with authentication "
|
||||
- "spoofing.");
|
||||
- x11_request_forwarding_with_spoofing(id, display, proto,
|
||||
- data, 1);
|
||||
- client_expect_confirm(id, "X11 forwarding", CONFIRM_WARN);
|
||||
- /* XXX exit_on_forward_failure */
|
||||
+ &proto, &data) == 0) {
|
||||
+ /* Request forwarding with authentication spoofing. */
|
||||
+ debug("Requesting X11 forwarding with authentication "
|
||||
+ "spoofing.");
|
||||
+ x11_request_forwarding_with_spoofing(id, display, proto,
|
||||
+ data, 1);
|
||||
+ /* XXX exit_on_forward_failure */
|
||||
+ client_expect_confirm(id, "X11 forwarding",
|
||||
+ CONFIRM_WARN);
|
||||
+ }
|
||||
}
|
||||
|
||||
if (cctx->want_agent_fwd && options.forward_agent) {
|
||||
Index: openssh-7.1p2/ssh.c
|
||||
===================================================================
|
||||
--- openssh-7.1p2.orig/ssh.c
|
||||
+++ openssh-7.1p2/ssh.c
|
||||
@@ -1,4 +1,4 @@
|
||||
-/* $OpenBSD: ssh.c,v 1.420 2015/07/30 00:01:34 djm Exp $ */
|
||||
+/* $OpenBSD: ssh.c,v 1.433 2016/01/13 23:04:47 djm Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@@ -1604,6 +1604,7 @@ ssh_session(void)
|
||||
struct winsize ws;
|
||||
char *cp;
|
||||
const char *display;
|
||||
+ char *proto = NULL, *data = NULL;
|
||||
|
||||
/* Enable compression if requested. */
|
||||
if (options.compression) {
|
||||
@@ -1674,13 +1675,9 @@ ssh_session(void)
|
||||
display = getenv("DISPLAY");
|
||||
if (display == NULL && options.forward_x11)
|
||||
debug("X11 forwarding requested but DISPLAY not set");
|
||||
- if (options.forward_x11 && display != NULL) {
|
||||
- char *proto, *data;
|
||||
- /* Get reasonable local authentication information. */
|
||||
- client_x11_get_proto(display, options.xauth_location,
|
||||
- options.forward_x11_trusted,
|
||||
- options.forward_x11_timeout,
|
||||
- &proto, &data);
|
||||
+ if (options.forward_x11 && client_x11_get_proto(display,
|
||||
+ options.xauth_location, options.forward_x11_trusted,
|
||||
+ options.forward_x11_timeout, &proto, &data) == 0) {
|
||||
/* Request forwarding with authentication spoofing. */
|
||||
debug("Requesting X11 forwarding with authentication "
|
||||
"spoofing.");
|
||||
@@ -1770,6 +1767,7 @@ ssh_session2_setup(int id, int success,
|
||||
extern char **environ;
|
||||
const char *display;
|
||||
int interactive = tty_flag;
|
||||
+ char *proto = NULL, *data = NULL;
|
||||
|
||||
if (!success)
|
||||
return; /* No need for error message, channels code sens one */
|
||||
@@ -1777,12 +1775,9 @@ ssh_session2_setup(int id, int success,
|
||||
display = getenv("DISPLAY");
|
||||
if (display == NULL && options.forward_x11)
|
||||
debug("X11 forwarding requested but DISPLAY not set");
|
||||
- if (options.forward_x11 && display != NULL) {
|
||||
- char *proto, *data;
|
||||
- /* Get reasonable local authentication information. */
|
||||
- client_x11_get_proto(display, options.xauth_location,
|
||||
- options.forward_x11_trusted,
|
||||
- options.forward_x11_timeout, &proto, &data);
|
||||
+ if (options.forward_x11 && client_x11_get_proto(display,
|
||||
+ options.xauth_location, options.forward_x11_trusted,
|
||||
+ options.forward_x11_timeout, &proto, &data) == 0) {
|
||||
/* Request forwarding with authentication spoofing. */
|
||||
debug("Requesting X11 forwarding with authentication "
|
||||
"spoofing.");
|
||||
@@ -0,0 +1,33 @@
|
||||
From d77148e3a3ef6c29b26ec74331455394581aa257 Mon Sep 17 00:00:00 2001
|
||||
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||
Date: Sun, 8 Nov 2015 21:59:11 +0000
|
||||
Subject: [PATCH] upstream commit
|
||||
|
||||
fix OOB read in packet code caused by missing return
|
||||
statement found by Ben Hawkes; ok markus@ deraadt@
|
||||
|
||||
Upstream-ID: a3e3a85434ebfa0690d4879091959591f30efc62
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2016-1907
|
||||
|
||||
[YOCTO #8935]
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
packet.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
Index: openssh-7.1p2/packet.c
|
||||
===================================================================
|
||||
--- openssh-7.1p2.orig/packet.c
|
||||
+++ openssh-7.1p2/packet.c
|
||||
@@ -1855,6 +1855,7 @@ ssh_packet_process_incoming(struct ssh *
|
||||
if (len >= state->packet_discard) {
|
||||
if ((r = ssh_packet_stop_discard(ssh)) != 0)
|
||||
return r;
|
||||
+ return SSH_ERR_CONN_CORRUPT;
|
||||
}
|
||||
state->packet_discard -= len;
|
||||
return 0;
|
||||
@@ -20,12 +20,15 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
|
||||
file://sshdgenkeys.service \
|
||||
file://volatiles.99_sshd \
|
||||
file://add-test-support-for-busybox.patch \
|
||||
file://run-ptest"
|
||||
file://run-ptest \
|
||||
file://CVE-2016-1907_upstream_commit.patch \
|
||||
file://CVE-2016-1907_2.patch \
|
||||
file://CVE-2016-1907_3.patch "
|
||||
|
||||
PAM_SRC_URI = "file://sshd"
|
||||
|
||||
SRC_URI[md5sum] = "8709736bc8a8c253bc4eeb4829888ca5"
|
||||
SRC_URI[sha256sum] = "fc0a6d2d1d063d5c66dffd952493d0cda256cad204f681de0f84ef85b2ad8428"
|
||||
SRC_URI[md5sum] = "4d8547670e2a220d5ef805ad9e47acf2"
|
||||
SRC_URI[sha256sum] = "dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd"
|
||||
|
||||
inherit useradd update-rc.d update-alternatives systemd
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From 00456fded43eadd4bb94bf675ae4ea5d158a764f Mon Sep 17 00:00:00 2001
|
||||
From: "Dr. Stephen Henson" <steve@openssl.org>
|
||||
Date: Wed, 4 Nov 2015 13:30:03 +0000
|
||||
Subject: [PATCH] Add test for CVE-2015-3194
|
||||
|
||||
Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
This patch was imported from
|
||||
https://git.openssl.org/?p=openssl.git;a=commit;h=00456fded43eadd4bb94bf675ae4ea5d158a764f
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
test/certs/pss1.pem | 21 +++++++++++++++++++++
|
||||
test/tx509 | 7 +++++++
|
||||
2 files changed, 28 insertions(+)
|
||||
create mode 100644 test/certs/pss1.pem
|
||||
|
||||
diff --git a/test/certs/pss1.pem b/test/certs/pss1.pem
|
||||
new file mode 100644
|
||||
index 0000000..29da71d
|
||||
--- /dev/null
|
||||
+++ b/test/certs/pss1.pem
|
||||
@@ -0,0 +1,21 @@
|
||||
+-----BEGIN CERTIFICATE-----
|
||||
+MIIDdjCCAjqgAwIBAgIJANcwZLyfEv7DMD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZI
|
||||
+AWUDBAIBoRowGAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCAaIEAgIA3jAnMSUwIwYD
|
||||
+VQQDDBxUZXN0IEludmFsaWQgUFNTIGNlcnRpZmljYXRlMB4XDTE1MTEwNDE2MDIz
|
||||
+NVoXDTE1MTIwNDE2MDIzNVowJzElMCMGA1UEAwwcVGVzdCBJbnZhbGlkIFBTUyBj
|
||||
+ZXJ0aWZpY2F0ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMTaM7WH
|
||||
+qVCAGAIA+zL1KWvvASTrhlq+1ePdO7wsrWX2KiYoTYrJYTnxhLnn0wrHqApt79nL
|
||||
+IBG7cfShyZqFHOY/IzlYPMVt+gPo293gw96Fds5JBsjhjkyGnOyr9OUntFqvxDbT
|
||||
+IIFU7o9IdxD4edaqjRv+fegVE+B79pDk4s0ujsk6dULtCg9Rst0ucGFo19mr+b7k
|
||||
+dbfn8pZ72ZNDJPueVdrUAWw9oll61UcYfk75XdrLk6JlL41GrYHc8KlfXf43gGQq
|
||||
+QfrpHkg4Ih2cI6Wt2nhFGAzrlcorzLliQIUJRIhM8h4IgDfpBpaPdVQLqS2pFbXa
|
||||
+5eQjqiyJwak2vJ8CAwEAAaNQME4wHQYDVR0OBBYEFCt180N4oGUt5LbzBwQ4Ia+2
|
||||
+4V97MB8GA1UdIwQYMBaAFCt180N4oGUt5LbzBwQ4Ia+24V97MAwGA1UdEwQFMAMB
|
||||
+Af8wMQYJKoZIhvcNAQEKMCSgDTALBglghkgBZQMEAgGhDTALBgkqhkiG9w0BAQii
|
||||
+BAICAN4DggEBAAjBtm90lGxgddjc4Xu/nbXXFHVs2zVcHv/mqOZoQkGB9r/BVgLb
|
||||
+xhHrFZ2pHGElbUYPfifdS9ztB73e1d4J+P29o0yBqfd4/wGAc/JA8qgn6AAEO/Xn
|
||||
+plhFeTRJQtLZVl75CkHXgUGUd3h+ADvKtcBuW9dSUncaUrgNKR8u/h/2sMG38RWY
|
||||
+DzBddC/66YTa3r7KkVUfW7yqRQfELiGKdcm+bjlTEMsvS+EhHup9CzbpoCx2Fx9p
|
||||
+NPtFY3yEObQhmL1JyoCRWqBE75GzFPbRaiux5UpEkns+i3trkGssZzsOuVqHNTNZ
|
||||
+lC9+9hPHIoc9UMmAQNo1vGIW3NWVoeGbaJ8=
|
||||
+-----END CERTIFICATE-----
|
||||
diff --git a/test/tx509 b/test/tx509
|
||||
index 0ce3b52..77f5cac 100644
|
||||
--- a/test/tx509
|
||||
+++ b/test/tx509
|
||||
@@ -74,5 +74,12 @@ if [ $? != 0 ]; then exit 1; fi
|
||||
cmp x509-f.p x509-ff.p3
|
||||
if [ $? != 0 ]; then exit 1; fi
|
||||
|
||||
+echo "Parsing test certificates"
|
||||
+
|
||||
+$cmd -in certs/pss1.pem -text -noout >/dev/null
|
||||
+if [ $? != 0 ]; then exit 1; fi
|
||||
+
|
||||
+echo OK
|
||||
+
|
||||
/bin/rm -f x509-f.* x509-ff.* x509-fff.*
|
||||
exit 0
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
From d73cc256c8e256c32ed959456101b73ba9842f72 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Polyakov <appro@openssl.org>
|
||||
Date: Tue, 1 Dec 2015 09:00:32 +0100
|
||||
Subject: [PATCH] bn/asm/x86_64-mont5.pl: fix carry propagating bug
|
||||
(CVE-2015-3193).
|
||||
|
||||
Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
(cherry picked from commit e7c078db57908cbf16074c68034977565ffaf107)
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
This patch was imported from
|
||||
https://git.openssl.org/?p=openssl.git;a=commit;h=d73cc256c8e256c32ed959456101b73ba9842f72
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
crypto/bn/asm/x86_64-mont5.pl | 22 +++++++++++++++++++---
|
||||
crypto/bn/bntest.c | 18 ++++++++++++++++++
|
||||
2 files changed, 37 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: openssl-1.0.2d/crypto/bn/asm/x86_64-mont5.pl
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/crypto/bn/asm/x86_64-mont5.pl
|
||||
+++ openssl-1.0.2d/crypto/bn/asm/x86_64-mont5.pl
|
||||
@@ -1779,6 +1779,15 @@ sqr8x_reduction:
|
||||
.align 32
|
||||
.L8x_tail_done:
|
||||
add (%rdx),%r8 # can this overflow?
|
||||
+ adc \$0,%r9
|
||||
+ adc \$0,%r10
|
||||
+ adc \$0,%r11
|
||||
+ adc \$0,%r12
|
||||
+ adc \$0,%r13
|
||||
+ adc \$0,%r14
|
||||
+ adc \$0,%r15 # can't overflow, because we
|
||||
+ # started with "overhung" part
|
||||
+ # of multiplication
|
||||
xor %rax,%rax
|
||||
|
||||
neg $carry
|
||||
@@ -3125,6 +3134,15 @@ sqrx8x_reduction:
|
||||
.align 32
|
||||
.Lsqrx8x_tail_done:
|
||||
add 24+8(%rsp),%r8 # can this overflow?
|
||||
+ adc \$0,%r9
|
||||
+ adc \$0,%r10
|
||||
+ adc \$0,%r11
|
||||
+ adc \$0,%r12
|
||||
+ adc \$0,%r13
|
||||
+ adc \$0,%r14
|
||||
+ adc \$0,%r15 # can't overflow, because we
|
||||
+ # started with "overhung" part
|
||||
+ # of multiplication
|
||||
mov $carry,%rax # xor %rax,%rax
|
||||
|
||||
sub 16+8(%rsp),$carry # mov 16(%rsp),%cf
|
||||
@@ -3168,13 +3186,11 @@ my ($rptr,$nptr)=("%rdx","%rbp");
|
||||
my @ri=map("%r$_",(10..13));
|
||||
my @ni=map("%r$_",(14..15));
|
||||
$code.=<<___;
|
||||
- xor %rbx,%rbx
|
||||
+ xor %ebx,%ebx
|
||||
sub %r15,%rsi # compare top-most words
|
||||
adc %rbx,%rbx
|
||||
mov %rcx,%r10 # -$num
|
||||
- .byte 0x67
|
||||
or %rbx,%rax
|
||||
- .byte 0x67
|
||||
mov %rcx,%r9 # -$num
|
||||
xor \$1,%rax
|
||||
sar \$3+2,%rcx # cf=0
|
||||
Index: openssl-1.0.2d/crypto/bn/bntest.c
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/crypto/bn/bntest.c
|
||||
+++ openssl-1.0.2d/crypto/bn/bntest.c
|
||||
@@ -1027,6 +1027,24 @@ int test_mod_exp_mont_consttime(BIO *bp,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /* Regression test for carry propagation bug in sqr8x_reduction */
|
||||
+ BN_hex2bn(&a, "050505050505");
|
||||
+ BN_hex2bn(&b, "02");
|
||||
+ BN_hex2bn(&c,
|
||||
+ "4141414141414141414141274141414141414141414141414141414141414141"
|
||||
+ "4141414141414141414141414141414141414141414141414141414141414141"
|
||||
+ "4141414141414141414141800000000000000000000000000000000000000000"
|
||||
+ "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
+ "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
+ "0000000000000000000000000000000000000000000000000000000001");
|
||||
+ BN_mod_exp(d, a, b, c, ctx);
|
||||
+ BN_mul(e, a, a, ctx);
|
||||
+ if (BN_cmp(d, e)) {
|
||||
+ fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
BN_free(a);
|
||||
BN_free(b);
|
||||
BN_free(c);
|
||||
@@ -0,0 +1,45 @@
|
||||
From c394a488942387246653833359a5c94b5832674e Mon Sep 17 00:00:00 2001
|
||||
From: "Dr. Stephen Henson" <steve@openssl.org>
|
||||
Date: Fri, 2 Oct 2015 12:35:19 +0100
|
||||
Subject: [PATCH] Add PSS parameter check.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Avoid seg fault by checking mgf1 parameter is not NULL. This can be
|
||||
triggered during certificate verification so could be a DoS attack
|
||||
against a client or a server enabling client authentication.
|
||||
|
||||
Thanks to Loïc Jonas Etienne (Qnective AG) for discovering this bug.
|
||||
|
||||
CVE-2015-3194
|
||||
|
||||
Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
This patch was imported from
|
||||
https://git.openssl.org/?p=openssl.git;a=commit;h=c394a488942387246653833359a5c94b5832674e
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
crypto/rsa/rsa_ameth.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c
|
||||
index ca3922e..4e06218 100644
|
||||
--- a/crypto/rsa/rsa_ameth.c
|
||||
+++ b/crypto/rsa/rsa_ameth.c
|
||||
@@ -268,7 +268,7 @@ static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg)
|
||||
{
|
||||
const unsigned char *p;
|
||||
int plen;
|
||||
- if (alg == NULL)
|
||||
+ if (alg == NULL || alg->parameter == NULL)
|
||||
return NULL;
|
||||
if (OBJ_obj2nid(alg->algorithm) != NID_mgf1)
|
||||
return NULL;
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From cc598f321fbac9c04da5766243ed55d55948637d Mon Sep 17 00:00:00 2001
|
||||
From: "Dr. Stephen Henson" <steve@openssl.org>
|
||||
Date: Tue, 10 Nov 2015 19:03:07 +0000
|
||||
Subject: [PATCH] Fix leak with ASN.1 combine.
|
||||
|
||||
When parsing a combined structure pass a flag to the decode routine
|
||||
so on error a pointer to the parent structure is not zeroed as
|
||||
this will leak any additional components in the parent.
|
||||
|
||||
This can leak memory in any application parsing PKCS#7 or CMS structures.
|
||||
|
||||
CVE-2015-3195.
|
||||
|
||||
Thanks to Adam Langley (Google/BoringSSL) for discovering this bug using
|
||||
libFuzzer.
|
||||
|
||||
PR#4131
|
||||
|
||||
Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
This patch was imported from
|
||||
https://git.openssl.org/?p=openssl.git;a=commit;h=cc598f321fbac9c04da5766243ed55d55948637d
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
crypto/asn1/tasn_dec.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
|
||||
index febf605..9256049 100644
|
||||
--- a/crypto/asn1/tasn_dec.c
|
||||
+++ b/crypto/asn1/tasn_dec.c
|
||||
@@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
int otag;
|
||||
int ret = 0;
|
||||
ASN1_VALUE **pchptr, *ptmpval;
|
||||
+ int combine = aclass & ASN1_TFLG_COMBINE;
|
||||
+ aclass &= ~ASN1_TFLG_COMBINE;
|
||||
if (!pval)
|
||||
return 0;
|
||||
if (aux && aux->asn1_cb)
|
||||
@@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
auxerr:
|
||||
ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR);
|
||||
err:
|
||||
- ASN1_item_ex_free(pval, it);
|
||||
+ if (combine == 0)
|
||||
+ ASN1_item_ex_free(pval, it);
|
||||
if (errtt)
|
||||
ERR_add_error_data(4, "Field=", errtt->field_name,
|
||||
", Type=", it->sname);
|
||||
@@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val,
|
||||
} else {
|
||||
/* Nothing special */
|
||||
ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item),
|
||||
- -1, 0, opt, ctx);
|
||||
+ -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx);
|
||||
if (!ret) {
|
||||
ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR);
|
||||
goto err;
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
From d81a1600588b726c2bdccda7efad3cc7a87d6245 Mon Sep 17 00:00:00 2001
|
||||
From: Viktor Dukhovni <openssl-users@dukhovni.org>
|
||||
Date: Wed, 30 Dec 2015 22:44:51 -0500
|
||||
Subject: [PATCH] Better SSLv2 cipher-suite enforcement
|
||||
|
||||
Based on patch by: Nimrod Aviram <nimrod.aviram@gmail.com>
|
||||
|
||||
CVE-2015-3197
|
||||
|
||||
Reviewed-by: Tim Hudson <tjh@openssl.org>
|
||||
Reviewed-by: Richard Levitte <levitte@openssl.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
https://github.com/openssl/openssl/commit/d81a1600588b726c2bdccda7efad3cc7a87d6245
|
||||
|
||||
CVE: CVE-2015-3197
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
ssl/s2_srvr.c | 15 +++++++++++++--
|
||||
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: openssl-1.0.2d/ssl/s2_srvr.c
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/ssl/s2_srvr.c
|
||||
+++ openssl-1.0.2d/ssl/s2_srvr.c
|
||||
@@ -402,7 +402,7 @@ static int get_client_master_key(SSL *s)
|
||||
}
|
||||
|
||||
cp = ssl2_get_cipher_by_char(p);
|
||||
- if (cp == NULL) {
|
||||
+ if (cp == NULL || sk_SSL_CIPHER_find(s->session->ciphers, cp) < 0) {
|
||||
ssl2_return_error(s, SSL2_PE_NO_CIPHER);
|
||||
SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_NO_CIPHER_MATCH);
|
||||
return (-1);
|
||||
@@ -687,8 +687,12 @@ static int get_client_hello(SSL *s)
|
||||
prio = cs;
|
||||
allow = cl;
|
||||
}
|
||||
+
|
||||
+ /* Generate list of SSLv2 ciphers shared between client and server */
|
||||
for (z = 0; z < sk_SSL_CIPHER_num(prio); z++) {
|
||||
- if (sk_SSL_CIPHER_find(allow, sk_SSL_CIPHER_value(prio, z)) < 0) {
|
||||
+ const SSL_CIPHER *cp = sk_SSL_CIPHER_value(prio, z);
|
||||
+ if ((cp->algorithm_ssl & SSL_SSLV2) == 0 ||
|
||||
+ sk_SSL_CIPHER_find(allow, cp) < 0) {
|
||||
(void)sk_SSL_CIPHER_delete(prio, z);
|
||||
z--;
|
||||
}
|
||||
@@ -697,6 +701,13 @@ static int get_client_hello(SSL *s)
|
||||
sk_SSL_CIPHER_free(s->session->ciphers);
|
||||
s->session->ciphers = prio;
|
||||
}
|
||||
+
|
||||
+ /* Make sure we have at least one cipher in common */
|
||||
+ if (sk_SSL_CIPHER_num(s->session->ciphers) == 0) {
|
||||
+ ssl2_return_error(s, SSL2_PE_NO_CIPHER);
|
||||
+ SSLerr(SSL_F_GET_CLIENT_HELLO, SSL_R_NO_CIPHER_MATCH);
|
||||
+ return -1;
|
||||
+ }
|
||||
/*
|
||||
* s->session->ciphers should now have a list of ciphers that are on
|
||||
* both the client and server. This list is ordered by the order the
|
||||
102
meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_1.patch
Normal file
102
meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_1.patch
Normal file
@@ -0,0 +1,102 @@
|
||||
From 878e2c5b13010329c203f309ed0c8f2113f85648 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Mon, 18 Jan 2016 11:31:58 +0000
|
||||
Subject: [PATCH] Prevent small subgroup attacks on DH/DHE
|
||||
|
||||
Historically OpenSSL only ever generated DH parameters based on "safe"
|
||||
primes. More recently (in version 1.0.2) support was provided for
|
||||
generating X9.42 style parameter files such as those required for RFC
|
||||
5114 support. The primes used in such files may not be "safe". Where an
|
||||
application is using DH configured with parameters based on primes that
|
||||
are not "safe" then an attacker could use this fact to find a peer's
|
||||
private DH exponent. This attack requires that the attacker complete
|
||||
multiple handshakes in which the peer uses the same DH exponent.
|
||||
|
||||
A simple mitigation is to ensure that y^q (mod p) == 1
|
||||
|
||||
CVE-2016-0701 (fix part 1 of 2)
|
||||
|
||||
Issue reported by Antonio Sanso.
|
||||
|
||||
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
https://github.com/openssl/openssl/commit/878e2c5b13010329c203f309ed0c8f2113f85648
|
||||
|
||||
CVE: CVE-2016-0701
|
||||
Signed-of-by: Armin Kuster <akuster@mvisa.com>
|
||||
|
||||
---
|
||||
crypto/dh/dh.h | 1 +
|
||||
crypto/dh/dh_check.c | 35 +++++++++++++++++++++++++----------
|
||||
2 files changed, 26 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h
|
||||
index b177673..5498a9d 100644
|
||||
--- a/crypto/dh/dh.h
|
||||
+++ b/crypto/dh/dh.h
|
||||
@@ -174,6 +174,7 @@ struct dh_st {
|
||||
/* DH_check_pub_key error codes */
|
||||
# define DH_CHECK_PUBKEY_TOO_SMALL 0x01
|
||||
# define DH_CHECK_PUBKEY_TOO_LARGE 0x02
|
||||
+# define DH_CHECK_PUBKEY_INVALID 0x03
|
||||
|
||||
/*
|
||||
* primes p where (p-1)/2 is prime too are called "safe"; we define this for
|
||||
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
|
||||
index 347467c..5adedc0 100644
|
||||
--- a/crypto/dh/dh_check.c
|
||||
+++ b/crypto/dh/dh_check.c
|
||||
@@ -151,23 +151,38 @@ int DH_check(const DH *dh, int *ret)
|
||||
int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret)
|
||||
{
|
||||
int ok = 0;
|
||||
- BIGNUM *q = NULL;
|
||||
+ BIGNUM *tmp = NULL;
|
||||
+ BN_CTX *ctx = NULL;
|
||||
|
||||
*ret = 0;
|
||||
- q = BN_new();
|
||||
- if (q == NULL)
|
||||
+ ctx = BN_CTX_new();
|
||||
+ if (ctx == NULL)
|
||||
goto err;
|
||||
- BN_set_word(q, 1);
|
||||
- if (BN_cmp(pub_key, q) <= 0)
|
||||
+ BN_CTX_start(ctx);
|
||||
+ tmp = BN_CTX_get(ctx);
|
||||
+ if (tmp == NULL)
|
||||
+ goto err;
|
||||
+ BN_set_word(tmp, 1);
|
||||
+ if (BN_cmp(pub_key, tmp) <= 0)
|
||||
*ret |= DH_CHECK_PUBKEY_TOO_SMALL;
|
||||
- BN_copy(q, dh->p);
|
||||
- BN_sub_word(q, 1);
|
||||
- if (BN_cmp(pub_key, q) >= 0)
|
||||
+ BN_copy(tmp, dh->p);
|
||||
+ BN_sub_word(tmp, 1);
|
||||
+ if (BN_cmp(pub_key, tmp) >= 0)
|
||||
*ret |= DH_CHECK_PUBKEY_TOO_LARGE;
|
||||
|
||||
+ if (dh->q != NULL) {
|
||||
+ /* Check pub_key^q == 1 mod p */
|
||||
+ if (!BN_mod_exp(tmp, pub_key, dh->q, dh->p, ctx))
|
||||
+ goto err;
|
||||
+ if (!BN_is_one(tmp))
|
||||
+ *ret |= DH_CHECK_PUBKEY_INVALID;
|
||||
+ }
|
||||
+
|
||||
ok = 1;
|
||||
err:
|
||||
- if (q != NULL)
|
||||
- BN_free(q);
|
||||
+ if (ctx != NULL) {
|
||||
+ BN_CTX_end(ctx);
|
||||
+ BN_CTX_free(ctx);
|
||||
+ }
|
||||
return (ok);
|
||||
}
|
||||
--
|
||||
2.3.5
|
||||
|
||||
156
meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch
Normal file
156
meta/recipes-connectivity/openssl/openssl/CVE-2016-0701_2.patch
Normal file
@@ -0,0 +1,156 @@
|
||||
From c5b831f21d0d29d1e517d139d9d101763f60c9a2 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Caswell <matt@openssl.org>
|
||||
Date: Thu, 17 Dec 2015 02:57:20 +0000
|
||||
Subject: [PATCH] Always generate DH keys for ephemeral DH cipher suites
|
||||
|
||||
Modified version of the commit ffaef3f15 in the master branch by Stephen
|
||||
Henson. This makes the SSL_OP_SINGLE_DH_USE option a no-op and always
|
||||
generates a new DH key for every handshake regardless.
|
||||
|
||||
CVE-2016-0701 (fix part 2 or 2)
|
||||
|
||||
Issue reported by Antonio Sanso
|
||||
|
||||
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
https://github.com/openssl/openssl/commit/c5b831f21d0d29d1e517d139d9d101763f60c9a2
|
||||
|
||||
CVE: CVE-2016-0701 #2
|
||||
Signed-of-by: Armin Kuster <akuster@mvisa.com>
|
||||
|
||||
---
|
||||
doc/ssl/SSL_CTX_set_tmp_dh_callback.pod | 29 +++++------------------------
|
||||
ssl/s3_lib.c | 14 --------------
|
||||
ssl/s3_srvr.c | 17 +++--------------
|
||||
ssl/ssl.h | 2 +-
|
||||
4 files changed, 9 insertions(+), 53 deletions(-)
|
||||
|
||||
Index: openssl-1.0.2d/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
|
||||
+++ openssl-1.0.2d/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod
|
||||
@@ -48,25 +48,8 @@ even if he gets hold of the normal (cert
|
||||
only used for signing.
|
||||
|
||||
In order to perform a DH key exchange the server must use a DH group
|
||||
-(DH parameters) and generate a DH key.
|
||||
-The server will always generate a new DH key during the negotiation
|
||||
-if either the DH parameters are supplied via callback or the
|
||||
-SSL_OP_SINGLE_DH_USE option of SSL_CTX_set_options(3) is set (or both).
|
||||
-It will immediately create a DH key if DH parameters are supplied via
|
||||
-SSL_CTX_set_tmp_dh() and SSL_OP_SINGLE_DH_USE is not set.
|
||||
-In this case,
|
||||
-it may happen that a key is generated on initialization without later
|
||||
-being needed, while on the other hand the computer time during the
|
||||
-negotiation is being saved.
|
||||
-
|
||||
-If "strong" primes were used to generate the DH parameters, it is not strictly
|
||||
-necessary to generate a new key for each handshake but it does improve forward
|
||||
-secrecy. If it is not assured that "strong" primes were used,
|
||||
-SSL_OP_SINGLE_DH_USE must be used in order to prevent small subgroup
|
||||
-attacks. Always using SSL_OP_SINGLE_DH_USE has an impact on the
|
||||
-computer time needed during negotiation, but it is not very large, so
|
||||
-application authors/users should consider always enabling this option.
|
||||
-The option is required to implement perfect forward secrecy (PFS).
|
||||
+(DH parameters) and generate a DH key. The server will always generate
|
||||
+a new DH key during the negotiation.
|
||||
|
||||
As generating DH parameters is extremely time consuming, an application
|
||||
should not generate the parameters on the fly but supply the parameters.
|
||||
@@ -93,10 +76,9 @@ can supply the DH parameters via a callb
|
||||
Previous versions of the callback used B<is_export> and B<keylength>
|
||||
parameters to control parameter generation for export and non-export
|
||||
cipher suites. Modern servers that do not support export ciphersuites
|
||||
-are advised to either use SSL_CTX_set_tmp_dh() in combination with
|
||||
-SSL_OP_SINGLE_DH_USE, or alternatively, use the callback but ignore
|
||||
-B<keylength> and B<is_export> and simply supply at least 2048-bit
|
||||
-parameters in the callback.
|
||||
+are advised to either use SSL_CTX_set_tmp_dh() or alternatively, use
|
||||
+the callback but ignore B<keylength> and B<is_export> and simply
|
||||
+supply at least 2048-bit parameters in the callback.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
@@ -128,7 +110,6 @@ partly left out.)
|
||||
if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) {
|
||||
/* Error. */
|
||||
}
|
||||
- SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE);
|
||||
...
|
||||
|
||||
=head1 RETURN VALUES
|
||||
Index: openssl-1.0.2d/ssl/s3_lib.c
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/ssl/s3_lib.c
|
||||
+++ openssl-1.0.2d/ssl/s3_lib.c
|
||||
@@ -3206,13 +3206,6 @@ long ssl3_ctrl(SSL *s, int cmd, long lar
|
||||
SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
|
||||
return (ret);
|
||||
}
|
||||
- if (!(s->options & SSL_OP_SINGLE_DH_USE)) {
|
||||
- if (!DH_generate_key(dh)) {
|
||||
- DH_free(dh);
|
||||
- SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB);
|
||||
- return (ret);
|
||||
- }
|
||||
- }
|
||||
if (s->cert->dh_tmp != NULL)
|
||||
DH_free(s->cert->dh_tmp);
|
||||
s->cert->dh_tmp = dh;
|
||||
@@ -3710,13 +3703,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd
|
||||
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
|
||||
return 0;
|
||||
}
|
||||
- if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) {
|
||||
- if (!DH_generate_key(new)) {
|
||||
- SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB);
|
||||
- DH_free(new);
|
||||
- return 0;
|
||||
- }
|
||||
- }
|
||||
if (cert->dh_tmp != NULL)
|
||||
DH_free(cert->dh_tmp);
|
||||
cert->dh_tmp = new;
|
||||
Index: openssl-1.0.2d/ssl/s3_srvr.c
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/ssl/s3_srvr.c
|
||||
+++ openssl-1.0.2d/ssl/s3_srvr.c
|
||||
@@ -1684,20 +1684,9 @@ int ssl3_send_server_key_exchange(SSL *s
|
||||
}
|
||||
|
||||
s->s3->tmp.dh = dh;
|
||||
- if ((dhp->pub_key == NULL ||
|
||||
- dhp->priv_key == NULL ||
|
||||
- (s->options & SSL_OP_SINGLE_DH_USE))) {
|
||||
- if (!DH_generate_key(dh)) {
|
||||
- SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB);
|
||||
- goto err;
|
||||
- }
|
||||
- } else {
|
||||
- dh->pub_key = BN_dup(dhp->pub_key);
|
||||
- dh->priv_key = BN_dup(dhp->priv_key);
|
||||
- if ((dh->pub_key == NULL) || (dh->priv_key == NULL)) {
|
||||
- SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB);
|
||||
- goto err;
|
||||
- }
|
||||
+ if (!DH_generate_key(dh)) {
|
||||
+ SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB);
|
||||
+ goto err;
|
||||
}
|
||||
r[0] = dh->p;
|
||||
r[1] = dh->g;
|
||||
Index: openssl-1.0.2d/ssl/ssl.h
|
||||
===================================================================
|
||||
--- openssl-1.0.2d.orig/ssl/ssl.h
|
||||
+++ openssl-1.0.2d/ssl/ssl.h
|
||||
@@ -625,7 +625,7 @@ struct ssl_session_st {
|
||||
# define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L
|
||||
/* If set, always create a new key when using tmp_ecdh parameters */
|
||||
# define SSL_OP_SINGLE_ECDH_USE 0x00080000L
|
||||
-/* If set, always create a new key when using tmp_dh parameters */
|
||||
+/* Does nothing: retained for compatibility */
|
||||
# define SSL_OP_SINGLE_DH_USE 0x00100000L
|
||||
/* Does nothing: retained for compatibiity */
|
||||
# define SSL_OP_EPHEMERAL_RSA 0x0
|
||||
@@ -37,6 +37,13 @@ SRC_URI += "file://configure-targets.patch \
|
||||
file://crypto_use_bigint_in_x86-64_perl.patch \
|
||||
file://openssl-1.0.2a-x32-asm.patch \
|
||||
file://ptest_makefile_deps.patch \
|
||||
file://CVE-2015-3193-bn-asm-x86_64-mont5.pl-fix-carry-propagating-bug-CVE.patch \
|
||||
file://CVE-2015-3194-1-Add-PSS-parameter-check.patch \
|
||||
file://0001-Add-test-for-CVE-2015-3194.patch \
|
||||
file://CVE-2015-3195-Fix-leak-with-ASN.1-combine.patch \
|
||||
file://CVE-2015-3197.patch \
|
||||
file://CVE-2016-0701_1.patch \
|
||||
file://CVE-2016-0701_2.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "38dd619b2e77cbac69b99f52a053d25a"
|
||||
@@ -56,3 +63,13 @@ PARALLEL_MAKEINST = ""
|
||||
do_configure_prepend() {
|
||||
cp ${WORKDIR}/find.pl ${S}/util/find.pl
|
||||
}
|
||||
|
||||
# The crypto_use_bigint patch means that perl's bignum module needs to be
|
||||
# installed, but some distributions (for example Fedora 23) don't ship it by
|
||||
# default. As the resulting error is very misleading check for bignum before
|
||||
# building.
|
||||
do_configure_prepend() {
|
||||
if ! perl -Mbigint -e true; then
|
||||
bbfatal "The perl module 'bignum' was not found but this is required to build openssl. Please install this module (often packaged as perl-bignum) and re-run bitbake."
|
||||
fi
|
||||
}
|
||||
|
||||
372
meta/recipes-connectivity/socat/socat/CVE-2016-2217.patch
Normal file
372
meta/recipes-connectivity/socat/socat/CVE-2016-2217.patch
Normal file
@@ -0,0 +1,372 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
http://www.dest-unreach.org/socat/download/socat-1.7.3.1.patch
|
||||
|
||||
CVE: CVE-2016-2217
|
||||
[Yocto # 9024]
|
||||
Singed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
Index: socat-1.7.3.0/CHANGES
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/CHANGES
|
||||
+++ socat-1.7.3.0/CHANGES
|
||||
@@ -1,8 +1,39 @@
|
||||
|
||||
+####################### V 1.7.3.1:
|
||||
+
|
||||
+security:
|
||||
+ Socat security advisory 8
|
||||
+ A stack overflow in vulnerability was found that can be triggered when
|
||||
+ command line arguments (complete address specifications, host names,
|
||||
+ file names) are longer than 512 bytes.
|
||||
+ Successful exploitation might allow an attacker to execute arbitrary
|
||||
+ code with the privileges of the socat process.
|
||||
+ This vulnerability can only be exploited when an attacker is able to
|
||||
+ inject data into socat's command line.
|
||||
+ A vulnerable scenario would be a CGI script that reads data from clients
|
||||
+ and uses (parts of) this data as hostname for a Socat invocation.
|
||||
+ Test: NESTEDOVFL
|
||||
+ Credits to Takumi Akiyama for finding and reporting this issue.
|
||||
+
|
||||
+ Socat security advisory 7
|
||||
+ MSVR-1499
|
||||
+ In the OpenSSL address implementation the hard coded 1024 bit DH p
|
||||
+ parameter was not prime. The effective cryptographic strength of a key
|
||||
+ exchange using these parameters was weaker than the one one could get by
|
||||
+ using a prime p. Moreover, since there is no indication of how these
|
||||
+ parameters were chosen, the existence of a trapdoor that makes possible
|
||||
+ for an eavesdropper to recover the shared secret from a key exchange
|
||||
+ that uses them cannot be ruled out.
|
||||
+ Futhermore, 1024bit is not considered sufficiently secure.
|
||||
+ Fix: generated a new 2048bit prime.
|
||||
+ Thanks to Santiago Zanella-Beguelin and Microsoft Vulnerability
|
||||
+ Research (MSVR) for finding and reporting this issue.
|
||||
+
|
||||
####################### V 1.7.3.0:
|
||||
|
||||
security:
|
||||
- (CVE Id pending)
|
||||
+ Socat security advisory 6
|
||||
+ CVE-2015-1379: Possible DoS with fork
|
||||
Fixed problems with signal handling caused by use of not async signal
|
||||
safe functions in signal handlers that could freeze socat, allowing
|
||||
denial of service attacks.
|
||||
@@ -240,6 +271,7 @@ docu:
|
||||
####################### V 1.7.2.3:
|
||||
|
||||
security:
|
||||
+ Socat security advisory 5
|
||||
CVE-2014-0019: socats PROXY-CONNECT address was vulnerable to a buffer
|
||||
overflow with data from command line (see socat-secadv5.txt)
|
||||
Credits to Florian Weimer of the Red Hat Product Security Team
|
||||
@@ -247,6 +279,7 @@ security:
|
||||
####################### V 1.7.2.2:
|
||||
|
||||
security:
|
||||
+ Socat security advisory 4
|
||||
CVE-2013-3571:
|
||||
after refusing a client connection due to bad source address or source
|
||||
port socat shutdown() the socket but did not close() it, resulting in
|
||||
@@ -258,6 +291,7 @@ security:
|
||||
####################### V 1.7.2.1:
|
||||
|
||||
security:
|
||||
+ Socat security advisory 3
|
||||
CVE-2012-0219:
|
||||
fixed a possible heap buffer overflow in the readline address. This bug
|
||||
could be exploited when all of the following conditions were met:
|
||||
@@ -391,6 +425,7 @@ docu:
|
||||
####################### V 1.7.1.3:
|
||||
|
||||
security:
|
||||
+ Socat security advisory 2
|
||||
CVE-2010-2799:
|
||||
fixed a stack overflow vulnerability that occurred when command
|
||||
line arguments (whole addresses, host names, file names) were longer
|
||||
@@ -892,6 +927,7 @@ further corrections:
|
||||
####################### V 1.4.0.3:
|
||||
|
||||
security:
|
||||
+ Socat security advisory 1
|
||||
CVE-2004-1484:
|
||||
fix to a syslog() based format string vulnerability that can lead to
|
||||
remote code execution. See advisory socat-adv-1.txt
|
||||
Index: socat-1.7.3.0/VERSION
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/VERSION
|
||||
+++ socat-1.7.3.0/VERSION
|
||||
@@ -1 +1 @@
|
||||
-"1.7.3.0"
|
||||
+"1.7.3.1"
|
||||
Index: socat-1.7.3.0/nestlex.c
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/nestlex.c
|
||||
+++ socat-1.7.3.0/nestlex.c
|
||||
@@ -1,5 +1,5 @@
|
||||
/* source: nestlex.c */
|
||||
-/* Copyright Gerhard Rieger 2006-2010 */
|
||||
+/* Copyright Gerhard Rieger */
|
||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||
|
||||
/* a function for lexical scanning of nested character patterns */
|
||||
@@ -9,6 +9,17 @@
|
||||
|
||||
#include "sysincludes.h"
|
||||
|
||||
+static int _nestlex(const char **addr,
|
||||
+ char **token,
|
||||
+ ptrdiff_t *len,
|
||||
+ const char *ends[],
|
||||
+ const char *hquotes[],
|
||||
+ const char *squotes[],
|
||||
+ const char *nests[],
|
||||
+ bool dropquotes,
|
||||
+ bool c_esc,
|
||||
+ bool html_esc
|
||||
+ );
|
||||
|
||||
/* sub: scan a string and copy its value to output string
|
||||
end scanning when an unescaped, unnested string from ends array is found
|
||||
@@ -33,6 +44,22 @@ int nestlex(const char **addr, /* input
|
||||
bool c_esc, /* solve C char escapes: \n \t \0 etc */
|
||||
bool html_esc /* solve HTML char escapes: %0d %08 etc */
|
||||
) {
|
||||
+ return
|
||||
+ _nestlex(addr, token, (ptrdiff_t *)len, ends, hquotes, squotes, nests,
|
||||
+ dropquotes, c_esc, html_esc);
|
||||
+}
|
||||
+
|
||||
+static int _nestlex(const char **addr,
|
||||
+ char **token,
|
||||
+ ptrdiff_t *len,
|
||||
+ const char *ends[],
|
||||
+ const char *hquotes[],
|
||||
+ const char *squotes[],
|
||||
+ const char *nests[],
|
||||
+ bool dropquotes,
|
||||
+ bool c_esc,
|
||||
+ bool html_esc
|
||||
+ ) {
|
||||
const char *in = *addr; /* pointer into input string */
|
||||
const char **endx; /* loops over end patterns */
|
||||
const char **quotx; /* loops over quote patterns */
|
||||
@@ -77,16 +104,18 @@ int nestlex(const char **addr, /* input
|
||||
if (--*len <= 0) { *addr = in; *token = out; return -1; }
|
||||
}
|
||||
}
|
||||
- /* we call nestlex recursively */
|
||||
+ /* we call _nestlex recursively */
|
||||
endnest[0] = *quotx;
|
||||
endnest[1] = NULL;
|
||||
result =
|
||||
- nestlex(&in, &out, len, endnest, NULL/*hquotes*/,
|
||||
+ _nestlex(&in, &out, len, endnest, NULL/*hquotes*/,
|
||||
NULL/*squotes*/, NULL/*nests*/,
|
||||
false, c_esc, html_esc);
|
||||
if (result == 0 && dropquotes) {
|
||||
/* we strip this quote */
|
||||
in += strlen(*quotx);
|
||||
+ } else if (result < 0) {
|
||||
+ *addr = in; *token = out; return result;
|
||||
} else {
|
||||
/* we copy the trailing quote */
|
||||
for (i = strlen(*quotx); i > 0; --i) {
|
||||
@@ -110,7 +139,7 @@ int nestlex(const char **addr, /* input
|
||||
if (!strncmp(in, *quotx, strlen(*quotx))) {
|
||||
/* this quote pattern matches */
|
||||
/* we strip this quote */
|
||||
- /* we call nestlex recursively */
|
||||
+ /* we call _nestlex recursively */
|
||||
const char *endnest[2];
|
||||
if (dropquotes) {
|
||||
/* we strip this quote */
|
||||
@@ -124,13 +153,15 @@ int nestlex(const char **addr, /* input
|
||||
endnest[0] = *quotx;
|
||||
endnest[1] = NULL;
|
||||
result =
|
||||
- nestlex(&in, &out, len, endnest, hquotes,
|
||||
+ _nestlex(&in, &out, len, endnest, hquotes,
|
||||
squotes, nests,
|
||||
false, c_esc, html_esc);
|
||||
|
||||
if (result == 0 && dropquotes) {
|
||||
/* we strip the trailing quote */
|
||||
in += strlen(*quotx);
|
||||
+ } else if (result < 0) {
|
||||
+ *addr = in; *token = out; return result;
|
||||
} else {
|
||||
/* we copy the trailing quote */
|
||||
for (i = strlen(*quotx); i > 0; --i) {
|
||||
@@ -162,7 +193,7 @@ int nestlex(const char **addr, /* input
|
||||
}
|
||||
|
||||
result =
|
||||
- nestlex(&in, &out, len, endnest, hquotes, squotes, nests,
|
||||
+ _nestlex(&in, &out, len, endnest, hquotes, squotes, nests,
|
||||
false, c_esc, html_esc);
|
||||
if (result == 0) {
|
||||
/* copy endnest */
|
||||
@@ -175,6 +206,8 @@ int nestlex(const char **addr, /* input
|
||||
}
|
||||
--i;
|
||||
}
|
||||
+ } else if (result < 0) {
|
||||
+ *addr = in; *token = out; return result;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -211,7 +244,7 @@ int nestlex(const char **addr, /* input
|
||||
}
|
||||
*out++ = c;
|
||||
--*len;
|
||||
- if (*len == 0) {
|
||||
+ if (*len <= 0) {
|
||||
*addr = in;
|
||||
*token = out;
|
||||
return -1; /* output overflow */
|
||||
@@ -222,7 +255,7 @@ int nestlex(const char **addr, /* input
|
||||
/* just a simple char */
|
||||
*out++ = c;
|
||||
--*len;
|
||||
- if (*len == 0) {
|
||||
+ if (*len <= 0) {
|
||||
*addr = in;
|
||||
*token = out;
|
||||
return -1; /* output overflow */
|
||||
Index: socat-1.7.3.0/nestlex.h
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/nestlex.h
|
||||
+++ socat-1.7.3.0/nestlex.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/* source: nestlex.h */
|
||||
-/* Copyright Gerhard Rieger 2006 */
|
||||
+/* Copyright Gerhard Rieger */
|
||||
/* Published under the GNU General Public License V.2, see file COPYING */
|
||||
|
||||
#ifndef __nestlex_h_included
|
||||
Index: socat-1.7.3.0/socat.spec
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/socat.spec
|
||||
+++ socat-1.7.3.0/socat.spec
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
%define majorver 1.7
|
||||
-%define minorver 3.0
|
||||
+%define minorver 3.1
|
||||
|
||||
Summary: socat - multipurpose relay
|
||||
Name: socat
|
||||
Index: socat-1.7.3.0/test.sh
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/test.sh
|
||||
+++ socat-1.7.3.0/test.sh
|
||||
@@ -2266,8 +2266,8 @@ gentestcert () {
|
||||
gentestdsacert () {
|
||||
local name="$1"
|
||||
if [ -s $name.key -a -s $name.crt -a -s $name.pem ]; then return; fi
|
||||
- openssl dsaparam -out $name-dsa.pem 512 >/dev/null 2>&1
|
||||
- openssl dhparam -dsaparam -out $name-dh.pem 512 >/dev/null 2>&1
|
||||
+ openssl dsaparam -out $name-dsa.pem 1024 >/dev/null 2>&1
|
||||
+ openssl dhparam -dsaparam -out $name-dh.pem 1024 >/dev/null 2>&1
|
||||
openssl req -newkey dsa:$name-dsa.pem -keyout $name.key -nodes -x509 -config $TESTCERT_CONF -out $name.crt -days 3653 >/dev/null 2>&1
|
||||
cat $name-dsa.pem $name-dh.pem $name.key $name.crt >$name.pem
|
||||
}
|
||||
@@ -10973,6 +10973,42 @@ CMD0="$TRACE $SOCAT $opts OPENSSL:localh
|
||||
printf "test $F_n $TEST... " $N
|
||||
$CMD0 </dev/null 1>&0 2>"${te}0"
|
||||
rc0=$?
|
||||
+if [ $rc0 -lt 128 ] || [ $rc0 -eq 255 ]; then
|
||||
+ $PRINTF "$OK\n"
|
||||
+ numOK=$((numOK+1))
|
||||
+else
|
||||
+ $PRINTF "$FAILED\n"
|
||||
+ echo "$CMD0"
|
||||
+ cat "${te}0"
|
||||
+ numFAIL=$((numFAIL+1))
|
||||
+ listFAIL="$listFAIL $N"
|
||||
+fi
|
||||
+fi # NUMCOND
|
||||
+ ;;
|
||||
+esac
|
||||
+PORT=$((PORT+1))
|
||||
+N=$((N+1))
|
||||
+
|
||||
+# socat up to 1.7.3.0 had a stack overflow vulnerability that occurred when
|
||||
+# command line arguments (whole addresses, host names, file names) were longer
|
||||
+# than 512 bytes and specially crafted.
|
||||
+NAME=NESTEDOVFL
|
||||
+case "$TESTS" in
|
||||
+*%$N%*|*%functions%*|*%bugs%*|*%security%*|*%exec%*|*%$NAME%*)
|
||||
+TEST="$NAME: stack overflow on overly long nested arg"
|
||||
+# provide a long host name to TCP-CONNECT and check socats exit code
|
||||
+if ! eval $NUMCOND; then :; else
|
||||
+tf="$td/test$N.stdout"
|
||||
+te="$td/test$N.stderr"
|
||||
+tdiff="$td/test$N.diff"
|
||||
+da="test$N $(date) $RANDOM"
|
||||
+# prepare long data - perl might not be installed
|
||||
+rm -f "$td/test$N.dat"
|
||||
+i=0; while [ $i -lt 64 ]; do echo -n "AAAAAAAAAAAAAAAA" >>"$td/test$N.dat"; i=$((i+1)); done
|
||||
+CMD0="$TRACE $SOCAT $opts EXEC:[$(cat "$td/test$N.dat")] STDIO"
|
||||
+printf "test $F_n $TEST... " $N
|
||||
+$CMD0 </dev/null 1>&0 2>"${te}0"
|
||||
+rc0=$?
|
||||
if [ $rc0 -lt 128 ] || [ $rc0 -eq 255 ]; then
|
||||
$PRINTF "$OK\n"
|
||||
numOK=$((numOK+1))
|
||||
Index: socat-1.7.3.0/xio-openssl.c
|
||||
===================================================================
|
||||
--- socat-1.7.3.0.orig/xio-openssl.c
|
||||
+++ socat-1.7.3.0/xio-openssl.c
|
||||
@@ -912,20 +912,27 @@ int
|
||||
}
|
||||
|
||||
{
|
||||
- static unsigned char dh1024_p[] = {
|
||||
- 0xCC,0x17,0xF2,0xDC,0x96,0xDF,0x59,0xA4,0x46,0xC5,0x3E,0x0E,
|
||||
- 0xB8,0x26,0x55,0x0C,0xE3,0x88,0xC1,0xCE,0xA7,0xBC,0xB3,0xBF,
|
||||
- 0x16,0x94,0xD8,0xA9,0x45,0xA2,0xCE,0xA9,0x5B,0x22,0x25,0x5F,
|
||||
- 0x92,0x59,0x94,0x1C,0x22,0xBF,0xCB,0xC8,0xC8,0x57,0xCB,0xBF,
|
||||
- 0xBC,0x0E,0xE8,0x40,0xF9,0x87,0x03,0xBF,0x60,0x9B,0x08,0xC6,
|
||||
- 0x8E,0x99,0xC6,0x05,0xFC,0x00,0xD6,0x6D,0x90,0xA8,0xF5,0xF8,
|
||||
- 0xD3,0x8D,0x43,0xC8,0x8F,0x7A,0xBD,0xBB,0x28,0xAC,0x04,0x69,
|
||||
- 0x4A,0x0B,0x86,0x73,0x37,0xF0,0x6D,0x4F,0x04,0xF6,0xF5,0xAF,
|
||||
- 0xBF,0xAB,0x8E,0xCE,0x75,0x53,0x4D,0x7F,0x7D,0x17,0x78,0x0E,
|
||||
- 0x12,0x46,0x4A,0xAF,0x95,0x99,0xEF,0xBC,0xA6,0xC5,0x41,0x77,
|
||||
- 0x43,0x7A,0xB9,0xEC,0x8E,0x07,0x3C,0x6D,
|
||||
+ static unsigned char dh2048_p[] = {
|
||||
+ 0x00,0xdc,0x21,0x64,0x56,0xbd,0x9c,0xb2,0xac,0xbe,0xc9,0x98,0xef,0x95,0x3e,
|
||||
+ 0x26,0xfa,0xb5,0x57,0xbc,0xd9,0xe6,0x75,0xc0,0x43,0xa2,0x1c,0x7a,0x85,0xdf,
|
||||
+ 0x34,0xab,0x57,0xa8,0xf6,0xbc,0xf6,0x84,0x7d,0x05,0x69,0x04,0x83,0x4c,0xd5,
|
||||
+ 0x56,0xd3,0x85,0x09,0x0a,0x08,0xff,0xb5,0x37,0xa1,0xa3,0x8a,0x37,0x04,0x46,
|
||||
+ 0xd2,0x93,0x31,0x96,0xf4,0xe4,0x0d,0x9f,0xbd,0x3e,0x7f,0x9e,0x4d,0xaf,0x08,
|
||||
+ 0xe2,0xe8,0x03,0x94,0x73,0xc4,0xdc,0x06,0x87,0xbb,0x6d,0xae,0x66,0x2d,0x18,
|
||||
+ 0x1f,0xd8,0x47,0x06,0x5c,0xcf,0x8a,0xb5,0x00,0x51,0x57,0x9b,0xea,0x1e,0xd8,
|
||||
+ 0xdb,0x8e,0x3c,0x1f,0xd3,0x2f,0xba,0x1f,0x5f,0x3d,0x15,0xc1,0x3b,0x2c,0x82,
|
||||
+ 0x42,0xc8,0x8c,0x87,0x79,0x5b,0x38,0x86,0x3a,0xeb,0xfd,0x81,0xa9,0xba,0xf7,
|
||||
+ 0x26,0x5b,0x93,0xc5,0x3e,0x03,0x30,0x4b,0x00,0x5c,0xb6,0x23,0x3e,0xea,0x94,
|
||||
+ 0xc3,0xb4,0x71,0xc7,0x6e,0x64,0x3b,0xf8,0x92,0x65,0xad,0x60,0x6c,0xd4,0x7b,
|
||||
+ 0xa9,0x67,0x26,0x04,0xa8,0x0a,0xb2,0x06,0xeb,0xe0,0x7d,0x90,0xdd,0xdd,0xf5,
|
||||
+ 0xcf,0xb4,0x11,0x7c,0xab,0xc1,0xa3,0x84,0xbe,0x27,0x77,0xc7,0xde,0x20,0x57,
|
||||
+ 0x66,0x47,0xa7,0x35,0xfe,0x0d,0x6a,0x1c,0x52,0xb8,0x58,0xbf,0x26,0x33,0x81,
|
||||
+ 0x5e,0xb7,0xa9,0xc0,0xee,0x58,0x11,0x74,0x86,0x19,0x08,0x89,0x1c,0x37,0x0d,
|
||||
+ 0x52,0x47,0x70,0x75,0x8b,0xa8,0x8b,0x30,0x11,0x71,0x36,0x62,0xf0,0x73,0x41,
|
||||
+ 0xee,0x34,0x9d,0x0a,0x2b,0x67,0x4e,0x6a,0xa3,0xe2,0x99,0x92,0x1b,0xf5,0x32,
|
||||
+ 0x73,0x63
|
||||
};
|
||||
- static unsigned char dh1024_g[] = {
|
||||
+ static unsigned char dh2048_g[] = {
|
||||
0x02,
|
||||
};
|
||||
DH *dh;
|
||||
@@ -938,8 +945,8 @@ int
|
||||
}
|
||||
Error("DH_new() failed");
|
||||
} else {
|
||||
- dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
|
||||
- dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
|
||||
+ dh->p = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);
|
||||
+ dh->g = BN_bin2bn(dh2048_g, sizeof(dh2048_g), NULL);
|
||||
if ((dh->p == NULL) || (dh->g == NULL)) {
|
||||
while (err = ERR_get_error()) {
|
||||
Warn1("BN_bin2bn(): %s",
|
||||
@@ -14,6 +14,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
|
||||
SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
|
||||
file://Makefile.in-fix-for-parallel-build.patch \
|
||||
file://CVE-2016-2217.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "b607edb65bc6c57f4a43f06247504274"
|
||||
|
||||
33
meta/recipes-core/busybox/busybox/0001-randconfig-fix.patch
Normal file
33
meta/recipes-core/busybox/busybox/0001-randconfig-fix.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
If CONFIG_FEATURE_LAST_SMALL is enabled the build fails because of a broken
|
||||
__UT_NAMESIZE test.
|
||||
|
||||
Upstream-Status: Backport
|
||||
Signed-off-by: Ross Burton <ross.burton@intel.com>
|
||||
|
||||
From 932302666b0354ede63504d1bef8393cab28db8b Mon Sep 17 00:00:00 2001
|
||||
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
Date: Sun, 11 Oct 2015 16:58:18 +0200
|
||||
Subject: [PATCH] randconfig fix
|
||||
|
||||
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||
---
|
||||
miscutils/last.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/miscutils/last.c b/miscutils/last.c
|
||||
index 6d8b584..f8f3437 100644
|
||||
--- a/miscutils/last.c
|
||||
+++ b/miscutils/last.c
|
||||
@@ -34,7 +34,8 @@
|
||||
&& ((UT_LINESIZE != 32) || (UT_NAMESIZE != 32) || (UT_HOSTSIZE != 256))
|
||||
#error struct utmpx member char[] size(s) have changed!
|
||||
#elif defined __UT_LINESIZE \
|
||||
- && ((__UT_LINESIZE != 32) || (__UT_NAMESIZE != 64) || (__UT_HOSTSIZE != 256))
|
||||
+ && ((__UT_LINESIZE != 32) || (__UT_NAMESIZE != 32) || (__UT_HOSTSIZE != 256))
|
||||
+/* __UT_NAMESIZE was checked with 64 above, but glibc-2.11 definitely uses 32! */
|
||||
#error struct utmpx member char[] size(s) have changed!
|
||||
#endif
|
||||
|
||||
--
|
||||
2.6.4
|
||||
|
||||
@@ -35,6 +35,7 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
||||
file://0001-chown-fix-help-text.patch \
|
||||
file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
|
||||
file://0002-Passthrough-r-to-linker.patch \
|
||||
file://0001-randconfig-fix.patch \
|
||||
file://mount-via-label.cfg \
|
||||
file://sha1sum.cfg \
|
||||
file://sha256sum.cfg \
|
||||
|
||||
@@ -20,6 +20,7 @@ GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
||||
SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||
git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
|
||||
file://fix_for_centos_5.8.patch \
|
||||
file://strcoll-Remove-incorrect-STRDIFF-based-optimization-.patch \
|
||||
${EGLIBCPATCHES} \
|
||||
"
|
||||
EGLIBCPATCHES = "\
|
||||
|
||||
@@ -87,7 +87,7 @@ do_install () {
|
||||
if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
|
||||
cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
|
||||
fi
|
||||
chown root.root -R ${D}
|
||||
chown root:root -R ${D}
|
||||
cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
From cadaf1336332ca7bcdfe4a400776e5782a20e26d Mon Sep 17 00:00:00 2001
|
||||
From: "H.J. Lu" <hjl.tools@gmail.com>
|
||||
Date: Wed, 28 Oct 2015 07:49:44 -0700
|
||||
Subject: [PATCH] Keep only ELF_RTYPE_CLASS_{PLT|COPY} bits for prelink
|
||||
|
||||
prelink runs ld.so with the environment variable LD_TRACE_PRELINKING
|
||||
set to dump the relocation type class from _dl_debug_bindings. prelink
|
||||
has the following relocation type classes:
|
||||
|
||||
#define RTYPE_CLASS_VALID 8
|
||||
#define RTYPE_CLASS_PLT (8|1)
|
||||
#define RTYPE_CLASS_COPY (8|2)
|
||||
#define RTYPE_CLASS_TLS (8|4)
|
||||
|
||||
where ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA has a conflict with
|
||||
RTYPE_CLASS_TLS.
|
||||
|
||||
Since prelink only uses ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY
|
||||
bits, we should clear the other bits when the DL_DEBUG_PRELINK bit is
|
||||
set.
|
||||
|
||||
[BZ #19178]
|
||||
* elf/dl-lookup.c (RTYPE_CLASS_VALID): New.
|
||||
(RTYPE_CLASS_PLT): Likewise.
|
||||
(RTYPE_CLASS_COPY): Likewise.
|
||||
(RTYPE_CLASS_TLS): Likewise.
|
||||
(_dl_debug_bindings): Use RTYPE_CLASS_TLS and RTYPE_CLASS_VALID
|
||||
to set relocation type class for DL_DEBUG_PRELINK. Keep only
|
||||
ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY bits for
|
||||
DL_DEBUG_PRELINK.
|
||||
|
||||
Upstream-Status: submitted (https://sourceware.org/bugzilla/show_bug.cgi?id=19178)
|
||||
|
||||
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||
---
|
||||
elf/dl-lookup.c | 21 +++++++++++++++++++--
|
||||
1 file changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
|
||||
index 581fb20..6ae6cc3 100644
|
||||
--- a/elf/dl-lookup.c
|
||||
+++ b/elf/dl-lookup.c
|
||||
@@ -1016,6 +1016,18 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
|
||||
#ifdef SHARED
|
||||
if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
|
||||
{
|
||||
+/* ELF_RTYPE_CLASS_XXX must match RTYPE_CLASS_XXX used by prelink with
|
||||
+ LD_TRACE_PRELINKING. */
|
||||
+#define RTYPE_CLASS_VALID 8
|
||||
+#define RTYPE_CLASS_PLT (8|1)
|
||||
+#define RTYPE_CLASS_COPY (8|2)
|
||||
+#define RTYPE_CLASS_TLS (8|4)
|
||||
+#if ELF_RTYPE_CLASS_PLT != 0 && ELF_RTYPE_CLASS_PLT != 1
|
||||
+# error ELF_RTYPE_CLASS_PLT must be 0 or 1!
|
||||
+#endif
|
||||
+#if ELF_RTYPE_CLASS_COPY != 0 && ELF_RTYPE_CLASS_COPY != 2
|
||||
+# error ELF_RTYPE_CLASS_COPY must be 0 or 2!
|
||||
+#endif
|
||||
int conflict = 0;
|
||||
struct sym_val val = { NULL, NULL };
|
||||
|
||||
@@ -1071,12 +1083,17 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
|
||||
|
||||
if (value->s)
|
||||
{
|
||||
+ /* Keep only ELF_RTYPE_CLASS_PLT and ELF_RTYPE_CLASS_COPY
|
||||
+ bits since since prelink only uses them. */
|
||||
+ type_class &= ELF_RTYPE_CLASS_PLT | ELF_RTYPE_CLASS_COPY;
|
||||
if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
|
||||
== STT_TLS))
|
||||
- type_class = 4;
|
||||
+ /* Clear the RTYPE_CLASS_VALID bit in RTYPE_CLASS_TLS. */
|
||||
+ type_class = RTYPE_CLASS_TLS & ~RTYPE_CLASS_VALID;
|
||||
else if (__glibc_unlikely (ELFW(ST_TYPE) (value->s->st_info)
|
||||
== STT_GNU_IFUNC))
|
||||
- type_class |= 8;
|
||||
+ /* Set the RTYPE_CLASS_VALID bit. */
|
||||
+ type_class |= RTYPE_CLASS_VALID;
|
||||
}
|
||||
|
||||
if (conflict
|
||||
--
|
||||
1.9.3
|
||||
|
||||
642
meta/recipes-core/glibc/glibc/CVE-2015-7547.patch
Normal file
642
meta/recipes-core/glibc/glibc/CVE-2015-7547.patch
Normal file
@@ -0,0 +1,642 @@
|
||||
From e9db92d3acfe1822d56d11abcea5bfc4c41cf6ca Mon Sep 17 00:00:00 2001
|
||||
From: Carlos O'Donell <carlos@systemhalted.org>
|
||||
Date: Tue, 16 Feb 2016 21:26:37 -0500
|
||||
Subject: [PATCH] CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug
|
||||
18665).
|
||||
|
||||
* A stack-based buffer overflow was found in libresolv when invoked from
|
||||
libnss_dns, allowing specially crafted DNS responses to seize control
|
||||
of execution flow in the DNS client. The buffer overflow occurs in
|
||||
the functions send_dg (send datagram) and send_vc (send TCP) for the
|
||||
NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC
|
||||
family. The use of AF_UNSPEC triggers the low-level resolver code to
|
||||
send out two parallel queries for A and AAAA. A mismanagement of the
|
||||
buffers used for those queries could result in the response of a query
|
||||
writing beyond the alloca allocated buffer created by
|
||||
_nss_dns_gethostbyname4_r. Buffer management is simplified to remove
|
||||
the overflow. Thanks to the Google Security Team and Red Hat for
|
||||
reporting the security impact of this issue, and Robert Holiday of
|
||||
Ciena for reporting the related bug 18665. (CVE-2015-7547)
|
||||
|
||||
See also:
|
||||
https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html
|
||||
https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-7547
|
||||
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=e9db92d3acfe1822d56d11abcea5bfc4c41cf6ca
|
||||
minor tweeking to apply to Changelog and res_send.c
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
ChangeLog | 17 ++-
|
||||
NEWS | 14 +++
|
||||
resolv/nss_dns/dns-host.c | 111 +++++++++++++++++++-
|
||||
resolv/res_query.c | 3 +
|
||||
resolv/res_send.c | 260 +++++++++++++++++++++++++++++++++++-----------
|
||||
5 files changed, 339 insertions(+), 66 deletions(-)
|
||||
|
||||
Index: git/NEWS
|
||||
===================================================================
|
||||
--- git.orig/NEWS
|
||||
+++ git/NEWS
|
||||
@@ -105,6 +105,20 @@ Security related changes:
|
||||
depending on the length of the string passed as an argument to the
|
||||
functions. Reported by Joseph Myers.
|
||||
|
||||
+* A stack-based buffer overflow was found in libresolv when invoked from
|
||||
+ libnss_dns, allowing specially crafted DNS responses to seize control
|
||||
+ of execution flow in the DNS client. The buffer overflow occurs in
|
||||
+ the functions send_dg (send datagram) and send_vc (send TCP) for the
|
||||
+ NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC
|
||||
+ family. The use of AF_UNSPEC triggers the low-level resolver code to
|
||||
+ send out two parallel queries for A and AAAA. A mismanagement of the
|
||||
+ buffers used for those queries could result in the response of a query
|
||||
+ writing beyond the alloca allocated buffer created by
|
||||
+ _nss_dns_gethostbyname4_r. Buffer management is simplified to remove
|
||||
+ the overflow. Thanks to the Google Security Team and Red Hat for
|
||||
+ reporting the security impact of this issue, and Robert Holiday of
|
||||
+ Ciena for reporting the related bug 18665. (CVE-2015-7547)
|
||||
+
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
6652, 10672, 12674, 12847, 12926, 13862, 14132, 14138, 14171, 14498,
|
||||
Index: git/resolv/nss_dns/dns-host.c
|
||||
===================================================================
|
||||
--- git.orig/resolv/nss_dns/dns-host.c
|
||||
+++ git/resolv/nss_dns/dns-host.c
|
||||
@@ -1031,7 +1031,10 @@ gaih_getanswer_slice (const querybuf *an
|
||||
int h_namelen = 0;
|
||||
|
||||
if (ancount == 0)
|
||||
- return NSS_STATUS_NOTFOUND;
|
||||
+ {
|
||||
+ *h_errnop = HOST_NOT_FOUND;
|
||||
+ return NSS_STATUS_NOTFOUND;
|
||||
+ }
|
||||
|
||||
while (ancount-- > 0 && cp < end_of_message && had_error == 0)
|
||||
{
|
||||
@@ -1208,7 +1211,14 @@ gaih_getanswer_slice (const querybuf *an
|
||||
/* Special case here: if the resolver sent a result but it only
|
||||
contains a CNAME while we are looking for a T_A or T_AAAA record,
|
||||
we fail with NOTFOUND instead of TRYAGAIN. */
|
||||
- return canon == NULL ? NSS_STATUS_TRYAGAIN : NSS_STATUS_NOTFOUND;
|
||||
+ if (canon != NULL)
|
||||
+ {
|
||||
+ *h_errnop = HOST_NOT_FOUND;
|
||||
+ return NSS_STATUS_NOTFOUND;
|
||||
+ }
|
||||
+
|
||||
+ *h_errnop = NETDB_INTERNAL;
|
||||
+ return NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
|
||||
@@ -1222,11 +1232,101 @@ gaih_getanswer (const querybuf *answer1,
|
||||
|
||||
enum nss_status status = NSS_STATUS_NOTFOUND;
|
||||
|
||||
+ /* Combining the NSS status of two distinct queries requires some
|
||||
+ compromise and attention to symmetry (A or AAAA queries can be
|
||||
+ returned in any order). What follows is a breakdown of how this
|
||||
+ code is expected to work and why. We discuss only SUCCESS,
|
||||
+ TRYAGAIN, NOTFOUND and UNAVAIL, since they are the only returns
|
||||
+ that apply (though RETURN and MERGE exist). We make a distinction
|
||||
+ between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable).
|
||||
+ A recoverable TRYAGAIN is almost always due to buffer size issues
|
||||
+ and returns ERANGE in errno and the caller is expected to retry
|
||||
+ with a larger buffer.
|
||||
+
|
||||
+ Lastly, you may be tempted to make significant changes to the
|
||||
+ conditions in this code to bring about symmetry between responses.
|
||||
+ Please don't change anything without due consideration for
|
||||
+ expected application behaviour. Some of the synthesized responses
|
||||
+ aren't very well thought out and sometimes appear to imply that
|
||||
+ IPv4 responses are always answer 1, and IPv6 responses are always
|
||||
+ answer 2, but that's not true (see the implementation of send_dg
|
||||
+ and send_vc to see response can arrive in any order, particularly
|
||||
+ for UDP). However, we expect it holds roughly enough of the time
|
||||
+ that this code works, but certainly needs to be fixed to make this
|
||||
+ a more robust implementation.
|
||||
+
|
||||
+ ----------------------------------------------
|
||||
+ | Answer 1 Status / | Synthesized | Reason |
|
||||
+ | Answer 2 Status | Status | |
|
||||
+ |--------------------------------------------|
|
||||
+ | SUCCESS/SUCCESS | SUCCESS | [1] |
|
||||
+ | SUCCESS/TRYAGAIN | TRYAGAIN | [5] |
|
||||
+ | SUCCESS/TRYAGAIN' | SUCCESS | [1] |
|
||||
+ | SUCCESS/NOTFOUND | SUCCESS | [1] |
|
||||
+ | SUCCESS/UNAVAIL | SUCCESS | [1] |
|
||||
+ | TRYAGAIN/SUCCESS | TRYAGAIN | [2] |
|
||||
+ | TRYAGAIN/TRYAGAIN | TRYAGAIN | [2] |
|
||||
+ | TRYAGAIN/TRYAGAIN' | TRYAGAIN | [2] |
|
||||
+ | TRYAGAIN/NOTFOUND | TRYAGAIN | [2] |
|
||||
+ | TRYAGAIN/UNAVAIL | TRYAGAIN | [2] |
|
||||
+ | TRYAGAIN'/SUCCESS | SUCCESS | [3] |
|
||||
+ | TRYAGAIN'/TRYAGAIN | TRYAGAIN | [3] |
|
||||
+ | TRYAGAIN'/TRYAGAIN' | TRYAGAIN' | [3] |
|
||||
+ | TRYAGAIN'/NOTFOUND | TRYAGAIN' | [3] |
|
||||
+ | TRYAGAIN'/UNAVAIL | UNAVAIL | [3] |
|
||||
+ | NOTFOUND/SUCCESS | SUCCESS | [3] |
|
||||
+ | NOTFOUND/TRYAGAIN | TRYAGAIN | [3] |
|
||||
+ | NOTFOUND/TRYAGAIN' | TRYAGAIN' | [3] |
|
||||
+ | NOTFOUND/NOTFOUND | NOTFOUND | [3] |
|
||||
+ | NOTFOUND/UNAVAIL | UNAVAIL | [3] |
|
||||
+ | UNAVAIL/SUCCESS | UNAVAIL | [4] |
|
||||
+ | UNAVAIL/TRYAGAIN | UNAVAIL | [4] |
|
||||
+ | UNAVAIL/TRYAGAIN' | UNAVAIL | [4] |
|
||||
+ | UNAVAIL/NOTFOUND | UNAVAIL | [4] |
|
||||
+ | UNAVAIL/UNAVAIL | UNAVAIL | [4] |
|
||||
+ ----------------------------------------------
|
||||
+
|
||||
+ [1] If the first response is a success we return success.
|
||||
+ This ignores the state of the second answer and in fact
|
||||
+ incorrectly sets errno and h_errno to that of the second
|
||||
+ answer. However because the response is a success we ignore
|
||||
+ *errnop and *h_errnop (though that means you touched errno on
|
||||
+ success). We are being conservative here and returning the
|
||||
+ likely IPv4 response in the first answer as a success.
|
||||
+
|
||||
+ [2] If the first response is a recoverable TRYAGAIN we return
|
||||
+ that instead of looking at the second response. The
|
||||
+ expectation here is that we have failed to get an IPv4 response
|
||||
+ and should retry both queries.
|
||||
+
|
||||
+ [3] If the first response was not a SUCCESS and the second
|
||||
+ response is not NOTFOUND (had a SUCCESS, need to TRYAGAIN,
|
||||
+ or failed entirely e.g. TRYAGAIN' and UNAVAIL) then use the
|
||||
+ result from the second response, otherwise the first responses
|
||||
+ status is used. Again we have some odd side-effects when the
|
||||
+ second response is NOTFOUND because we overwrite *errnop and
|
||||
+ *h_errnop that means that a first answer of NOTFOUND might see
|
||||
+ its *errnop and *h_errnop values altered. Whether it matters
|
||||
+ in practice that a first response NOTFOUND has the wrong
|
||||
+ *errnop and *h_errnop is undecided.
|
||||
+
|
||||
+ [4] If the first response is UNAVAIL we return that instead of
|
||||
+ looking at the second response. The expectation here is that
|
||||
+ it will have failed similarly e.g. configuration failure.
|
||||
+
|
||||
+ [5] Testing this code is complicated by the fact that truncated
|
||||
+ second response buffers might be returned as SUCCESS if the
|
||||
+ first answer is a SUCCESS. To fix this we add symmetry to
|
||||
+ TRYAGAIN with the second response. If the second response
|
||||
+ is a recoverable error we now return TRYAGIN even if the first
|
||||
+ response was SUCCESS. */
|
||||
+
|
||||
if (anslen1 > 0)
|
||||
status = gaih_getanswer_slice(answer1, anslen1, qname,
|
||||
&pat, &buffer, &buflen,
|
||||
errnop, h_errnop, ttlp,
|
||||
&first);
|
||||
+
|
||||
if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
|
||||
|| (status == NSS_STATUS_TRYAGAIN
|
||||
/* We want to look at the second answer in case of an
|
||||
@@ -1242,8 +1342,15 @@ gaih_getanswer (const querybuf *answer1,
|
||||
&pat, &buffer, &buflen,
|
||||
errnop, h_errnop, ttlp,
|
||||
&first);
|
||||
+ /* Use the second response status in some cases. */
|
||||
if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND)
|
||||
status = status2;
|
||||
+ /* Do not return a truncated second response (unless it was
|
||||
+ unavoidable e.g. unrecoverable TRYAGAIN). */
|
||||
+ if (status == NSS_STATUS_SUCCESS
|
||||
+ && (status2 == NSS_STATUS_TRYAGAIN
|
||||
+ && *errnop == ERANGE && *h_errnop != NO_RECOVERY))
|
||||
+ status = NSS_STATUS_TRYAGAIN;
|
||||
}
|
||||
|
||||
return status;
|
||||
Index: git/resolv/res_query.c
|
||||
===================================================================
|
||||
--- git.orig/resolv/res_query.c
|
||||
+++ git/resolv/res_query.c
|
||||
@@ -396,6 +396,7 @@ __libc_res_nsearch(res_state statp,
|
||||
{
|
||||
free (*answerp2);
|
||||
*answerp2 = NULL;
|
||||
+ *nanswerp2 = 0;
|
||||
*answerp2_malloced = 0;
|
||||
}
|
||||
}
|
||||
@@ -447,6 +448,7 @@ __libc_res_nsearch(res_state statp,
|
||||
{
|
||||
free (*answerp2);
|
||||
*answerp2 = NULL;
|
||||
+ *nanswerp2 = 0;
|
||||
*answerp2_malloced = 0;
|
||||
}
|
||||
|
||||
@@ -521,6 +523,7 @@ __libc_res_nsearch(res_state statp,
|
||||
{
|
||||
free (*answerp2);
|
||||
*answerp2 = NULL;
|
||||
+ *nanswerp2 = 0;
|
||||
*answerp2_malloced = 0;
|
||||
}
|
||||
if (saved_herrno != -1)
|
||||
Index: git/resolv/res_send.c
|
||||
===================================================================
|
||||
--- git.orig/resolv/res_send.c
|
||||
+++ git/resolv/res_send.c
|
||||
@@ -1,3 +1,20 @@
|
||||
+/* Copyright (C) 2016 Free Software Foundation, Inc.
|
||||
+ This file is part of the GNU C Library.
|
||||
+
|
||||
+ The GNU C Library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with the GNU C Library; if not, see
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
/*
|
||||
* Copyright (c) 1985, 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
@@ -363,6 +380,8 @@ __libc_res_nsend(res_state statp, const
|
||||
#ifdef USE_HOOKS
|
||||
if (__glibc_unlikely (statp->qhook || statp->rhook)) {
|
||||
if (anssiz < MAXPACKET && ansp) {
|
||||
+ /* Always allocate MAXPACKET, callers expect
|
||||
+ this specific size. */
|
||||
u_char *buf = malloc (MAXPACKET);
|
||||
if (buf == NULL)
|
||||
return (-1);
|
||||
@@ -638,6 +657,77 @@ get_nsaddr (res_state statp, int n)
|
||||
return (struct sockaddr *) (void *) &statp->nsaddr_list[n];
|
||||
}
|
||||
|
||||
+/* The send_vc function is responsible for sending a DNS query over TCP
|
||||
+ to the nameserver numbered NS from the res_state STATP i.e.
|
||||
+ EXT(statp).nssocks[ns]. The function supports sending both IPv4 and
|
||||
+ IPv6 queries at the same serially on the same socket.
|
||||
+
|
||||
+ Please note that for TCP there is no way to disable sending both
|
||||
+ queries, unlike UDP, which honours RES_SNGLKUP and RES_SNGLKUPREOP
|
||||
+ and sends the queries serially and waits for the result after each
|
||||
+ sent query. This implemetnation should be corrected to honour these
|
||||
+ options.
|
||||
+
|
||||
+ Please also note that for TCP we send both queries over the same
|
||||
+ socket one after another. This technically violates best practice
|
||||
+ since the server is allowed to read the first query, respond, and
|
||||
+ then close the socket (to service another client). If the server
|
||||
+ does this, then the remaining second query in the socket data buffer
|
||||
+ will cause the server to send the client an RST which will arrive
|
||||
+ asynchronously and the client's OS will likely tear down the socket
|
||||
+ receive buffer resulting in a potentially short read and lost
|
||||
+ response data. This will force the client to retry the query again,
|
||||
+ and this process may repeat until all servers and connection resets
|
||||
+ are exhausted and then the query will fail. It's not known if this
|
||||
+ happens with any frequency in real DNS server implementations. This
|
||||
+ implementation should be corrected to use two sockets by default for
|
||||
+ parallel queries.
|
||||
+
|
||||
+ The query stored in BUF of BUFLEN length is sent first followed by
|
||||
+ the query stored in BUF2 of BUFLEN2 length. Queries are sent
|
||||
+ serially on the same socket.
|
||||
+
|
||||
+ Answers to the query are stored firstly in *ANSP up to a max of
|
||||
+ *ANSSIZP bytes. If more than *ANSSIZP bytes are needed and ANSCP
|
||||
+ is non-NULL (to indicate that modifying the answer buffer is allowed)
|
||||
+ then malloc is used to allocate a new response buffer and ANSCP and
|
||||
+ ANSP will both point to the new buffer. If more than *ANSSIZP bytes
|
||||
+ are needed but ANSCP is NULL, then as much of the response as
|
||||
+ possible is read into the buffer, but the results will be truncated.
|
||||
+ When truncation happens because of a small answer buffer the DNS
|
||||
+ packets header field TC will bet set to 1, indicating a truncated
|
||||
+ message and the rest of the socket data will be read and discarded.
|
||||
+
|
||||
+ Answers to the query are stored secondly in *ANSP2 up to a max of
|
||||
+ *ANSSIZP2 bytes, with the actual response length stored in
|
||||
+ *RESPLEN2. If more than *ANSSIZP bytes are needed and ANSP2
|
||||
+ is non-NULL (required for a second query) then malloc is used to
|
||||
+ allocate a new response buffer, *ANSSIZP2 is set to the new buffer
|
||||
+ size and *ANSP2_MALLOCED is set to 1.
|
||||
+
|
||||
+ The ANSP2_MALLOCED argument will eventually be removed as the
|
||||
+ change in buffer pointer can be used to detect the buffer has
|
||||
+ changed and that the caller should use free on the new buffer.
|
||||
+
|
||||
+ Note that the answers may arrive in any order from the server and
|
||||
+ therefore the first and second answer buffers may not correspond to
|
||||
+ the first and second queries.
|
||||
+
|
||||
+ It is not supported to call this function with a non-NULL ANSP2
|
||||
+ but a NULL ANSCP. Put another way, you can call send_vc with a
|
||||
+ single unmodifiable buffer or two modifiable buffers, but no other
|
||||
+ combination is supported.
|
||||
+
|
||||
+ It is the caller's responsibility to free the malloc allocated
|
||||
+ buffers by detecting that the pointers have changed from their
|
||||
+ original values i.e. *ANSCP or *ANSP2 has changed.
|
||||
+
|
||||
+ If errors are encountered then *TERRNO is set to an appropriate
|
||||
+ errno value and a zero result is returned for a recoverable error,
|
||||
+ and a less-than zero result is returned for a non-recoverable error.
|
||||
+
|
||||
+ If no errors are encountered then *TERRNO is left unmodified and
|
||||
+ a the length of the first response in bytes is returned. */
|
||||
static int
|
||||
send_vc(res_state statp,
|
||||
const u_char *buf, int buflen, const u_char *buf2, int buflen2,
|
||||
@@ -647,11 +737,7 @@ send_vc(res_state statp,
|
||||
{
|
||||
const HEADER *hp = (HEADER *) buf;
|
||||
const HEADER *hp2 = (HEADER *) buf2;
|
||||
- u_char *ans = *ansp;
|
||||
- int orig_anssizp = *anssizp;
|
||||
- // XXX REMOVE
|
||||
- // int anssiz = *anssizp;
|
||||
- HEADER *anhp = (HEADER *) ans;
|
||||
+ HEADER *anhp = (HEADER *) *ansp;
|
||||
struct sockaddr *nsap = get_nsaddr (statp, ns);
|
||||
int truncating, connreset, n;
|
||||
/* On some architectures compiler might emit a warning indicating
|
||||
@@ -743,6 +829,8 @@ send_vc(res_state statp,
|
||||
* Receive length & response
|
||||
*/
|
||||
int recvresp1 = 0;
|
||||
+ /* Skip the second response if there is no second query.
|
||||
+ To do that we mark the second response as received. */
|
||||
int recvresp2 = buf2 == NULL;
|
||||
uint16_t rlen16;
|
||||
read_len:
|
||||
@@ -779,40 +867,14 @@ send_vc(res_state statp,
|
||||
u_char **thisansp;
|
||||
int *thisresplenp;
|
||||
if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) {
|
||||
+ /* We have not received any responses
|
||||
+ yet or we only have one response to
|
||||
+ receive. */
|
||||
thisanssizp = anssizp;
|
||||
thisansp = anscp ?: ansp;
|
||||
assert (anscp != NULL || ansp2 == NULL);
|
||||
thisresplenp = &resplen;
|
||||
} else {
|
||||
- if (*anssizp != MAXPACKET) {
|
||||
- /* No buffer allocated for the first
|
||||
- reply. We can try to use the rest
|
||||
- of the user-provided buffer. */
|
||||
-#if __GNUC_PREREQ (4, 7)
|
||||
- DIAG_PUSH_NEEDS_COMMENT;
|
||||
- DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized");
|
||||
-#endif
|
||||
-#if _STRING_ARCH_unaligned
|
||||
- *anssizp2 = orig_anssizp - resplen;
|
||||
- *ansp2 = *ansp + resplen;
|
||||
-#else
|
||||
- int aligned_resplen
|
||||
- = ((resplen + __alignof__ (HEADER) - 1)
|
||||
- & ~(__alignof__ (HEADER) - 1));
|
||||
- *anssizp2 = orig_anssizp - aligned_resplen;
|
||||
- *ansp2 = *ansp + aligned_resplen;
|
||||
-#endif
|
||||
-#if __GNUC_PREREQ (4, 7)
|
||||
- DIAG_POP_NEEDS_COMMENT;
|
||||
-#endif
|
||||
- } else {
|
||||
- /* The first reply did not fit into the
|
||||
- user-provided buffer. Maybe the second
|
||||
- answer will. */
|
||||
- *anssizp2 = orig_anssizp;
|
||||
- *ansp2 = *ansp;
|
||||
- }
|
||||
-
|
||||
thisanssizp = anssizp2;
|
||||
thisansp = ansp2;
|
||||
thisresplenp = resplen2;
|
||||
@@ -820,10 +882,14 @@ send_vc(res_state statp,
|
||||
anhp = (HEADER *) *thisansp;
|
||||
|
||||
*thisresplenp = rlen;
|
||||
- if (rlen > *thisanssizp) {
|
||||
- /* Yes, we test ANSCP here. If we have two buffers
|
||||
- both will be allocatable. */
|
||||
- if (__glibc_likely (anscp != NULL)) {
|
||||
+ /* Is the answer buffer too small? */
|
||||
+ if (*thisanssizp < rlen) {
|
||||
+ /* If the current buffer is not the the static
|
||||
+ user-supplied buffer then we can reallocate
|
||||
+ it. */
|
||||
+ if (thisansp != NULL && thisansp != ansp) {
|
||||
+ /* Always allocate MAXPACKET, callers expect
|
||||
+ this specific size. */
|
||||
u_char *newp = malloc (MAXPACKET);
|
||||
if (newp == NULL) {
|
||||
*terrno = ENOMEM;
|
||||
@@ -835,6 +901,9 @@ send_vc(res_state statp,
|
||||
if (thisansp == ansp2)
|
||||
*ansp2_malloced = 1;
|
||||
anhp = (HEADER *) newp;
|
||||
+ /* A uint16_t can't be larger than MAXPACKET
|
||||
+ thus it's safe to allocate MAXPACKET but
|
||||
+ read RLEN bytes instead. */
|
||||
len = rlen;
|
||||
} else {
|
||||
Dprint(statp->options & RES_DEBUG,
|
||||
@@ -997,6 +1066,66 @@ reopen (res_state statp, int *terrno, in
|
||||
return 1;
|
||||
}
|
||||
|
||||
+/* The send_dg function is responsible for sending a DNS query over UDP
|
||||
+ to the nameserver numbered NS from the res_state STATP i.e.
|
||||
+ EXT(statp).nssocks[ns]. The function supports IPv4 and IPv6 queries
|
||||
+ along with the ability to send the query in parallel for both stacks
|
||||
+ (default) or serially (RES_SINGLKUP). It also supports serial lookup
|
||||
+ with a close and reopen of the socket used to talk to the server
|
||||
+ (RES_SNGLKUPREOP) to work around broken name servers.
|
||||
+
|
||||
+ The query stored in BUF of BUFLEN length is sent first followed by
|
||||
+ the query stored in BUF2 of BUFLEN2 length. Queries are sent
|
||||
+ in parallel (default) or serially (RES_SINGLKUP or RES_SNGLKUPREOP).
|
||||
+
|
||||
+ Answers to the query are stored firstly in *ANSP up to a max of
|
||||
+ *ANSSIZP bytes. If more than *ANSSIZP bytes are needed and ANSCP
|
||||
+ is non-NULL (to indicate that modifying the answer buffer is allowed)
|
||||
+ then malloc is used to allocate a new response buffer and ANSCP and
|
||||
+ ANSP will both point to the new buffer. If more than *ANSSIZP bytes
|
||||
+ are needed but ANSCP is NULL, then as much of the response as
|
||||
+ possible is read into the buffer, but the results will be truncated.
|
||||
+ When truncation happens because of a small answer buffer the DNS
|
||||
+ packets header field TC will bet set to 1, indicating a truncated
|
||||
+ message, while the rest of the UDP packet is discarded.
|
||||
+
|
||||
+ Answers to the query are stored secondly in *ANSP2 up to a max of
|
||||
+ *ANSSIZP2 bytes, with the actual response length stored in
|
||||
+ *RESPLEN2. If more than *ANSSIZP bytes are needed and ANSP2
|
||||
+ is non-NULL (required for a second query) then malloc is used to
|
||||
+ allocate a new response buffer, *ANSSIZP2 is set to the new buffer
|
||||
+ size and *ANSP2_MALLOCED is set to 1.
|
||||
+
|
||||
+ The ANSP2_MALLOCED argument will eventually be removed as the
|
||||
+ change in buffer pointer can be used to detect the buffer has
|
||||
+ changed and that the caller should use free on the new buffer.
|
||||
+
|
||||
+ Note that the answers may arrive in any order from the server and
|
||||
+ therefore the first and second answer buffers may not correspond to
|
||||
+ the first and second queries.
|
||||
+
|
||||
+ It is not supported to call this function with a non-NULL ANSP2
|
||||
+ but a NULL ANSCP. Put another way, you can call send_vc with a
|
||||
+ single unmodifiable buffer or two modifiable buffers, but no other
|
||||
+ combination is supported.
|
||||
+
|
||||
+ It is the caller's responsibility to free the malloc allocated
|
||||
+ buffers by detecting that the pointers have changed from their
|
||||
+ original values i.e. *ANSCP or *ANSP2 has changed.
|
||||
+
|
||||
+ If an answer is truncated because of UDP datagram DNS limits then
|
||||
+ *V_CIRCUIT is set to 1 and the return value non-zero to indicate to
|
||||
+ the caller to retry with TCP. The value *GOTSOMEWHERE is set to 1
|
||||
+ if any progress was made reading a response from the nameserver and
|
||||
+ is used by the caller to distinguish between ECONNREFUSED and
|
||||
+ ETIMEDOUT (the latter if *GOTSOMEWHERE is 1).
|
||||
+
|
||||
+ If errors are encountered then *TERRNO is set to an appropriate
|
||||
+ errno value and a zero result is returned for a recoverable error,
|
||||
+ and a less-than zero result is returned for a non-recoverable error.
|
||||
+
|
||||
+ If no errors are encountered then *TERRNO is left unmodified and
|
||||
+ a the length of the first response in bytes is returned. */
|
||||
static int
|
||||
send_dg(res_state statp,
|
||||
const u_char *buf, int buflen, const u_char *buf2, int buflen2,
|
||||
@@ -1006,8 +1135,6 @@ send_dg(res_state statp,
|
||||
{
|
||||
const HEADER *hp = (HEADER *) buf;
|
||||
const HEADER *hp2 = (HEADER *) buf2;
|
||||
- u_char *ans = *ansp;
|
||||
- int orig_anssizp = *anssizp;
|
||||
struct timespec now, timeout, finish;
|
||||
struct pollfd pfd[1];
|
||||
int ptimeout;
|
||||
@@ -1040,6 +1167,8 @@ send_dg(res_state statp,
|
||||
int need_recompute = 0;
|
||||
int nwritten = 0;
|
||||
int recvresp1 = 0;
|
||||
+ /* Skip the second response if there is no second query.
|
||||
+ To do that we mark the second response as received. */
|
||||
int recvresp2 = buf2 == NULL;
|
||||
pfd[0].fd = EXT(statp).nssocks[ns];
|
||||
pfd[0].events = POLLOUT;
|
||||
@@ -1203,55 +1332,56 @@ send_dg(res_state statp,
|
||||
int *thisresplenp;
|
||||
|
||||
if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) {
|
||||
+ /* We have not received any responses
|
||||
+ yet or we only have one response to
|
||||
+ receive. */
|
||||
thisanssizp = anssizp;
|
||||
thisansp = anscp ?: ansp;
|
||||
assert (anscp != NULL || ansp2 == NULL);
|
||||
thisresplenp = &resplen;
|
||||
} else {
|
||||
- if (*anssizp != MAXPACKET) {
|
||||
- /* No buffer allocated for the first
|
||||
- reply. We can try to use the rest
|
||||
- of the user-provided buffer. */
|
||||
-#if _STRING_ARCH_unaligned
|
||||
- *anssizp2 = orig_anssizp - resplen;
|
||||
- *ansp2 = *ansp + resplen;
|
||||
-#else
|
||||
- int aligned_resplen
|
||||
- = ((resplen + __alignof__ (HEADER) - 1)
|
||||
- & ~(__alignof__ (HEADER) - 1));
|
||||
- *anssizp2 = orig_anssizp - aligned_resplen;
|
||||
- *ansp2 = *ansp + aligned_resplen;
|
||||
-#endif
|
||||
- } else {
|
||||
- /* The first reply did not fit into the
|
||||
- user-provided buffer. Maybe the second
|
||||
- answer will. */
|
||||
- *anssizp2 = orig_anssizp;
|
||||
- *ansp2 = *ansp;
|
||||
- }
|
||||
-
|
||||
thisanssizp = anssizp2;
|
||||
thisansp = ansp2;
|
||||
thisresplenp = resplen2;
|
||||
}
|
||||
|
||||
if (*thisanssizp < MAXPACKET
|
||||
- /* Yes, we test ANSCP here. If we have two buffers
|
||||
- both will be allocatable. */
|
||||
- && anscp
|
||||
+ /* If the current buffer is not the the static
|
||||
+ user-supplied buffer then we can reallocate
|
||||
+ it. */
|
||||
+ && (thisansp != NULL && thisansp != ansp)
|
||||
#ifdef FIONREAD
|
||||
+ /* Is the size too small? */
|
||||
&& (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0
|
||||
|| *thisanssizp < *thisresplenp)
|
||||
#endif
|
||||
) {
|
||||
+ /* Always allocate MAXPACKET, callers expect
|
||||
+ this specific size. */
|
||||
u_char *newp = malloc (MAXPACKET);
|
||||
if (newp != NULL) {
|
||||
- *anssizp = MAXPACKET;
|
||||
- *thisansp = ans = newp;
|
||||
+ *thisanssizp = MAXPACKET;
|
||||
+ *thisansp = newp;
|
||||
if (thisansp == ansp2)
|
||||
*ansp2_malloced = 1;
|
||||
}
|
||||
}
|
||||
+ /* We could end up with truncation if anscp was NULL
|
||||
+ (not allowed to change caller's buffer) and the
|
||||
+ response buffer size is too small. This isn't a
|
||||
+ reliable way to detect truncation because the ioctl
|
||||
+ may be an inaccurate report of the UDP message size.
|
||||
+ Therefore we use this only to issue debug output.
|
||||
+ To do truncation accurately with UDP we need
|
||||
+ MSG_TRUNC which is only available on Linux. We
|
||||
+ can abstract out the Linux-specific feature in the
|
||||
+ future to detect truncation. */
|
||||
+ if (__glibc_unlikely (*thisanssizp < *thisresplenp)) {
|
||||
+ Dprint(statp->options & RES_DEBUG,
|
||||
+ (stdout, ";; response may be truncated (UDP)\n")
|
||||
+ );
|
||||
+ }
|
||||
+
|
||||
HEADER *anhp = (HEADER *) *thisansp;
|
||||
socklen_t fromlen = sizeof(struct sockaddr_in6);
|
||||
assert (sizeof(from) <= fromlen);
|
||||
Index: git/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/ChangeLog
|
||||
+++ git/ChangeLog
|
||||
@@ -1,3 +1,18 @@
|
||||
+2016-02-15 Carlos O'Donell <carlos@redhat.com>
|
||||
+
|
||||
+ [BZ #18665]
|
||||
+ * resolv/nss_dns/dns-host.c (gaih_getanswer_slice): Always set
|
||||
+ *herrno_p.
|
||||
+ (gaih_getanswer): Document functional behviour. Return tryagain
|
||||
+ if any result is tryagain.
|
||||
+ * resolv/res_query.c (__libc_res_nsearch): Set buffer size to zero
|
||||
+ when freed.
|
||||
+ * resolv/res_send.c: Add copyright text.
|
||||
+ (__libc_res_nsend): Document that MAXPACKET is expected.
|
||||
+ (send_vc): Document. Remove buffer reuse.
|
||||
+ (send_dg): Document. Remove buffer reuse. Set *thisanssizp to set the
|
||||
+ size of the buffer. Add Dprint for truncated UDP buffer.
|
||||
+
|
||||
2015-09-26 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
|
||||
[BZ #18985]
|
||||
155
meta/recipes-core/glibc/glibc/CVE-2015-8776.patch
Normal file
155
meta/recipes-core/glibc/glibc/CVE-2015-8776.patch
Normal file
@@ -0,0 +1,155 @@
|
||||
From d36c75fc0d44deec29635dd239b0fbd206ca49b7 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
Date: Sat, 26 Sep 2015 13:27:48 -0700
|
||||
Subject: [PATCH] Fix BZ #18985 -- out of range data to strftime() causes a
|
||||
segfault
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-8776
|
||||
[Yocto # 8980]
|
||||
|
||||
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d36c75fc0d44deec29635dd239b0fbd206ca49b7
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
ChangeLog | 8 ++++++++
|
||||
NEWS | 2 +-
|
||||
time/strftime_l.c | 20 +++++++++++++-------
|
||||
time/tst-strftime.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
4 files changed, 73 insertions(+), 9 deletions(-)
|
||||
|
||||
Index: git/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/ChangeLog
|
||||
+++ git/ChangeLog
|
||||
@@ -1,3 +1,11 @@
|
||||
+2015-09-26 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
+
|
||||
+ [BZ #18985]
|
||||
+ * time/strftime_l.c (a_wkday, f_wkday, a_month, f_month): Range check.
|
||||
+ (__strftime_internal): Likewise.
|
||||
+ * time/tst-strftime.c (do_bz18985): New test.
|
||||
+ (do_test): Call it.
|
||||
+
|
||||
2015-12-04 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
[BZ #16961]
|
||||
Index: git/time/strftime_l.c
|
||||
===================================================================
|
||||
--- git.orig/time/strftime_l.c
|
||||
+++ git/time/strftime_l.c
|
||||
@@ -514,13 +514,17 @@ __strftime_internal (s, maxsize, format,
|
||||
only a few elements. Dereference the pointers only if the format
|
||||
requires this. Then it is ok to fail if the pointers are invalid. */
|
||||
# define a_wkday \
|
||||
- ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday))
|
||||
+ ((const CHAR_T *) (tp->tm_wday < 0 || tp->tm_wday > 6 \
|
||||
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(ABDAY_1) + tp->tm_wday)))
|
||||
# define f_wkday \
|
||||
- ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday))
|
||||
+ ((const CHAR_T *) (tp->tm_wday < 0 || tp->tm_wday > 6 \
|
||||
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(DAY_1) + tp->tm_wday)))
|
||||
# define a_month \
|
||||
- ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon))
|
||||
+ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
|
||||
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(ABMON_1) + tp->tm_mon)))
|
||||
# define f_month \
|
||||
- ((const CHAR_T *) _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon))
|
||||
+ ((const CHAR_T *) (tp->tm_mon < 0 || tp->tm_mon > 11 \
|
||||
+ ? "?" : _NL_CURRENT (LC_TIME, NLW(MON_1) + tp->tm_mon)))
|
||||
# define ampm \
|
||||
((const CHAR_T *) _NL_CURRENT (LC_TIME, tp->tm_hour > 11 \
|
||||
? NLW(PM_STR) : NLW(AM_STR)))
|
||||
@@ -530,8 +534,10 @@ __strftime_internal (s, maxsize, format,
|
||||
# define ap_len STRLEN (ampm)
|
||||
#else
|
||||
# if !HAVE_STRFTIME
|
||||
-# define f_wkday (weekday_name[tp->tm_wday])
|
||||
-# define f_month (month_name[tp->tm_mon])
|
||||
+# define f_wkday (tp->tm_wday < 0 || tp->tm_wday > 6 \
|
||||
+ ? "?" : weekday_name[tp->tm_wday])
|
||||
+# define f_month (tp->tm_mon < 0 || tp->tm_mon > 11 \
|
||||
+ ? "?" : month_name[tp->tm_mon])
|
||||
# define a_wkday f_wkday
|
||||
# define a_month f_month
|
||||
# define ampm (L_("AMPM") + 2 * (tp->tm_hour > 11))
|
||||
@@ -1325,7 +1331,7 @@ __strftime_internal (s, maxsize, format,
|
||||
*tzset_called = true;
|
||||
}
|
||||
# endif
|
||||
- zone = tzname[tp->tm_isdst];
|
||||
+ zone = tp->tm_isdst <= 1 ? tzname[tp->tm_isdst] : "?";
|
||||
}
|
||||
#endif
|
||||
if (! zone)
|
||||
Index: git/time/tst-strftime.c
|
||||
===================================================================
|
||||
--- git.orig/time/tst-strftime.c
|
||||
+++ git/time/tst-strftime.c
|
||||
@@ -4,6 +4,56 @@
|
||||
#include <time.h>
|
||||
|
||||
|
||||
+static int
|
||||
+do_bz18985 (void)
|
||||
+{
|
||||
+ char buf[1000];
|
||||
+ struct tm ttm;
|
||||
+ int rc, ret = 0;
|
||||
+
|
||||
+ memset (&ttm, 1, sizeof (ttm));
|
||||
+ ttm.tm_zone = NULL; /* Dereferenced directly if non-NULL. */
|
||||
+ rc = strftime (buf, sizeof (buf), "%a %A %b %B %c %z %Z", &ttm);
|
||||
+
|
||||
+ if (rc == 66)
|
||||
+ {
|
||||
+ const char expected[]
|
||||
+ = "? ? ? ? ? ? 16843009 16843009:16843009:16843009 16844909 +467836 ?";
|
||||
+ if (0 != strcmp (buf, expected))
|
||||
+ {
|
||||
+ printf ("expected:\n %s\ngot:\n %s\n", expected, buf);
|
||||
+ ret += 1;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf ("expected 66, got %d\n", rc);
|
||||
+ ret += 1;
|
||||
+ }
|
||||
+
|
||||
+ /* Check negative values as well. */
|
||||
+ memset (&ttm, 0xFF, sizeof (ttm));
|
||||
+ ttm.tm_zone = NULL; /* Dereferenced directly if non-NULL. */
|
||||
+ rc = strftime (buf, sizeof (buf), "%a %A %b %B %c %z %Z", &ttm);
|
||||
+
|
||||
+ if (rc == 30)
|
||||
+ {
|
||||
+ const char expected[] = "? ? ? ? ? ? -1 -1:-1:-1 1899 ";
|
||||
+ if (0 != strcmp (buf, expected))
|
||||
+ {
|
||||
+ printf ("expected:\n %s\ngot:\n %s\n", expected, buf);
|
||||
+ ret += 1;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ printf ("expected 30, got %d\n", rc);
|
||||
+ ret += 1;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static struct
|
||||
{
|
||||
const char *fmt;
|
||||
@@ -104,7 +154,7 @@ do_test (void)
|
||||
}
|
||||
}
|
||||
|
||||
- return result;
|
||||
+ return result + do_bz18985 ();
|
||||
}
|
||||
|
||||
#define TEST_FUNCTION do_test ()
|
||||
123
meta/recipes-core/glibc/glibc/CVE-2015-8777.patch
Normal file
123
meta/recipes-core/glibc/glibc/CVE-2015-8777.patch
Normal file
@@ -0,0 +1,123 @@
|
||||
From a014cecd82b71b70a6a843e250e06b541ad524f7 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Thu, 15 Oct 2015 09:23:07 +0200
|
||||
Subject: [PATCH] Always enable pointer guard [BZ #18928]
|
||||
|
||||
Honoring the LD_POINTER_GUARD environment variable in AT_SECURE mode
|
||||
has security implications. This commit enables pointer guard
|
||||
unconditionally, and the environment variable is now ignored.
|
||||
|
||||
[BZ #18928]
|
||||
* sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
|
||||
_dl_pointer_guard member.
|
||||
* elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
|
||||
initializer.
|
||||
(security_init): Always set up pointer guard.
|
||||
(process_envvars): Do not process LD_POINTER_GUARD.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-8777
|
||||
[Yocto # 8980]
|
||||
|
||||
https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=a014cecd82b71b70a6a843e250e06b541ad524f7
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
ChangeLog | 10 ++++++++++
|
||||
NEWS | 13 ++++++++-----
|
||||
elf/rtld.c | 15 ++++-----------
|
||||
sysdeps/generic/ldsodefs.h | 3 ---
|
||||
4 files changed, 22 insertions(+), 19 deletions(-)
|
||||
|
||||
Index: git/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/ChangeLog
|
||||
+++ git/ChangeLog
|
||||
@@ -1,3 +1,14 @@
|
||||
+2015-10-15 Florian Weimer <fweimer@redhat.com>
|
||||
+
|
||||
+ [BZ #18928]
|
||||
+ * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): Remove
|
||||
+ _dl_pointer_guard member.
|
||||
+ * elf/rtld.c (_rtld_global_ro): Remove _dl_pointer_guard
|
||||
+ initializer.
|
||||
+ (security_init): Always set up pointer guard.
|
||||
+ (process_envvars): Do not process LD_POINTER_GUARD.
|
||||
+
|
||||
+
|
||||
2015-08-10 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
|
||||
|
||||
[BZ #18778]
|
||||
Index: git/NEWS
|
||||
===================================================================
|
||||
--- git.orig/NEWS
|
||||
+++ git/NEWS
|
||||
@@ -34,7 +34,10 @@ Version 2.22
|
||||
18533, 18534, 18536, 18539, 18540, 18542, 18544, 18545, 18546, 18547,
|
||||
18549, 18553, 18557, 18558, 18569, 18583, 18585, 18586, 18592, 18593,
|
||||
18594, 18602, 18612, 18613, 18619, 18633, 18635, 18641, 18643, 18648,
|
||||
- 18657, 18676, 18694, 18696.
|
||||
+ 18657, 18676, 18694, 18696, 18928.
|
||||
+
|
||||
+* The LD_POINTER_GUARD environment variable can no longer be used to
|
||||
+ disable the pointer guard feature. It is always enabled.
|
||||
|
||||
* Cache information can be queried via sysconf() function on s390 e.g. with
|
||||
_SC_LEVEL1_ICACHE_SIZE as argument.
|
||||
Index: git/elf/rtld.c
|
||||
===================================================================
|
||||
--- git.orig/elf/rtld.c
|
||||
+++ git/elf/rtld.c
|
||||
@@ -163,7 +163,6 @@ struct rtld_global_ro _rtld_global_ro at
|
||||
._dl_hwcap_mask = HWCAP_IMPORTANT,
|
||||
._dl_lazy = 1,
|
||||
._dl_fpu_control = _FPU_DEFAULT,
|
||||
- ._dl_pointer_guard = 1,
|
||||
._dl_pagesize = EXEC_PAGESIZE,
|
||||
._dl_inhibit_cache = 0,
|
||||
|
||||
@@ -710,15 +709,12 @@ security_init (void)
|
||||
#endif
|
||||
|
||||
/* Set up the pointer guard as well, if necessary. */
|
||||
- if (GLRO(dl_pointer_guard))
|
||||
- {
|
||||
- uintptr_t pointer_chk_guard = _dl_setup_pointer_guard (_dl_random,
|
||||
- stack_chk_guard);
|
||||
+ uintptr_t pointer_chk_guard
|
||||
+ = _dl_setup_pointer_guard (_dl_random, stack_chk_guard);
|
||||
#ifdef THREAD_SET_POINTER_GUARD
|
||||
- THREAD_SET_POINTER_GUARD (pointer_chk_guard);
|
||||
+ THREAD_SET_POINTER_GUARD (pointer_chk_guard);
|
||||
#endif
|
||||
- __pointer_chk_guard_local = pointer_chk_guard;
|
||||
- }
|
||||
+ __pointer_chk_guard_local = pointer_chk_guard;
|
||||
|
||||
/* We do not need the _dl_random value anymore. The less
|
||||
information we leave behind, the better, so clear the
|
||||
@@ -2478,9 +2474,6 @@ process_envvars (enum mode *modep)
|
||||
GLRO(dl_use_load_bias) = envline[14] == '1' ? -1 : 0;
|
||||
break;
|
||||
}
|
||||
-
|
||||
- if (memcmp (envline, "POINTER_GUARD", 13) == 0)
|
||||
- GLRO(dl_pointer_guard) = envline[14] != '0';
|
||||
break;
|
||||
|
||||
case 14:
|
||||
Index: git/sysdeps/generic/ldsodefs.h
|
||||
===================================================================
|
||||
--- git.orig/sysdeps/generic/ldsodefs.h
|
||||
+++ git/sysdeps/generic/ldsodefs.h
|
||||
@@ -600,9 +600,6 @@ struct rtld_global_ro
|
||||
/* List of auditing interfaces. */
|
||||
struct audit_ifaces *_dl_audit;
|
||||
unsigned int _dl_naudit;
|
||||
-
|
||||
- /* 0 if internal pointer values should not be guarded, 1 if they should. */
|
||||
- EXTERN int _dl_pointer_guard;
|
||||
};
|
||||
# define __rtld_global_attribute__
|
||||
# if IS_IN (rtld)
|
||||
262
meta/recipes-core/glibc/glibc/CVE-2015-8779.patch
Normal file
262
meta/recipes-core/glibc/glibc/CVE-2015-8779.patch
Normal file
@@ -0,0 +1,262 @@
|
||||
From 0f58539030e436449f79189b6edab17d7479796e Mon Sep 17 00:00:00 2001
|
||||
From: Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
Date: Sat, 8 Aug 2015 15:53:03 -0700
|
||||
Subject: [PATCH] Fix BZ #17905
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-8779
|
||||
[Yocto # 8980]
|
||||
|
||||
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0f58539030e436449f79189b6edab17d7479796e
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
ChangeLog | 8 ++++++++
|
||||
NEWS | 2 +-
|
||||
catgets/Makefile | 9 ++++++++-
|
||||
catgets/catgets.c | 19 ++++++++++++-------
|
||||
catgets/open_catalog.c | 23 ++++++++++++++---------
|
||||
catgets/tst-catgets.c | 31 +++++++++++++++++++++++++++++++
|
||||
6 files changed, 74 insertions(+), 18 deletions(-)
|
||||
|
||||
Index: git/catgets/Makefile
|
||||
===================================================================
|
||||
--- git.orig/catgets/Makefile
|
||||
+++ git/catgets/Makefile
|
||||
@@ -37,6 +37,7 @@ ifeq (y,$(OPTION_EGLIBC_CATGETS))
|
||||
ifeq ($(run-built-tests),yes)
|
||||
tests-special += $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
|
||||
$(objpfx)sample.SJIS.cat $(objpfx)test-gencat.out
|
||||
+tests-special += $(objpfx)tst-catgets-mem.out
|
||||
endif
|
||||
endif
|
||||
gencat-modules = xmalloc
|
||||
@@ -53,9 +54,11 @@ catgets-CPPFLAGS := -DNLSPATH='"$(msgcat
|
||||
|
||||
generated += de.msg test1.cat test1.h test2.cat test2.h sample.SJIS.cat \
|
||||
test-gencat.h
|
||||
+generated += tst-catgets.mtrace tst-catgets-mem.out
|
||||
+
|
||||
generated-dirs += de
|
||||
|
||||
-tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de
|
||||
+tst-catgets-ENV = NLSPATH="$(objpfx)%l/%N.cat" LANG=de MALLOC_TRACE=$(objpfx)tst-catgets.mtrace
|
||||
|
||||
ifeq ($(run-built-tests),yes)
|
||||
# This test just checks whether the program produces any error or not.
|
||||
@@ -89,4 +92,8 @@ $(objpfx)test-gencat.out: test-gencat.sh
|
||||
$(objpfx)sample.SJIS.cat: sample.SJIS $(objpfx)gencat
|
||||
$(built-program-cmd) -H $(objpfx)test-gencat.h < $(word 1,$^) > $@; \
|
||||
$(evaluate-test)
|
||||
+
|
||||
+$(objpfx)tst-catgets-mem.out: $(objpfx)tst-catgets.out
|
||||
+ $(common-objpfx)malloc/mtrace $(objpfx)tst-catgets.mtrace > $@; \
|
||||
+ $(evaluate-test)
|
||||
endif
|
||||
Index: git/catgets/catgets.c
|
||||
===================================================================
|
||||
--- git.orig/catgets/catgets.c
|
||||
+++ git/catgets/catgets.c
|
||||
@@ -16,7 +16,6 @@
|
||||
License along with the GNU C Library; if not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
-#include <alloca.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include <nl_types.h>
|
||||
@@ -35,6 +34,7 @@ catopen (const char *cat_name, int flag)
|
||||
__nl_catd result;
|
||||
const char *env_var = NULL;
|
||||
const char *nlspath = NULL;
|
||||
+ char *tmp = NULL;
|
||||
|
||||
if (strchr (cat_name, '/') == NULL)
|
||||
{
|
||||
@@ -54,7 +54,10 @@ catopen (const char *cat_name, int flag)
|
||||
{
|
||||
/* Append the system dependent directory. */
|
||||
size_t len = strlen (nlspath) + 1 + sizeof NLSPATH;
|
||||
- char *tmp = alloca (len);
|
||||
+ tmp = malloc (len);
|
||||
+
|
||||
+ if (__glibc_unlikely (tmp == NULL))
|
||||
+ return (nl_catd) -1;
|
||||
|
||||
__stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH);
|
||||
nlspath = tmp;
|
||||
@@ -65,16 +68,18 @@ catopen (const char *cat_name, int flag)
|
||||
|
||||
result = (__nl_catd) malloc (sizeof (*result));
|
||||
if (result == NULL)
|
||||
- /* We cannot get enough memory. */
|
||||
- return (nl_catd) -1;
|
||||
-
|
||||
- if (__open_catalog (cat_name, nlspath, env_var, result) != 0)
|
||||
+ {
|
||||
+ /* We cannot get enough memory. */
|
||||
+ result = (nl_catd) -1;
|
||||
+ }
|
||||
+ else if (__open_catalog (cat_name, nlspath, env_var, result) != 0)
|
||||
{
|
||||
/* Couldn't open the file. */
|
||||
free ((void *) result);
|
||||
- return (nl_catd) -1;
|
||||
+ result = (nl_catd) -1;
|
||||
}
|
||||
|
||||
+ free (tmp);
|
||||
return (nl_catd) result;
|
||||
}
|
||||
|
||||
Index: git/catgets/open_catalog.c
|
||||
===================================================================
|
||||
--- git.orig/catgets/open_catalog.c
|
||||
+++ git/catgets/open_catalog.c
|
||||
@@ -47,6 +47,7 @@ __open_catalog (const char *cat_name, co
|
||||
size_t tab_size;
|
||||
const char *lastp;
|
||||
int result = -1;
|
||||
+ char *buf = NULL;
|
||||
|
||||
if (strchr (cat_name, '/') != NULL || nlspath == NULL)
|
||||
fd = open_not_cancel_2 (cat_name, O_RDONLY);
|
||||
@@ -57,23 +58,23 @@ __open_catalog (const char *cat_name, co
|
||||
if (__glibc_unlikely (bufact + (n) >= bufmax)) \
|
||||
{ \
|
||||
char *old_buf = buf; \
|
||||
- bufmax += 256 + (n); \
|
||||
- buf = (char *) alloca (bufmax); \
|
||||
- memcpy (buf, old_buf, bufact); \
|
||||
+ bufmax += (bufmax < 256 + (n)) ? 256 + (n) : bufmax; \
|
||||
+ buf = realloc (buf, bufmax); \
|
||||
+ if (__glibc_unlikely (buf == NULL)) \
|
||||
+ { \
|
||||
+ free (old_buf); \
|
||||
+ return -1; \
|
||||
+ } \
|
||||
}
|
||||
|
||||
/* The RUN_NLSPATH variable contains a colon separated list of
|
||||
descriptions where we expect to find catalogs. We have to
|
||||
recognize certain % substitutions and stop when we found the
|
||||
first existing file. */
|
||||
- char *buf;
|
||||
size_t bufact;
|
||||
- size_t bufmax;
|
||||
+ size_t bufmax = 0;
|
||||
size_t len;
|
||||
|
||||
- buf = NULL;
|
||||
- bufmax = 0;
|
||||
-
|
||||
fd = -1;
|
||||
while (*run_nlspath != '\0')
|
||||
{
|
||||
@@ -188,7 +189,10 @@ __open_catalog (const char *cat_name, co
|
||||
|
||||
/* Avoid dealing with directories and block devices */
|
||||
if (__builtin_expect (fd, 0) < 0)
|
||||
- return -1;
|
||||
+ {
|
||||
+ free (buf);
|
||||
+ return -1;
|
||||
+ }
|
||||
|
||||
if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &st), 0) < 0)
|
||||
goto close_unlock_return;
|
||||
@@ -325,6 +329,7 @@ __open_catalog (const char *cat_name, co
|
||||
/* Release the lock again. */
|
||||
close_unlock_return:
|
||||
close_not_cancel_no_status (fd);
|
||||
+ free (buf);
|
||||
|
||||
return result;
|
||||
}
|
||||
Index: git/catgets/tst-catgets.c
|
||||
===================================================================
|
||||
--- git.orig/catgets/tst-catgets.c
|
||||
+++ git/catgets/tst-catgets.c
|
||||
@@ -1,7 +1,10 @@
|
||||
+#include <assert.h>
|
||||
#include <mcheck.h>
|
||||
#include <nl_types.h>
|
||||
#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
#include <string.h>
|
||||
+#include <sys/resource.h>
|
||||
|
||||
|
||||
static const char *msgs[] =
|
||||
@@ -12,6 +15,33 @@ static const char *msgs[] =
|
||||
};
|
||||
#define nmsgs (sizeof (msgs) / sizeof (msgs[0]))
|
||||
|
||||
+
|
||||
+/* Test for unbounded alloca. */
|
||||
+static int
|
||||
+do_bz17905 (void)
|
||||
+{
|
||||
+ char *buf;
|
||||
+ struct rlimit rl;
|
||||
+ nl_catd result;
|
||||
+
|
||||
+ const int sz = 1024 * 1024;
|
||||
+
|
||||
+ getrlimit (RLIMIT_STACK, &rl);
|
||||
+ rl.rlim_cur = sz;
|
||||
+ setrlimit (RLIMIT_STACK, &rl);
|
||||
+
|
||||
+ buf = malloc (sz + 1);
|
||||
+ memset (buf, 'A', sz);
|
||||
+ buf[sz] = '\0';
|
||||
+ setenv ("NLSPATH", buf, 1);
|
||||
+
|
||||
+ result = catopen (buf, NL_CAT_LOCALE);
|
||||
+ assert (result == (nl_catd) -1);
|
||||
+
|
||||
+ free (buf);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
#define ROUNDS 5
|
||||
|
||||
static int
|
||||
@@ -62,6 +92,7 @@ do_test (void)
|
||||
}
|
||||
}
|
||||
|
||||
+ result += do_bz17905 ();
|
||||
return result;
|
||||
}
|
||||
|
||||
Index: git/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/ChangeLog
|
||||
+++ git/ChangeLog
|
||||
@@ -1,3 +1,11 @@
|
||||
+2015-08-08 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||
+
|
||||
+ [BZ #17905]
|
||||
+ * catgets/Makefile (tst-catgets-mem): New test.
|
||||
+ * catgets/catgets.c (catopen): Don't use unbounded alloca.
|
||||
+ * catgets/open_catalog.c (__open_catalog): Likewise.
|
||||
+ * catgets/tst-catgets.c (do_bz17905): Test unbounded alloca.
|
||||
+
|
||||
2015-10-15 Florian Weimer <fweimer@redhat.com>
|
||||
|
||||
[BZ #18928]
|
||||
Index: git/NEWS
|
||||
===================================================================
|
||||
--- git.orig/NEWS
|
||||
+++ git/NEWS
|
||||
@@ -9,7 +9,7 @@ Version 2.22.1
|
||||
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
- 18778, 18781, 18787.
|
||||
+ 18778, 18781, 18787, 17905.
|
||||
|
||||
Version 2.22
|
||||
|
||||
1039
meta/recipes-core/glibc/glibc/CVE-2015-9761_1.patch
Normal file
1039
meta/recipes-core/glibc/glibc/CVE-2015-9761_1.patch
Normal file
File diff suppressed because it is too large
Load Diff
385
meta/recipes-core/glibc/glibc/CVE-2015-9761_2.patch
Normal file
385
meta/recipes-core/glibc/glibc/CVE-2015-9761_2.patch
Normal file
@@ -0,0 +1,385 @@
|
||||
From 8f5e8b01a1da2a207228f2072c934fa5918554b8 Mon Sep 17 00:00:00 2001
|
||||
From: Joseph Myers <joseph@codesourcery.com>
|
||||
Date: Fri, 4 Dec 2015 20:36:28 +0000
|
||||
Subject: [PATCH] Fix nan functions handling of payload strings (bug 16961, bug
|
||||
16962).
|
||||
|
||||
The nan, nanf and nanl functions handle payload strings by doing e.g.:
|
||||
|
||||
if (tagp[0] != '\0')
|
||||
{
|
||||
char buf[6 + strlen (tagp)];
|
||||
sprintf (buf, "NAN(%s)", tagp);
|
||||
return strtod (buf, NULL);
|
||||
}
|
||||
|
||||
This is an unbounded stack allocation based on the length of the
|
||||
argument. Furthermore, if the argument starts with an n-char-sequence
|
||||
followed by ')', that n-char-sequence is wrongly treated as
|
||||
significant for determining the payload of the resulting NaN, when ISO
|
||||
C says the call should be equivalent to strtod ("NAN", NULL), without
|
||||
being affected by that initial n-char-sequence. This patch fixes both
|
||||
those problems by using the __strtod_nan etc. functions recently
|
||||
factored out of strtod etc. for that purpose, with those functions
|
||||
being exported from libc at version GLIBC_PRIVATE.
|
||||
|
||||
Tested for x86_64, x86, mips64 and powerpc.
|
||||
|
||||
[BZ #16961]
|
||||
[BZ #16962]
|
||||
* math/s_nan.c (__nan): Use __strtod_nan instead of constructing a
|
||||
string on the stack for strtod.
|
||||
* math/s_nanf.c (__nanf): Use __strtof_nan instead of constructing
|
||||
a string on the stack for strtof.
|
||||
* math/s_nanl.c (__nanl): Use __strtold_nan instead of
|
||||
constructing a string on the stack for strtold.
|
||||
* stdlib/Versions (libc): Add __strtof_nan, __strtod_nan and
|
||||
__strtold_nan to GLIBC_PRIVATE.
|
||||
* math/test-nan-overflow.c: New file.
|
||||
* math/test-nan-payload.c: Likewise.
|
||||
* math/Makefile (tests): Add test-nan-overflow and
|
||||
test-nan-payload.
|
||||
|
||||
Upstream-Status: Backport
|
||||
CVE: CVE-2015-9761 patch #2
|
||||
[Yocto # 8980]
|
||||
|
||||
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8f5e8b01a1da2a207228f2072c934fa5918554b8
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
ChangeLog | 17 +++++++
|
||||
NEWS | 6 +++
|
||||
math/Makefile | 3 +-
|
||||
math/s_nan.c | 9 +---
|
||||
math/s_nanf.c | 9 +---
|
||||
math/s_nanl.c | 9 +---
|
||||
math/test-nan-overflow.c | 66 +++++++++++++++++++++++++
|
||||
math/test-nan-payload.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
stdlib/Versions | 1 +
|
||||
9 files changed, 217 insertions(+), 25 deletions(-)
|
||||
create mode 100644 math/test-nan-overflow.c
|
||||
create mode 100644 math/test-nan-payload.c
|
||||
|
||||
Index: git/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/ChangeLog
|
||||
+++ git/ChangeLog
|
||||
@@ -1,3 +1,20 @@
|
||||
+2015-12-04 Joseph Myers <joseph@codesourcery.com>
|
||||
+
|
||||
+ [BZ #16961]
|
||||
+ [BZ #16962]
|
||||
+ * math/s_nan.c (__nan): Use __strtod_nan instead of constructing a
|
||||
+ string on the stack for strtod.
|
||||
+ * math/s_nanf.c (__nanf): Use __strtof_nan instead of constructing
|
||||
+ a string on the stack for strtof.
|
||||
+ * math/s_nanl.c (__nanl): Use __strtold_nan instead of
|
||||
+ constructing a string on the stack for strtold.
|
||||
+ * stdlib/Versions (libc): Add __strtof_nan, __strtod_nan and
|
||||
+ __strtold_nan to GLIBC_PRIVATE.
|
||||
+ * math/test-nan-overflow.c: New file.
|
||||
+ * math/test-nan-payload.c: Likewise.
|
||||
+ * math/Makefile (tests): Add test-nan-overflow and
|
||||
+ test-nan-payload.
|
||||
+
|
||||
2015-11-24 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* stdlib/strtod_nan.c: New file.
|
||||
Index: git/NEWS
|
||||
===================================================================
|
||||
--- git.orig/NEWS
|
||||
+++ git/NEWS
|
||||
@@ -99,6 +99,12 @@ Version 2.22
|
||||
|
||||
Version 2.21
|
||||
|
||||
+Security related changes:
|
||||
+
|
||||
+* The nan, nanf and nanl functions no longer have unbounded stack usage
|
||||
+ depending on the length of the string passed as an argument to the
|
||||
+ functions. Reported by Joseph Myers.
|
||||
+
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
6652, 10672, 12674, 12847, 12926, 13862, 14132, 14138, 14171, 14498,
|
||||
Index: git/math/Makefile
|
||||
===================================================================
|
||||
--- git.orig/math/Makefile
|
||||
+++ git/math/Makefile
|
||||
@@ -110,6 +110,7 @@ tests = test-matherr test-fenv atest-exp
|
||||
test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \
|
||||
test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \
|
||||
test-fenv-tls test-fenv-preserve test-fenv-return test-fenvinline \
|
||||
+ test-nan-overflow test-nan-payload \
|
||||
$(tests-static)
|
||||
tests-static = test-fpucw-static test-fpucw-ieee-static
|
||||
# We do the `long double' tests only if this data type is available and
|
||||
Index: git/math/s_nan.c
|
||||
===================================================================
|
||||
--- git.orig/math/s_nan.c
|
||||
+++ git/math/s_nan.c
|
||||
@@ -28,14 +28,7 @@
|
||||
double
|
||||
__nan (const char *tagp)
|
||||
{
|
||||
- if (tagp[0] != '\0')
|
||||
- {
|
||||
- char buf[6 + strlen (tagp)];
|
||||
- sprintf (buf, "NAN(%s)", tagp);
|
||||
- return strtod (buf, NULL);
|
||||
- }
|
||||
-
|
||||
- return NAN;
|
||||
+ return __strtod_nan (tagp, NULL, 0);
|
||||
}
|
||||
weak_alias (__nan, nan)
|
||||
#ifdef NO_LONG_DOUBLE
|
||||
Index: git/math/s_nanf.c
|
||||
===================================================================
|
||||
--- git.orig/math/s_nanf.c
|
||||
+++ git/math/s_nanf.c
|
||||
@@ -28,13 +28,6 @@
|
||||
float
|
||||
__nanf (const char *tagp)
|
||||
{
|
||||
- if (tagp[0] != '\0')
|
||||
- {
|
||||
- char buf[6 + strlen (tagp)];
|
||||
- sprintf (buf, "NAN(%s)", tagp);
|
||||
- return strtof (buf, NULL);
|
||||
- }
|
||||
-
|
||||
- return NAN;
|
||||
+ return __strtof_nan (tagp, NULL, 0);
|
||||
}
|
||||
weak_alias (__nanf, nanf)
|
||||
Index: git/math/s_nanl.c
|
||||
===================================================================
|
||||
--- git.orig/math/s_nanl.c
|
||||
+++ git/math/s_nanl.c
|
||||
@@ -28,13 +28,6 @@
|
||||
long double
|
||||
__nanl (const char *tagp)
|
||||
{
|
||||
- if (tagp[0] != '\0')
|
||||
- {
|
||||
- char buf[6 + strlen (tagp)];
|
||||
- sprintf (buf, "NAN(%s)", tagp);
|
||||
- return strtold (buf, NULL);
|
||||
- }
|
||||
-
|
||||
- return NAN;
|
||||
+ return __strtold_nan (tagp, NULL, 0);
|
||||
}
|
||||
weak_alias (__nanl, nanl)
|
||||
Index: git/math/test-nan-overflow.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ git/math/test-nan-overflow.c
|
||||
@@ -0,0 +1,66 @@
|
||||
+/* Test nan functions stack overflow (bug 16962).
|
||||
+ Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
+ This file is part of the GNU C Library.
|
||||
+
|
||||
+ The GNU C Library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with the GNU C Library; if not, see
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <math.h>
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <sys/resource.h>
|
||||
+
|
||||
+#define STACK_LIM 1048576
|
||||
+#define STRING_SIZE (2 * STACK_LIM)
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ int result = 0;
|
||||
+ struct rlimit lim;
|
||||
+ getrlimit (RLIMIT_STACK, &lim);
|
||||
+ lim.rlim_cur = STACK_LIM;
|
||||
+ setrlimit (RLIMIT_STACK, &lim);
|
||||
+ char *nanstr = malloc (STRING_SIZE);
|
||||
+ if (nanstr == NULL)
|
||||
+ {
|
||||
+ puts ("malloc failed, cannot test");
|
||||
+ return 77;
|
||||
+ }
|
||||
+ memset (nanstr, '0', STRING_SIZE - 1);
|
||||
+ nanstr[STRING_SIZE - 1] = 0;
|
||||
+#define NAN_TEST(TYPE, FUNC) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ char *volatile p = nanstr; \
|
||||
+ volatile TYPE v = FUNC (p); \
|
||||
+ if (isnan (v)) \
|
||||
+ puts ("PASS: " #FUNC); \
|
||||
+ else \
|
||||
+ { \
|
||||
+ puts ("FAIL: " #FUNC); \
|
||||
+ result = 1; \
|
||||
+ } \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+ NAN_TEST (float, nanf);
|
||||
+ NAN_TEST (double, nan);
|
||||
+#ifndef NO_LONG_DOUBLE
|
||||
+ NAN_TEST (long double, nanl);
|
||||
+#endif
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+#define TEST_FUNCTION do_test ()
|
||||
+#include "../test-skeleton.c"
|
||||
Index: git/math/test-nan-payload.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ git/math/test-nan-payload.c
|
||||
@@ -0,0 +1,122 @@
|
||||
+/* Test nan functions payload handling (bug 16961).
|
||||
+ Copyright (C) 2015 Free Software Foundation, Inc.
|
||||
+ This file is part of the GNU C Library.
|
||||
+
|
||||
+ The GNU C Library is free software; you can redistribute it and/or
|
||||
+ modify it under the terms of the GNU Lesser General Public
|
||||
+ License as published by the Free Software Foundation; either
|
||||
+ version 2.1 of the License, or (at your option) any later version.
|
||||
+
|
||||
+ The GNU C Library is distributed in the hope that it will be useful,
|
||||
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ Lesser General Public License for more details.
|
||||
+
|
||||
+ You should have received a copy of the GNU Lesser General Public
|
||||
+ License along with the GNU C Library; if not, see
|
||||
+ <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <float.h>
|
||||
+#include <math.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+/* Avoid built-in functions. */
|
||||
+#define WRAP_NAN(FUNC, STR) \
|
||||
+ ({ const char *volatile wns = (STR); FUNC (wns); })
|
||||
+#define WRAP_STRTO(FUNC, STR) \
|
||||
+ ({ const char *volatile wss = (STR); FUNC (wss, NULL); })
|
||||
+
|
||||
+#define CHECK_IS_NAN(TYPE, A) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ if (isnan (A)) \
|
||||
+ puts ("PASS: " #TYPE " " #A); \
|
||||
+ else \
|
||||
+ { \
|
||||
+ puts ("FAIL: " #TYPE " " #A); \
|
||||
+ result = 1; \
|
||||
+ } \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+#define CHECK_SAME_NAN(TYPE, A, B) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ if (memcmp (&(A), &(B), sizeof (A)) == 0) \
|
||||
+ puts ("PASS: " #TYPE " " #A " = " #B); \
|
||||
+ else \
|
||||
+ { \
|
||||
+ puts ("FAIL: " #TYPE " " #A " = " #B); \
|
||||
+ result = 1; \
|
||||
+ } \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+#define CHECK_DIFF_NAN(TYPE, A, B) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ if (memcmp (&(A), &(B), sizeof (A)) != 0) \
|
||||
+ puts ("PASS: " #TYPE " " #A " != " #B); \
|
||||
+ else \
|
||||
+ { \
|
||||
+ puts ("FAIL: " #TYPE " " #A " != " #B); \
|
||||
+ result = 1; \
|
||||
+ } \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+/* Cannot test payloads by memcmp for formats where NaNs have padding
|
||||
+ bits. */
|
||||
+#define CAN_TEST_EQ(MANT_DIG) ((MANT_DIG) != 64 && (MANT_DIG) != 106)
|
||||
+
|
||||
+#define RUN_TESTS(TYPE, SFUNC, FUNC, MANT_DIG) \
|
||||
+ do \
|
||||
+ { \
|
||||
+ TYPE n123 = WRAP_NAN (FUNC, "123"); \
|
||||
+ CHECK_IS_NAN (TYPE, n123); \
|
||||
+ TYPE s123 = WRAP_STRTO (SFUNC, "NAN(123)"); \
|
||||
+ CHECK_IS_NAN (TYPE, s123); \
|
||||
+ TYPE n456 = WRAP_NAN (FUNC, "456"); \
|
||||
+ CHECK_IS_NAN (TYPE, n456); \
|
||||
+ TYPE s456 = WRAP_STRTO (SFUNC, "NAN(456)"); \
|
||||
+ CHECK_IS_NAN (TYPE, s456); \
|
||||
+ TYPE n123x = WRAP_NAN (FUNC, "123)"); \
|
||||
+ CHECK_IS_NAN (TYPE, n123x); \
|
||||
+ TYPE nemp = WRAP_NAN (FUNC, ""); \
|
||||
+ CHECK_IS_NAN (TYPE, nemp); \
|
||||
+ TYPE semp = WRAP_STRTO (SFUNC, "NAN()"); \
|
||||
+ CHECK_IS_NAN (TYPE, semp); \
|
||||
+ TYPE sx = WRAP_STRTO (SFUNC, "NAN"); \
|
||||
+ CHECK_IS_NAN (TYPE, sx); \
|
||||
+ if (CAN_TEST_EQ (MANT_DIG)) \
|
||||
+ CHECK_SAME_NAN (TYPE, n123, s123); \
|
||||
+ if (CAN_TEST_EQ (MANT_DIG)) \
|
||||
+ CHECK_SAME_NAN (TYPE, n456, s456); \
|
||||
+ if (CAN_TEST_EQ (MANT_DIG)) \
|
||||
+ CHECK_SAME_NAN (TYPE, nemp, semp); \
|
||||
+ if (CAN_TEST_EQ (MANT_DIG)) \
|
||||
+ CHECK_SAME_NAN (TYPE, n123x, sx); \
|
||||
+ CHECK_DIFF_NAN (TYPE, n123, n456); \
|
||||
+ CHECK_DIFF_NAN (TYPE, n123, nemp); \
|
||||
+ CHECK_DIFF_NAN (TYPE, n123, n123x); \
|
||||
+ CHECK_DIFF_NAN (TYPE, n456, nemp); \
|
||||
+ CHECK_DIFF_NAN (TYPE, n456, n123x); \
|
||||
+ } \
|
||||
+ while (0)
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ int result = 0;
|
||||
+ RUN_TESTS (float, strtof, nanf, FLT_MANT_DIG);
|
||||
+ RUN_TESTS (double, strtod, nan, DBL_MANT_DIG);
|
||||
+#ifndef NO_LONG_DOUBLE
|
||||
+ RUN_TESTS (long double, strtold, nanl, LDBL_MANT_DIG);
|
||||
+#endif
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+#define TEST_FUNCTION do_test ()
|
||||
+#include "../test-skeleton.c"
|
||||
Index: git/stdlib/Versions
|
||||
===================================================================
|
||||
--- git.orig/stdlib/Versions
|
||||
+++ git/stdlib/Versions
|
||||
@@ -118,5 +118,6 @@ libc {
|
||||
# Used from other libraries
|
||||
__libc_secure_getenv;
|
||||
__call_tls_dtors;
|
||||
+ __strtof_nan; __strtod_nan; __strtold_nan;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
Upstream-Status: Backport
|
||||
|
||||
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
|
||||
|
||||
From https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6c84109cfa26f35c3dfed3acb97d347361bd5849
|
||||
Author: Carlos O'Donell <carlos@systemhalted.org>
|
||||
Date: Thu Oct 8 16:34:53 2015 -0400
|
||||
|
||||
strcoll: Remove incorrect STRDIFF-based optimization (Bug 18589).
|
||||
|
||||
The optimization introduced in commit
|
||||
f13c2a8dff2329c6692a80176262ceaaf8a6f74e, causes regressions in
|
||||
sorting for languages that have digraphs that change sort order, like
|
||||
cs_CZ which sorts ch between h and i.
|
||||
|
||||
My analysis shows the fast-forwarding optimization in STRCOLL advances
|
||||
through a digraph while possibly stopping in the middle which results
|
||||
in a subsequent skipping of the digraph and incorrect sorting. The
|
||||
optimization is incorrect as implemented and because of that I'm
|
||||
removing it for 2.23, and I will also commit this fix for 2.22 where
|
||||
it was originally introduced.
|
||||
|
||||
This patch reverts the optimization, introduces a new bug-strcoll2.c
|
||||
regression test that tests both cs_CZ.UTF-8 and da_DK.ISO-8859-1 and
|
||||
ensures they sort one digraph each correctly. The optimization can't be
|
||||
applied without regressing this test.
|
||||
|
||||
Checked on x86_64, bug-strcoll2.c fails without this patch and passes
|
||||
after. This will also get a fix on 2.22 which has the same bug.
|
||||
|
||||
(cherry picked from commit 87701a58e291bd7ac3b407d10a829dac52c9c16e)
|
||||
---
|
||||
locale/C-collate.c | 4 +-
|
||||
locale/categories.def | 1 -
|
||||
locale/langinfo.h | 1 -
|
||||
locale/localeinfo.h | 7 ----
|
||||
locale/programs/ld-collate.c | 9 -----
|
||||
string/bug-strcoll2.c | 95 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
string/strcoll_l.c | 39 +-----------------
|
||||
wcsmbs/wcscoll_l.c | 1 -
|
||||
8 files changed, 98 insertions(+), 59 deletions(-)
|
||||
create mode 100644 string/bug-strcoll2.c
|
||||
|
||||
diff --git a/locale/C-collate.c b/locale/C-collate.c
|
||||
index d7f3c55..06dfdfa 100644
|
||||
--- a/locale/C-collate.c
|
||||
+++ b/locale/C-collate.c
|
||||
@@ -144,8 +144,6 @@ const struct __locale_data _nl_C_LC_COLLATE attribute_hidden =
|
||||
/* _NL_COLLATE_COLLSEQWC */
|
||||
{ .string = (const char *) collseqwc },
|
||||
/* _NL_COLLATE_CODESET */
|
||||
- { .string = _nl_C_codeset },
|
||||
- /* _NL_COLLATE_ENCODING_TYPE */
|
||||
- { .word = __cet_8bit }
|
||||
+ { .string = _nl_C_codeset }
|
||||
}
|
||||
};
|
||||
diff --git a/locale/categories.def b/locale/categories.def
|
||||
index 045489d..a8dda53 100644
|
||||
--- a/locale/categories.def
|
||||
+++ b/locale/categories.def
|
||||
@@ -58,7 +58,6 @@ DEFINE_CATEGORY
|
||||
DEFINE_ELEMENT (_NL_COLLATE_COLLSEQMB, "collate-collseqmb", std, wstring)
|
||||
DEFINE_ELEMENT (_NL_COLLATE_COLLSEQWC, "collate-collseqwc", std, wstring)
|
||||
DEFINE_ELEMENT (_NL_COLLATE_CODESET, "collate-codeset", std, string)
|
||||
- DEFINE_ELEMENT (_NL_COLLATE_ENCODING_TYPE, "collate-encoding-type", std, word)
|
||||
), NO_POSTLOAD)
|
||||
|
||||
|
||||
diff --git a/locale/langinfo.h b/locale/langinfo.h
|
||||
index ffc5c7f..a565d9d 100644
|
||||
--- a/locale/langinfo.h
|
||||
+++ b/locale/langinfo.h
|
||||
@@ -255,7 +255,6 @@ enum
|
||||
_NL_COLLATE_COLLSEQMB,
|
||||
_NL_COLLATE_COLLSEQWC,
|
||||
_NL_COLLATE_CODESET,
|
||||
- _NL_COLLATE_ENCODING_TYPE,
|
||||
_NL_NUM_LC_COLLATE,
|
||||
|
||||
/* LC_CTYPE category: character classification.
|
||||
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
|
||||
index a7516c0..c076d8e 100644
|
||||
--- a/locale/localeinfo.h
|
||||
+++ b/locale/localeinfo.h
|
||||
@@ -110,13 +110,6 @@ enum coll_sort_rule
|
||||
sort_mask
|
||||
};
|
||||
|
||||
-/* Collation encoding type. */
|
||||
-enum collation_encoding_type
|
||||
-{
|
||||
- __cet_other,
|
||||
- __cet_8bit,
|
||||
- __cet_utf8
|
||||
-};
|
||||
|
||||
/* We can map the types of the entries into a few categories. */
|
||||
enum value_type
|
||||
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
|
||||
index 16e9039..3c88c6d 100644
|
||||
--- a/locale/programs/ld-collate.c
|
||||
+++ b/locale/programs/ld-collate.c
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "linereader.h"
|
||||
#include "locfile.h"
|
||||
#include "elem-hash.h"
|
||||
-#include "../localeinfo.h"
|
||||
|
||||
/* Uncomment the following line in the production version. */
|
||||
/* #define NDEBUG 1 */
|
||||
@@ -2130,8 +2129,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
|
||||
/* The words have to be handled specially. */
|
||||
if (idx == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_HASH_SIZEMB))
|
||||
add_locale_uint32 (&file, 0);
|
||||
- else if (idx == _NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE))
|
||||
- add_locale_uint32 (&file, __cet_other);
|
||||
else
|
||||
add_locale_empty (&file);
|
||||
}
|
||||
@@ -2495,12 +2492,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
|
||||
add_locale_raw_data (&file, collate->mbseqorder, 256);
|
||||
add_locale_collseq_table (&file, &collate->wcseqorder);
|
||||
add_locale_string (&file, charmap->code_set_name);
|
||||
- if (strcmp (charmap->code_set_name, "UTF-8") == 0)
|
||||
- add_locale_uint32 (&file, __cet_utf8);
|
||||
- else if (charmap->mb_cur_max == 1)
|
||||
- add_locale_uint32 (&file, __cet_8bit);
|
||||
- else
|
||||
- add_locale_uint32 (&file, __cet_other);
|
||||
write_locale_data (output_path, LC_COLLATE, "LC_COLLATE", &file);
|
||||
|
||||
obstack_free (&weightpool, NULL);
|
||||
diff --git a/string/bug-strcoll2.c b/string/bug-strcoll2.c
|
||||
new file mode 100644
|
||||
index 0000000..950b090
|
||||
--- /dev/null
|
||||
+++ b/string/bug-strcoll2.c
|
||||
@@ -0,0 +1,95 @@
|
||||
+/* Bug 18589: sort-test.sh fails at random.
|
||||
+ * Copyright (C) 1998-2015 Free Software Foundation, Inc.
|
||||
+ * This file is part of the GNU C Library.
|
||||
+ * Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
|
||||
+ *
|
||||
+ * The GNU C Library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * The GNU C Library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with the GNU C Library; if not, see
|
||||
+ * <http://www.gnu.org/licenses/>. */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include <locale.h>
|
||||
+
|
||||
+/* An incorrect strcoll optimization resulted in incorrect
|
||||
+ * results from strcoll for cs_CZ and da_DK. */
|
||||
+
|
||||
+int
|
||||
+test_cs_CZ (void)
|
||||
+{
|
||||
+ const char t1[] = "config";
|
||||
+ const char t2[] = "choose";
|
||||
+ if (setlocale (LC_ALL, "cs_CZ.UTF-8") == NULL)
|
||||
+ {
|
||||
+ perror ("setlocale");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ /* In Czech the digraph ch sorts after c, therefore we expect
|
||||
+ * config to sort before choose. */
|
||||
+ int a = strcoll (t1, t2);
|
||||
+ int b = strcoll (t2, t1);
|
||||
+ printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
|
||||
+ printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
|
||||
+ if (a < 0 && b > 0)
|
||||
+ {
|
||||
+ puts ("PASS: config < choose");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ puts ("FAIL: Wrong sorting in cz_CZ.UTF-8.");
|
||||
+ return 1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+int
|
||||
+test_da_DK (void)
|
||||
+{
|
||||
+ const char t1[] = "AS";
|
||||
+ const char t2[] = "AA";
|
||||
+ if (setlocale (LC_ALL, "da_DK.ISO-8859-1") == NULL)
|
||||
+ {
|
||||
+ perror ("setlocale");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ /* AA should be treated as the last letter of the Danish alphabet,
|
||||
+ * hence sorting after AS. */
|
||||
+ int a = strcoll (t1, t2);
|
||||
+ int b = strcoll (t2, t1);
|
||||
+ printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, a);
|
||||
+ printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, b);
|
||||
+ if (a < 0 && b > 0)
|
||||
+ {
|
||||
+ puts ("PASS: AS < AA");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ puts ("FAIL: Wrong sorting in da_DK.ISO-8859-1");
|
||||
+ return 1;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+do_test (void)
|
||||
+{
|
||||
+ int err = 0;
|
||||
+ err |= test_cs_CZ ();
|
||||
+ err |= test_da_DK ();
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+#define TEST_FUNCTION do_test ()
|
||||
+#include "../test-skeleton.c"
|
||||
+
|
||||
+
|
||||
diff --git a/string/strcoll_l.c b/string/strcoll_l.c
|
||||
index b36b18c..a18b65e 100644
|
||||
--- a/string/strcoll_l.c
|
||||
+++ b/string/strcoll_l.c
|
||||
@@ -30,7 +30,6 @@
|
||||
# define STRING_TYPE char
|
||||
# define USTRING_TYPE unsigned char
|
||||
# define STRCOLL __strcoll_l
|
||||
-# define STRDIFF __strdiff
|
||||
# define STRCMP strcmp
|
||||
# define WEIGHT_H "../locale/weight.h"
|
||||
# define SUFFIX MB
|
||||
@@ -43,19 +42,6 @@
|
||||
#include "../locale/localeinfo.h"
|
||||
#include WEIGHT_H
|
||||
|
||||
-#define MASK_UTF8_7BIT (1 << 7)
|
||||
-#define MASK_UTF8_START (3 << 6)
|
||||
-
|
||||
-size_t
|
||||
-STRDIFF (const STRING_TYPE *s, const STRING_TYPE *t)
|
||||
-{
|
||||
- size_t n;
|
||||
-
|
||||
- for (n = 0; *s != '\0' && *s++ == *t++; ++n)
|
||||
- continue;
|
||||
-
|
||||
- return n;
|
||||
-}
|
||||
|
||||
/* Track status while looking for sequences in a string. */
|
||||
typedef struct
|
||||
@@ -274,29 +260,9 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
|
||||
const USTRING_TYPE *extra;
|
||||
const int32_t *indirect;
|
||||
|
||||
- /* In case there is no locale specific sort order (C / POSIX). */
|
||||
if (nrules == 0)
|
||||
return STRCMP (s1, s2);
|
||||
|
||||
- /* Fast forward to the position of the first difference. Needs to be
|
||||
- encoding aware as the byte-by-byte comparison can stop in the middle
|
||||
- of a char sequence for multibyte encodings like UTF-8. */
|
||||
- uint_fast32_t encoding =
|
||||
- current->values[_NL_ITEM_INDEX (_NL_COLLATE_ENCODING_TYPE)].word;
|
||||
- if (encoding != __cet_other)
|
||||
- {
|
||||
- size_t diff = STRDIFF (s1, s2);
|
||||
- if (diff > 0)
|
||||
- {
|
||||
- if (encoding == __cet_utf8 && (*(s1 + diff) & MASK_UTF8_7BIT) != 0)
|
||||
- do
|
||||
- diff--;
|
||||
- while (diff > 0 && (*(s1 + diff) & MASK_UTF8_START) != MASK_UTF8_START);
|
||||
- s1 += diff;
|
||||
- s2 += diff;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
/* Catch empty strings. */
|
||||
if (__glibc_unlikely (*s1 == '\0') || __glibc_unlikely (*s2 == '\0'))
|
||||
return (*s1 != '\0') - (*s2 != '\0');
|
||||
@@ -363,9 +329,8 @@ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
|
||||
byte-level comparison to ensure that we don't waste time
|
||||
going through multiple passes for totally equal strings
|
||||
before proceeding to subsequent passes. */
|
||||
- if (pass == 0 && encoding == __cet_other &&
|
||||
- STRCMP (s1, s2) == 0)
|
||||
- return result;
|
||||
+ if (pass == 0 && STRCMP (s1, s2) == 0)
|
||||
+ return result;
|
||||
else
|
||||
break;
|
||||
}
|
||||
diff --git a/wcsmbs/wcscoll_l.c b/wcsmbs/wcscoll_l.c
|
||||
index 6d9384a..87f240d 100644
|
||||
--- a/wcsmbs/wcscoll_l.c
|
||||
+++ b/wcsmbs/wcscoll_l.c
|
||||
@@ -23,7 +23,6 @@
|
||||
#define STRING_TYPE wchar_t
|
||||
#define USTRING_TYPE wint_t
|
||||
#define STRCOLL __wcscoll_l
|
||||
-#define STRDIFF __wcsdiff
|
||||
#define STRCMP __wcscmp
|
||||
#define WEIGHT_H "../locale/weightwc.h"
|
||||
#define SUFFIX WC
|
||||
--
|
||||
1.8.4.2
|
||||
|
||||
@@ -39,6 +39,14 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||
file://0026-eglibc-dl_debug_mask-is-controlled-by-__OPTION_EGLIB.patch \
|
||||
file://0027-eglibc-use-option-groups-Conditionally-exclude-c-tes.patch \
|
||||
file://nscd-no-bash.patch \
|
||||
file://strcoll-Remove-incorrect-STRDIFF-based-optimization-.patch \
|
||||
file://0028-Clear-ELF_RTYPE_CLASS_EXTERN_PROTECTED_DATA-for-prel.patch \
|
||||
file://CVE-2015-8777.patch \
|
||||
file://CVE-2015-8779.patch \
|
||||
file://CVE-2015-9761_1.patch \
|
||||
file://CVE-2015-9761_2.patch \
|
||||
file://CVE-2015-8776.patch \
|
||||
file://CVE-2015-7547.patch \
|
||||
"
|
||||
|
||||
SRC_URI += "\
|
||||
|
||||
@@ -21,8 +21,8 @@ IMAGE_FSTYPES = "vmdk"
|
||||
|
||||
inherit core-image
|
||||
|
||||
SRCREV ?= "e14498b20963c14b7c851ca46cb6afd815138841"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky \
|
||||
SRCREV ?= "7fe17a2942ff03e2ec47d566fd5393f52b2eb736"
|
||||
SRC_URI = "git://git.yoctoproject.org/poky;branch=jethro \
|
||||
file://Yocto_Build_Appliance.vmx \
|
||||
file://Yocto_Build_Appliance.vmxf \
|
||||
"
|
||||
|
||||
@@ -134,7 +134,7 @@ swap_start=$((rootfs_end))
|
||||
# 2) they are detected asynchronously (need rootwait)
|
||||
rootwait=""
|
||||
part_prefix=""
|
||||
if [ ! "${device#mmcblk}" = "${device}" ]; then
|
||||
if [ ! "${device#/dev/mmcblk}" = "${device}" ]; then
|
||||
part_prefix="p"
|
||||
rootwait="rootwait"
|
||||
fi
|
||||
@@ -184,8 +184,8 @@ mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
|
||||
echo "Copying rootfs files..."
|
||||
cp -a /src_root/* /tgt_root
|
||||
if [ -d /tgt_root/etc/ ] ; then
|
||||
boot_uuid=$(blkid -o value -s UUID ${device}1)
|
||||
swap_part_uuid=$(blkid -o value -s PARTUUID ${device}3)
|
||||
boot_uuid=$(blkid -o value -s UUID ${bootfs})
|
||||
swap_part_uuid=$(blkid -o value -s PARTUUID ${swap})
|
||||
echo "/dev/disk/by-partuuid/$swap_part_uuid swap swap defaults 0 0" >> /tgt_root/etc/fstab
|
||||
echo "UUID=$boot_uuid /boot vfat defaults 1 2" >> /tgt_root/etc/fstab
|
||||
# We dont want udev to mount our root device while we're booting...
|
||||
@@ -206,7 +206,7 @@ mkdir -p $EFIDIR
|
||||
cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
|
||||
|
||||
if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
|
||||
root_part_uuid=$(blkid -o value -s PARTUUID ${device}2)
|
||||
root_part_uuid=$(blkid -o value -s PARTUUID ${rootfs})
|
||||
GRUBCFG="$EFIDIR/grub.cfg"
|
||||
cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
|
||||
# Update grub config for the installed image
|
||||
@@ -223,6 +223,7 @@ if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
|
||||
fi
|
||||
|
||||
if [ -d /run/media/$1/loader ]; then
|
||||
rootuuid=$(blkid -o value -s PARTUUID ${rootfs})
|
||||
GUMMIBOOT_CFGS="/boot/loader/entries/*.conf"
|
||||
# copy config files for gummiboot
|
||||
cp -dr /run/media/$1/loader /boot
|
||||
|
||||
@@ -21,6 +21,22 @@ SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \
|
||||
file://libxml-m4-use-pkgconfig.patch \
|
||||
file://configure.ac-fix-cross-compiling-warning.patch \
|
||||
file://0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch \
|
||||
file://CVE-2015-7941-1-Stop-parsing-on-entities-boundaries-errors.patch \
|
||||
file://CVE-2015-7941-2-Cleanup-conditional-section-error-handling.patch \
|
||||
file://CVE-2015-8317-Fail-parsing-early-on-if-encoding-conversion-failed.patch \
|
||||
file://CVE-2015-7942-Another-variation-of-overflow-in-Conditional-section.patch \
|
||||
file://CVE-2015-7942-2-Fix-an-error-in-previous-Conditional-section-patch.patch \
|
||||
file://0001-CVE-2015-8035-Fix-XZ-compression-support-loop.patch \
|
||||
file://CVE-2015-7498-Avoid-processing-entities-after-encoding-conversion-.patch \
|
||||
file://0001-CVE-2015-7497-Avoid-an-heap-buffer-overflow-in-xmlDi.patch \
|
||||
file://CVE-2015-7499-1-Add-xmlHaltParser-to-stop-the-parser.patch \
|
||||
file://CVE-2015-7499-2-Detect-incoherency-on-GROW.patch \
|
||||
file://0001-Fix-a-bug-on-name-parsing-at-the-end-of-current-inpu.patch \
|
||||
file://0001-CVE-2015-7500-Fix-memory-access-error-due-to-incorre.patch \
|
||||
file://0001-CVE-2015-8242-Buffer-overead-with-HTML-parser-in-pus.patch \
|
||||
file://0001-CVE-2015-5312-Another-entity-expansion-issue.patch \
|
||||
file://CVE-2015-8241.patch \
|
||||
file://CVE-2015-8710.patch \
|
||||
"
|
||||
|
||||
BINCONFIG = "${bindir}/xml2-config"
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From 69030714cde66d525a8884bda01b9e8f0abf8e1e Mon Sep 17 00:00:00 2001
|
||||
From: David Drysdale <drysdale@google.com>
|
||||
Date: Fri, 20 Nov 2015 11:13:45 +0800
|
||||
Subject: [PATCH] CVE-2015-5312 Another entity expansion issue
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=756733
|
||||
It is one case where the code in place to detect entities expansions
|
||||
failed to exit when the situation was detected, leading to DoS
|
||||
Problem reported by Kostya Serebryany @ Google
|
||||
Patch provided by David Drysdale @ Google
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-5312
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index b7b6668..da6e729 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -2806,6 +2806,10 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
|
||||
0, 0, 0);
|
||||
ctxt->depth--;
|
||||
|
||||
+ if ((ctxt->lastError.code == XML_ERR_ENTITY_LOOP) ||
|
||||
+ (ctxt->lastError.code == XML_ERR_INTERNAL_ERROR))
|
||||
+ goto int_error;
|
||||
+
|
||||
if (rep != NULL) {
|
||||
current = rep;
|
||||
while (*current != 0) { /* non input consuming loop */
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 6360a31a84efe69d155ed96306b9a931a40beab9 Mon Sep 17 00:00:00 2001
|
||||
From: David Drysdale <drysdale@google.com>
|
||||
Date: Fri, 20 Nov 2015 10:47:12 +0800
|
||||
Subject: [PATCH] CVE-2015-7497 Avoid an heap buffer overflow in
|
||||
xmlDictComputeFastQKey
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=756528
|
||||
It was possible to hit a negative offset in the name indexing
|
||||
used to randomize the dictionary key generation
|
||||
Reported and fix provided by David Drysdale @ Google
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7497
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
dict.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dict.c b/dict.c
|
||||
index 5f71d55..8c8f931 100644
|
||||
--- a/dict.c
|
||||
+++ b/dict.c
|
||||
@@ -486,7 +486,10 @@ xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
|
||||
value += 30 * (*prefix);
|
||||
|
||||
if (len > 10) {
|
||||
- value += name[len - (plen + 1 + 1)];
|
||||
+ int offset = len - (plen + 1 + 1);
|
||||
+ if (offset < 0)
|
||||
+ offset = len - (10 + 1);
|
||||
+ value += name[offset];
|
||||
len = 10;
|
||||
if (plen > 10)
|
||||
plen = 10;
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
From f1063fdbe7fa66332bbb76874101c2a7b51b519f Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Fri, 20 Nov 2015 16:06:59 +0800
|
||||
Subject: [PATCH] CVE-2015-7500 Fix memory access error due to incorrect
|
||||
entities boundaries
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=756525
|
||||
handle properly the case where we popped out of the current entity
|
||||
while processing a start tag
|
||||
Reported by Kostya Serebryany @ Google
|
||||
|
||||
This slightly modifies the output of 754946 in regression tests
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7500
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 28 ++++++++++++++++++++++------
|
||||
result/errors/754946.xml.err | 7 +++++--
|
||||
2 files changed, 27 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index c7e4574..c5741e3 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -9348,7 +9348,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
|
||||
const xmlChar **atts = ctxt->atts;
|
||||
int maxatts = ctxt->maxatts;
|
||||
int nratts, nbatts, nbdef;
|
||||
- int i, j, nbNs, attval, oldline, oldcol;
|
||||
+ int i, j, nbNs, attval, oldline, oldcol, inputNr;
|
||||
const xmlChar *base;
|
||||
unsigned long cur;
|
||||
int nsNr = ctxt->nsNr;
|
||||
@@ -9367,6 +9367,7 @@ reparse:
|
||||
SHRINK;
|
||||
base = ctxt->input->base;
|
||||
cur = ctxt->input->cur - ctxt->input->base;
|
||||
+ inputNr = ctxt->inputNr;
|
||||
oldline = ctxt->input->line;
|
||||
oldcol = ctxt->input->col;
|
||||
nbatts = 0;
|
||||
@@ -9392,7 +9393,8 @@ reparse:
|
||||
*/
|
||||
SKIP_BLANKS;
|
||||
GROW;
|
||||
- if (ctxt->input->base != base) goto base_changed;
|
||||
+ if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
|
||||
+ goto base_changed;
|
||||
|
||||
while (((RAW != '>') &&
|
||||
((RAW != '/') || (NXT(1) != '>')) &&
|
||||
@@ -9403,7 +9405,7 @@ reparse:
|
||||
|
||||
attname = xmlParseAttribute2(ctxt, prefix, localname,
|
||||
&aprefix, &attvalue, &len, &alloc);
|
||||
- if (ctxt->input->base != base) {
|
||||
+ if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr)) {
|
||||
if ((attvalue != NULL) && (alloc != 0))
|
||||
xmlFree(attvalue);
|
||||
attvalue = NULL;
|
||||
@@ -9552,7 +9554,8 @@ skip_ns:
|
||||
break;
|
||||
}
|
||||
SKIP_BLANKS;
|
||||
- if (ctxt->input->base != base) goto base_changed;
|
||||
+ if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
|
||||
+ goto base_changed;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -9589,7 +9592,8 @@ failed:
|
||||
GROW
|
||||
if (ctxt->instate == XML_PARSER_EOF)
|
||||
break;
|
||||
- if (ctxt->input->base != base) goto base_changed;
|
||||
+ if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
|
||||
+ goto base_changed;
|
||||
if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
|
||||
break;
|
||||
if (!IS_BLANK_CH(RAW)) {
|
||||
@@ -9605,7 +9609,8 @@ failed:
|
||||
break;
|
||||
}
|
||||
GROW;
|
||||
- if (ctxt->input->base != base) goto base_changed;
|
||||
+ if ((ctxt->input->base != base) || (inputNr != ctxt->inputNr))
|
||||
+ goto base_changed;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -9772,6 +9777,17 @@ base_changed:
|
||||
if ((ctxt->attallocs[j] != 0) && (atts[i] != NULL))
|
||||
xmlFree((xmlChar *) atts[i]);
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * We can't switch from one entity to another in the middle
|
||||
+ * of a start tag
|
||||
+ */
|
||||
+ if (inputNr != ctxt->inputNr) {
|
||||
+ xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
|
||||
+ "Start tag doesn't start and stop in the same entity\n");
|
||||
+ return(NULL);
|
||||
+ }
|
||||
+
|
||||
ctxt->input->cur = ctxt->input->base + cur;
|
||||
ctxt->input->line = oldline;
|
||||
ctxt->input->col = oldcol;
|
||||
diff --git a/result/errors/754946.xml.err b/result/errors/754946.xml.err
|
||||
index 423dff5..a75088b 100644
|
||||
--- a/result/errors/754946.xml.err
|
||||
+++ b/result/errors/754946.xml.err
|
||||
@@ -11,6 +11,9 @@ Entity: line 1: parser error : DOCTYPE improperly terminated
|
||||
Entity: line 1:
|
||||
A<lbbbbbbbbbbbbbbbbbbb_
|
||||
^
|
||||
+./test/errors/754946.xml:1: parser error : Start tag doesn't start and stop in the same entity
|
||||
+>%SYSTEM;<![
|
||||
+ ^
|
||||
./test/errors/754946.xml:1: parser error : Extra content at the end of the document
|
||||
-<!DOCTYPEA[<!ENTITY %
|
||||
- ^
|
||||
+>%SYSTEM;<![
|
||||
+ ^
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From f0709e3ca8f8947f2d91ed34e92e38a4c23eae63 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Tue, 3 Nov 2015 15:31:25 +0800
|
||||
Subject: [PATCH] CVE-2015-8035 Fix XZ compression support loop
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=757466
|
||||
DoS when parsing specially crafted XML document if XZ support
|
||||
is compiled in (which wasn't the case for 2.9.2 and master since
|
||||
Nov 2013, fixed in next commit !)
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-8035
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
xzlib.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/xzlib.c b/xzlib.c
|
||||
index 0dcb9f4..1fab546 100644
|
||||
--- a/xzlib.c
|
||||
+++ b/xzlib.c
|
||||
@@ -581,6 +581,10 @@ xz_decomp(xz_statep state)
|
||||
xz_error(state, LZMA_DATA_ERROR, "compressed data error");
|
||||
return -1;
|
||||
}
|
||||
+ if (ret == LZMA_PROG_ERROR) {
|
||||
+ xz_error(state, LZMA_PROG_ERROR, "compression error");
|
||||
+ return -1;
|
||||
+ }
|
||||
} while (strm->avail_out && ret != LZMA_STREAM_END);
|
||||
|
||||
/* update available output and crc check value */
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 8fb4a770075628d6441fb17a1e435100e2f3b1a2 Mon Sep 17 00:00:00 2001
|
||||
From: Hugh Davenport <hugh@allthethings.co.nz>
|
||||
Date: Fri, 20 Nov 2015 17:16:06 +0800
|
||||
Subject: [PATCH] CVE-2015-8242 Buffer overead with HTML parser in push mode
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=756372
|
||||
Error in the code pointing to the codepoint in the stack for the
|
||||
current char value instead of the pointer in the input that the SAX
|
||||
callback expects
|
||||
Reported and fixed by Hugh Davenport
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-8242
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
HTMLparser.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/HTMLparser.c b/HTMLparser.c
|
||||
index bdf7807..b729197 100644
|
||||
--- a/HTMLparser.c
|
||||
+++ b/HTMLparser.c
|
||||
@@ -5735,17 +5735,17 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
|
||||
if (ctxt->keepBlanks) {
|
||||
if (ctxt->sax->characters != NULL)
|
||||
ctxt->sax->characters(
|
||||
- ctxt->userData, &cur, 1);
|
||||
+ ctxt->userData, &in->cur[0], 1);
|
||||
} else {
|
||||
if (ctxt->sax->ignorableWhitespace != NULL)
|
||||
ctxt->sax->ignorableWhitespace(
|
||||
- ctxt->userData, &cur, 1);
|
||||
+ ctxt->userData, &in->cur[0], 1);
|
||||
}
|
||||
} else {
|
||||
htmlCheckParagraph(ctxt);
|
||||
if (ctxt->sax->characters != NULL)
|
||||
ctxt->sax->characters(
|
||||
- ctxt->userData, &cur, 1);
|
||||
+ ctxt->userData, &in->cur[0], 1);
|
||||
}
|
||||
}
|
||||
ctxt->token = 0;
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
From 51f02b0a03ea1fa6c65b3f9fd88cf60fb5803783 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Tue, 15 Sep 2015 16:50:32 +0800
|
||||
Subject: [PATCH] Fix a bug on name parsing at the end of current input buffer
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=754946
|
||||
|
||||
When hitting the end of the current input buffer while parsing
|
||||
a name we could end up loosing the beginning of the name, which
|
||||
led to various issues.
|
||||
|
||||
Upstream-Status: backport
|
||||
|
||||
Depend patch for CVE-2015-7500
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
---
|
||||
parser.c | 29 ++++++++++++++++++++---------
|
||||
result/errors/754946.xml | 0
|
||||
result/errors/754946.xml.err | 16 ++++++++++++++++
|
||||
result/errors/754946.xml.str | 4 ++++
|
||||
test/errors/754946.xml | 1 +
|
||||
5 files changed, 41 insertions(+), 9 deletions(-)
|
||||
create mode 100644 result/errors/754946.xml
|
||||
create mode 100644 result/errors/754946.xml.err
|
||||
create mode 100644 result/errors/754946.xml.str
|
||||
create mode 100644 test/errors/754946.xml
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index 0edd53b..fd29a39 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -3491,7 +3491,14 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
|
||||
c = CUR_CHAR(l);
|
||||
if (c == 0) {
|
||||
count = 0;
|
||||
+ /*
|
||||
+ * when shrinking to extend the buffer we really need to preserve
|
||||
+ * the part of the name we already parsed. Hence rolling back
|
||||
+ * by current lenght.
|
||||
+ */
|
||||
+ ctxt->input->cur -= l;
|
||||
GROW;
|
||||
+ ctxt->input->cur += l;
|
||||
if (ctxt->instate == XML_PARSER_EOF)
|
||||
return(NULL);
|
||||
end = ctxt->input->cur;
|
||||
@@ -3523,7 +3530,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
static const xmlChar *
|
||||
xmlParseNCName(xmlParserCtxtPtr ctxt) {
|
||||
- const xmlChar *in;
|
||||
+ const xmlChar *in, *e;
|
||||
const xmlChar *ret;
|
||||
int count = 0;
|
||||
|
||||
@@ -3535,16 +3542,19 @@ xmlParseNCName(xmlParserCtxtPtr ctxt) {
|
||||
* Accelerator for simple ASCII names
|
||||
*/
|
||||
in = ctxt->input->cur;
|
||||
- if (((*in >= 0x61) && (*in <= 0x7A)) ||
|
||||
- ((*in >= 0x41) && (*in <= 0x5A)) ||
|
||||
- (*in == '_')) {
|
||||
+ e = ctxt->input->end;
|
||||
+ if ((((*in >= 0x61) && (*in <= 0x7A)) ||
|
||||
+ ((*in >= 0x41) && (*in <= 0x5A)) ||
|
||||
+ (*in == '_')) && (in < e)) {
|
||||
in++;
|
||||
- while (((*in >= 0x61) && (*in <= 0x7A)) ||
|
||||
- ((*in >= 0x41) && (*in <= 0x5A)) ||
|
||||
- ((*in >= 0x30) && (*in <= 0x39)) ||
|
||||
- (*in == '_') || (*in == '-') ||
|
||||
- (*in == '.'))
|
||||
+ while ((((*in >= 0x61) && (*in <= 0x7A)) ||
|
||||
+ ((*in >= 0x41) && (*in <= 0x5A)) ||
|
||||
+ ((*in >= 0x30) && (*in <= 0x39)) ||
|
||||
+ (*in == '_') || (*in == '-') ||
|
||||
+ (*in == '.')) && (in < e))
|
||||
in++;
|
||||
+ if (in >= e)
|
||||
+ goto complex;
|
||||
if ((*in > 0) && (*in < 0x80)) {
|
||||
count = in - ctxt->input->cur;
|
||||
if ((count > XML_MAX_NAME_LENGTH) &&
|
||||
@@ -3562,6 +3572,7 @@ xmlParseNCName(xmlParserCtxtPtr ctxt) {
|
||||
return(ret);
|
||||
}
|
||||
}
|
||||
+complex:
|
||||
return(xmlParseNCNameComplex(ctxt));
|
||||
}
|
||||
|
||||
diff --git a/result/errors/754946.xml b/result/errors/754946.xml
|
||||
new file mode 100644
|
||||
index 0000000..e69de29
|
||||
diff --git a/result/errors/754946.xml.err b/result/errors/754946.xml.err
|
||||
new file mode 100644
|
||||
index 0000000..423dff5
|
||||
--- /dev/null
|
||||
+++ b/result/errors/754946.xml.err
|
||||
@@ -0,0 +1,16 @@
|
||||
+Entity: line 1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
|
||||
+
|
||||
+ %SYSTEM;
|
||||
+ ^
|
||||
+Entity: line 1:
|
||||
+A<lbbbbbbbbbbbbbbbbbbb_
|
||||
+^
|
||||
+Entity: line 1: parser error : DOCTYPE improperly terminated
|
||||
+ %SYSTEM;
|
||||
+ ^
|
||||
+Entity: line 1:
|
||||
+A<lbbbbbbbbbbbbbbbbbbb_
|
||||
+^
|
||||
+./test/errors/754946.xml:1: parser error : Extra content at the end of the document
|
||||
+<!DOCTYPEA[<!ENTITY %
|
||||
+ ^
|
||||
diff --git a/result/errors/754946.xml.str b/result/errors/754946.xml.str
|
||||
new file mode 100644
|
||||
index 0000000..3b748cc
|
||||
--- /dev/null
|
||||
+++ b/result/errors/754946.xml.str
|
||||
@@ -0,0 +1,4 @@
|
||||
+./test/errors/754946.xml:1: parser error : Extra content at the end of the document
|
||||
+<!DOCTYPEA[<!ENTITY %
|
||||
+ ^
|
||||
+./test/errors/754946.xml : failed to parse
|
||||
diff --git a/test/errors/754946.xml b/test/errors/754946.xml
|
||||
new file mode 100644
|
||||
index 0000000..6b5f9b0
|
||||
--- /dev/null
|
||||
+++ b/test/errors/754946.xml
|
||||
@@ -0,0 +1 @@
|
||||
+<!DOCTYPEA[<!ENTITY %
|
||||
|
||||
SYSTEM "A<lbbbbbbbbbbbbbbbbbbb_"
|
||||
>%SYSTEM;<![
|
||||
\ No newline at end of file
|
||||
@@ -0,0 +1,89 @@
|
||||
From afd27c21f6b36e22682b7da20d726bce2dcb2f43 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Mon, 9 Nov 2015 18:07:18 +0800
|
||||
Subject: [PATCH] Avoid processing entities after encoding conversion failures
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=756527
|
||||
and was also raised by Chromium team in the past
|
||||
|
||||
When we hit a convwersion failure when switching encoding
|
||||
it is bestter to stop parsing there, this was treated as a
|
||||
fatal error but the parser was continuing to process to extract
|
||||
more errors, unfortunately that makes little sense as the data
|
||||
is obviously corrupt and can potentially lead to unexpected behaviour.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7498
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 7 +++++--
|
||||
parserInternals.c | 11 ++++++++++-
|
||||
2 files changed, 15 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index 134afe7..c79b4e8 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -10665,7 +10665,8 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
|
||||
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
|
||||
}
|
||||
xmlParseEncodingDecl(ctxt);
|
||||
- if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
|
||||
+ if ((ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) ||
|
||||
+ (ctxt->instate == XML_PARSER_EOF)) {
|
||||
/*
|
||||
* The XML REC instructs us to stop parsing right here
|
||||
*/
|
||||
@@ -10789,6 +10790,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
if (CUR == 0) {
|
||||
xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
|
||||
+ return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -10806,7 +10808,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
|
||||
* Note that we will switch encoding on the fly.
|
||||
*/
|
||||
xmlParseXMLDecl(ctxt);
|
||||
- if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
|
||||
+ if ((ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) ||
|
||||
+ (ctxt->instate == XML_PARSER_EOF)) {
|
||||
/*
|
||||
* The XML REC instructs us to stop parsing right here
|
||||
*/
|
||||
diff --git a/parserInternals.c b/parserInternals.c
|
||||
index df204fd..c8230c1 100644
|
||||
--- a/parserInternals.c
|
||||
+++ b/parserInternals.c
|
||||
@@ -937,6 +937,7 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
|
||||
{
|
||||
xmlCharEncodingHandlerPtr handler;
|
||||
int len = -1;
|
||||
+ int ret;
|
||||
|
||||
if (ctxt == NULL) return(-1);
|
||||
switch (enc) {
|
||||
@@ -1097,7 +1098,15 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
|
||||
if (handler == NULL)
|
||||
return(-1);
|
||||
ctxt->charset = XML_CHAR_ENCODING_UTF8;
|
||||
- return(xmlSwitchToEncodingInt(ctxt, handler, len));
|
||||
+ ret = xmlSwitchToEncodingInt(ctxt, handler, len);
|
||||
+ if ((ret < 0) || (ctxt->errNo == XML_I18N_CONV_FAILED)) {
|
||||
+ /*
|
||||
+ * on encoding conversion errors, stop the parser
|
||||
+ */
|
||||
+ xmlStopParser(ctxt);
|
||||
+ ctxt->errNo = XML_I18N_CONV_FAILED;
|
||||
+ }
|
||||
+ return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
From 28cd9cb747a94483f4aea7f0968d202c20bb4cfc Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Fri, 20 Nov 2015 14:55:30 +0800
|
||||
Subject: [PATCH] Add xmlHaltParser() to stop the parser
|
||||
|
||||
The problem is doing it in a consistent and safe fashion
|
||||
It's more complex than just setting ctxt->instate = XML_PARSER_EOF
|
||||
Update the public function to reuse that new internal routine
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7499-1
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 34 +++++++++++++++++++++++++++++-----
|
||||
1 file changed, 29 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index da6e729..b6e99b1 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -94,6 +94,8 @@ static xmlParserCtxtPtr
|
||||
xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID,
|
||||
const xmlChar *base, xmlParserCtxtPtr pctx);
|
||||
|
||||
+static void xmlHaltParser(xmlParserCtxtPtr ctxt);
|
||||
+
|
||||
/************************************************************************
|
||||
* *
|
||||
* Arbitrary limits set in the parser. See XML_PARSE_HUGE *
|
||||
@@ -12625,25 +12627,47 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
|
||||
#endif /* LIBXML_PUSH_ENABLED */
|
||||
|
||||
/**
|
||||
- * xmlStopParser:
|
||||
+ * xmlHaltParser:
|
||||
* @ctxt: an XML parser context
|
||||
*
|
||||
- * Blocks further parser processing
|
||||
+ * Blocks further parser processing don't override error
|
||||
+ * for internal use
|
||||
*/
|
||||
-void
|
||||
-xmlStopParser(xmlParserCtxtPtr ctxt) {
|
||||
+static void
|
||||
+xmlHaltParser(xmlParserCtxtPtr ctxt) {
|
||||
if (ctxt == NULL)
|
||||
return;
|
||||
ctxt->instate = XML_PARSER_EOF;
|
||||
- ctxt->errNo = XML_ERR_USER_STOP;
|
||||
ctxt->disableSAX = 1;
|
||||
if (ctxt->input != NULL) {
|
||||
+ /*
|
||||
+ * in case there was a specific allocation deallocate before
|
||||
+ * overriding base
|
||||
+ */
|
||||
+ if (ctxt->input->free != NULL) {
|
||||
+ ctxt->input->free((xmlChar *) ctxt->input->base);
|
||||
+ ctxt->input->free = NULL;
|
||||
+ }
|
||||
ctxt->input->cur = BAD_CAST"";
|
||||
ctxt->input->base = ctxt->input->cur;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
+ * xmlStopParser:
|
||||
+ * @ctxt: an XML parser context
|
||||
+ *
|
||||
+ * Blocks further parser processing
|
||||
+ */
|
||||
+void
|
||||
+xmlStopParser(xmlParserCtxtPtr ctxt) {
|
||||
+ if (ctxt == NULL)
|
||||
+ return;
|
||||
+ xmlHaltParser(ctxt);
|
||||
+ ctxt->errNo = XML_ERR_USER_STOP;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* xmlCreateIOParserCtxt:
|
||||
* @sax: a SAX handler
|
||||
* @user_data: The user data returned on SAX callbacks
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
From 35bcb1d758ed70aa7b257c9c3b3ff55e54e3d0da Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Fri, 20 Nov 2015 15:04:09 +0800
|
||||
Subject: [PATCH] Detect incoherency on GROW
|
||||
|
||||
the current pointer to the input has to be between the base and end
|
||||
if not stop everything we have an internal state error.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7499-2
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index 1810f99..ab007aa 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -2075,9 +2075,16 @@ static void xmlGROW (xmlParserCtxtPtr ctxt) {
|
||||
((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) &&
|
||||
((ctxt->options & XML_PARSE_HUGE) == 0)) {
|
||||
xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup");
|
||||
- ctxt->instate = XML_PARSER_EOF;
|
||||
+ xmlHaltParser(ctxt);
|
||||
+ return;
|
||||
}
|
||||
xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
|
||||
+ if ((ctxt->input->cur > ctxt->input->end) ||
|
||||
+ (ctxt->input->cur < ctxt->input->base)) {
|
||||
+ xmlHaltParser(ctxt);
|
||||
+ xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "cur index out of bound");
|
||||
+ return;
|
||||
+ }
|
||||
if ((ctxt->input->cur != NULL) && (*ctxt->input->cur == 0) &&
|
||||
(xmlParserInputGrow(ctxt->input, INPUT_CHUNK) <= 0))
|
||||
xmlPopInput(ctxt);
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From a7dfab7411cbf545f359dd3157e5df1eb0e7ce31 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Mon, 23 Feb 2015 11:17:35 +0800
|
||||
Subject: [PATCH] Stop parsing on entities boundaries errors
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=744980
|
||||
|
||||
There are times, like on unterminated entities that it's preferable to
|
||||
stop parsing, even if that means less error reporting. Entities are
|
||||
feeding the parser on further processing, and if they are ill defined
|
||||
then it's possible to get the parser to bug. Also do the same on
|
||||
Conditional Sections if the input is broken, as the structure of
|
||||
the document can't be guessed.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7941-1
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index a8d1b67..bbe97eb 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -5658,6 +5658,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
|
||||
if (RAW != '>') {
|
||||
xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
|
||||
"xmlParseEntityDecl: entity %s not terminated\n", name);
|
||||
+ xmlStopParser(ctxt);
|
||||
} else {
|
||||
if (input != ctxt->input) {
|
||||
xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From 9b8512337d14c8ddf662fcb98b0135f225a1c489 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Mon, 23 Feb 2015 11:29:20 +0800
|
||||
Subject: [PATCH] Cleanup conditional section error handling
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=744980
|
||||
|
||||
The error handling of Conditional Section also need to be
|
||||
straightened as the structure of the document can't be
|
||||
guessed on a failure there and it's better to stop parsing
|
||||
as further errors are likely to be irrelevant.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7941-2
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index bbe97eb..fe603ac 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -6770,6 +6770,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
|
||||
SKIP_BLANKS;
|
||||
if (RAW != '[') {
|
||||
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
|
||||
+ xmlStopParser(ctxt);
|
||||
+ return;
|
||||
} else {
|
||||
if (ctxt->input->id != id) {
|
||||
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
|
||||
@@ -6830,6 +6832,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
|
||||
SKIP_BLANKS;
|
||||
if (RAW != '[') {
|
||||
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
|
||||
+ xmlStopParser(ctxt);
|
||||
+ return;
|
||||
} else {
|
||||
if (ctxt->input->id != id) {
|
||||
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
|
||||
@@ -6885,6 +6889,8 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
} else {
|
||||
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
|
||||
+ xmlStopParser(ctxt);
|
||||
+ return;
|
||||
}
|
||||
|
||||
if (RAW == 0)
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 41ac9049a27f52e7a1f3b341f8714149fc88d450 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Tue, 27 Oct 2015 10:53:44 +0800
|
||||
Subject: [PATCH] Fix an error in previous Conditional section patch
|
||||
|
||||
an off by one mistake in the change, led to error on correct
|
||||
document where the end of the included entity was exactly
|
||||
the end of the conditional section, leading to regtest failure
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7942-2
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index b9217ff..d67b300 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -6916,7 +6916,7 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
|
||||
NULL, NULL);
|
||||
}
|
||||
if ((ctxt-> instate != XML_PARSER_EOF) &&
|
||||
- ((ctxt->input->cur + 3) < ctxt->input->end))
|
||||
+ ((ctxt->input->cur + 3) <= ctxt->input->end))
|
||||
SKIP(3);
|
||||
}
|
||||
}
|
||||
--
|
||||
2.3.5
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From bd0526e66a56e75a18da8c15c4750db8f801c52d Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Fri, 23 Oct 2015 19:02:28 +0800
|
||||
Subject: [PATCH] Another variation of overflow in Conditional sections
|
||||
|
||||
Which happen after the previous fix to
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=756456
|
||||
|
||||
But stopping the parser and exiting we didn't pop the intermediary entities
|
||||
and doing the SKIP there applies on an input which may be too small
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-7942
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index a65e4cc..b9217ff 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -6915,7 +6915,9 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
|
||||
"All markup of the conditional section is not in the same entity\n",
|
||||
NULL, NULL);
|
||||
}
|
||||
- SKIP(3);
|
||||
+ if ((ctxt-> instate != XML_PARSER_EOF) &&
|
||||
+ ((ctxt->input->cur + 3) < ctxt->input->end))
|
||||
+ SKIP(3);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.3.5
|
||||
|
||||
40
meta/recipes-core/libxml/libxml2/CVE-2015-8241.patch
Normal file
40
meta/recipes-core/libxml/libxml2/CVE-2015-8241.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From ab2b9a93ff19cedde7befbf2fcc48c6e352b6cbe Mon Sep 17 00:00:00 2001
|
||||
From: Hugh Davenport <hugh@allthethings.co.nz>
|
||||
Date: Tue, 3 Nov 2015 20:40:49 +0800
|
||||
Subject: [PATCH] Avoid extra processing of MarkupDecl when EOF
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=756263
|
||||
|
||||
One place where ctxt->instate == XML_PARSER_EOF whic was set up
|
||||
by entity detection issues doesn't get noticed, and even overrided
|
||||
|
||||
Upstream-status: Backport
|
||||
|
||||
https://git.gnome.org/browse/libxml2/commit/?id=ab2b9a93ff19cedde7befbf2fcc48c6e352b6cbe
|
||||
|
||||
CVE: CVE-2015-8241
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
Index: libxml2-2.9.2/parser.c
|
||||
===================================================================
|
||||
--- libxml2-2.9.2.orig/parser.c
|
||||
+++ libxml2-2.9.2/parser.c
|
||||
@@ -6999,6 +6999,14 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt
|
||||
xmlParsePI(ctxt);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * detect requirement to exit there and act accordingly
|
||||
+ * and avoid having instate overriden later on
|
||||
+ */
|
||||
+ if (ctxt->instate == XML_PARSER_EOF)
|
||||
+ return;
|
||||
+
|
||||
/*
|
||||
* This is only for internal subset. On external entities,
|
||||
* the replacement is done before parsing stage
|
||||
@@ -0,0 +1,42 @@
|
||||
From 709a952110e98621c9b78c4f26462a9d8333102e Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Mon, 29 Jun 2015 16:10:26 +0800
|
||||
Subject: [PATCH] Fail parsing early on if encoding conversion failed
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=751631
|
||||
|
||||
If we fail conversing the current input stream while
|
||||
processing the encoding declaration of the XMLDecl
|
||||
then it's safer to just abort there and not try to
|
||||
report further errors.
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
CVE-2015-8317
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
parser.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/parser.c b/parser.c
|
||||
index a3a9568..0edd53b 100644
|
||||
--- a/parser.c
|
||||
+++ b/parser.c
|
||||
@@ -10471,7 +10471,11 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
|
||||
|
||||
handler = xmlFindCharEncodingHandler((const char *) encoding);
|
||||
if (handler != NULL) {
|
||||
- xmlSwitchToEncoding(ctxt, handler);
|
||||
+ if (xmlSwitchToEncoding(ctxt, handler) < 0) {
|
||||
+ /* failed to convert */
|
||||
+ ctxt->errNo = XML_ERR_UNSUPPORTED_ENCODING;
|
||||
+ return(NULL);
|
||||
+ }
|
||||
} else {
|
||||
xmlFatalErrMsgStr(ctxt, XML_ERR_UNSUPPORTED_ENCODING,
|
||||
"Unsupported encoding %s\n", encoding);
|
||||
--
|
||||
2.3.5
|
||||
|
||||
71
meta/recipes-core/libxml/libxml2/CVE-2015-8710.patch
Normal file
71
meta/recipes-core/libxml/libxml2/CVE-2015-8710.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
From e724879d964d774df9b7969fc846605aa1bac54c Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Veillard <veillard@redhat.com>
|
||||
Date: Fri, 30 Oct 2015 21:14:55 +0800
|
||||
Subject: [PATCH] Fix parsing short unclosed comment uninitialized access
|
||||
|
||||
For https://bugzilla.gnome.org/show_bug.cgi?id=746048
|
||||
The HTML parser was too optimistic when processing comments and
|
||||
didn't check for the end of the stream on the first 2 characters
|
||||
|
||||
Upstream-Status: Backport
|
||||
|
||||
https://git.gnome.org/browse/libxml2/commit/?id=e724879d964d774df9b7969fc846605aa1bac54c
|
||||
|
||||
CVE: CVE-2015-8710
|
||||
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
HTMLparser.c | 21 ++++++++++++++-------
|
||||
1 file changed, 14 insertions(+), 7 deletions(-)
|
||||
|
||||
Index: libxml2-2.9.2/HTMLparser.c
|
||||
===================================================================
|
||||
--- libxml2-2.9.2.orig/HTMLparser.c
|
||||
+++ libxml2-2.9.2/HTMLparser.c
|
||||
@@ -3245,12 +3245,17 @@ htmlParseComment(htmlParserCtxtPtr ctxt)
|
||||
ctxt->instate = state;
|
||||
return;
|
||||
}
|
||||
+ len = 0;
|
||||
+ buf[len] = 0;
|
||||
q = CUR_CHAR(ql);
|
||||
+ if (!IS_CHAR(q))
|
||||
+ goto unfinished;
|
||||
NEXTL(ql);
|
||||
r = CUR_CHAR(rl);
|
||||
+ if (!IS_CHAR(r))
|
||||
+ goto unfinished;
|
||||
NEXTL(rl);
|
||||
cur = CUR_CHAR(l);
|
||||
- len = 0;
|
||||
while (IS_CHAR(cur) &&
|
||||
((cur != '>') ||
|
||||
(r != '-') || (q != '-'))) {
|
||||
@@ -3281,18 +3286,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt)
|
||||
}
|
||||
}
|
||||
buf[len] = 0;
|
||||
- if (!IS_CHAR(cur)) {
|
||||
- htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
|
||||
- "Comment not terminated \n<!--%.50s\n", buf, NULL);
|
||||
- xmlFree(buf);
|
||||
- } else {
|
||||
+ if (IS_CHAR(cur)) {
|
||||
NEXT;
|
||||
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
|
||||
(!ctxt->disableSAX))
|
||||
ctxt->sax->comment(ctxt->userData, buf);
|
||||
xmlFree(buf);
|
||||
+ ctxt->instate = state;
|
||||
+ return;
|
||||
}
|
||||
- ctxt->instate = state;
|
||||
+
|
||||
+unfinished:
|
||||
+ htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
|
||||
+ "Comment not terminated \n<!--%.50s\n", buf, NULL);
|
||||
+ xmlFree(buf);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2,10 +2,17 @@ SUMMARY = "Dummy package which ensures perl is excluded from buildtools"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||
|
||||
inherit nativesdk
|
||||
inherit allarch
|
||||
|
||||
# Put it somewhere separate to ensure it's never used except when we want it
|
||||
PACKAGE_ARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
|
||||
PR = "r1"
|
||||
|
||||
python() {
|
||||
# Put the package somewhere separate to ensure it's never used except
|
||||
# when we want it
|
||||
# (note that we have to do this in anonymous python here to avoid
|
||||
# allarch.bbclass disabling itself)
|
||||
d.setVar('PACKAGE_ARCH', 'buildtools-dummy-${SDKPKGSUFFIX}')
|
||||
}
|
||||
|
||||
PERLPACKAGES = "nativesdk-perl \
|
||||
nativesdk-perl-module-file-path"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require readline.inc
|
||||
|
||||
SRC_URI += "file://readline63-003.patch;striplevel=0 \
|
||||
SRC_URI += "file://readline-cve-2014-2524.patch;striplevel=0 \
|
||||
file://readline-dispatch-multikey.patch"
|
||||
|
||||
SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a"
|
||||
|
||||
@@ -19,5 +19,7 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=master \
|
||||
file://0001-gcc5-optimizes-away-the-write-only-static-functions-.patch \
|
||||
file://0001-fcntl-Add-AT_EMPTY_PATH-for-all-and-O_PATH-for-arm.patch \
|
||||
file://0001-wire-in-syncfs.patch \
|
||||
file://CVE-2016-2224.patch \
|
||||
file://CVE-2016-2225.patch \
|
||||
"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
49
meta/recipes-core/uclibc/uclibc-git/CVE-2016-2224.patch
Normal file
49
meta/recipes-core/uclibc/uclibc-git/CVE-2016-2224.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 16719c1a7078421928e6d31dd1dec574825ef515 Mon Sep 17 00:00:00 2001
|
||||
From: Waldemar Brodkorb <wbx@openadk.org>
|
||||
Date: Sun, 17 Jan 2016 15:47:22 +0100
|
||||
Subject: [PATCH] Do not follow compressed items forever.
|
||||
|
||||
It is possible to get stuck in an infinite loop when receiving a
|
||||
specially crafted DNS reply. Exit the loop after a number of iteration
|
||||
and consider the packet invalid.
|
||||
|
||||
Signed-off-by: Daniel Fahlgren <daniel@fahlgren.se>
|
||||
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
||||
|
||||
Upstream-status: Backport
|
||||
http://repo.or.cz/uclibc-ng.git/commit/16719c1a7078421928e6d31dd1dec574825ef515
|
||||
|
||||
CVE: CVE-2016-2224
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
libc/inet/resolv.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: git/libc/inet/resolv.c
|
||||
===================================================================
|
||||
--- git.orig/libc/inet/resolv.c
|
||||
+++ git/libc/inet/resolv.c
|
||||
@@ -666,11 +666,12 @@ int __decode_dotted(const unsigned char
|
||||
bool measure = 1;
|
||||
unsigned total = 0;
|
||||
unsigned used = 0;
|
||||
+ unsigned maxiter = 256;
|
||||
|
||||
if (!packet)
|
||||
return -1;
|
||||
|
||||
- while (1) {
|
||||
+ while (--maxiter) {
|
||||
if (offset >= packet_len)
|
||||
return -1;
|
||||
b = packet[offset++];
|
||||
@@ -707,6 +708,8 @@ int __decode_dotted(const unsigned char
|
||||
else
|
||||
dest[used++] = '\0';
|
||||
}
|
||||
+ if (!maxiter)
|
||||
+ return -1;
|
||||
|
||||
/* The null byte must be counted too */
|
||||
if (measure)
|
||||
32
meta/recipes-core/uclibc/uclibc-git/CVE-2016-2225.patch
Normal file
32
meta/recipes-core/uclibc/uclibc-git/CVE-2016-2225.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From bb01edff0377f2585ce304ecbadcb7b6cde372ac Mon Sep 17 00:00:00 2001
|
||||
From: Waldemar Brodkorb <wbx@openadk.org>
|
||||
Date: Mon, 25 Jan 2016 21:11:34 +0100
|
||||
Subject: [PATCH] Make sure to always terminate decoded string
|
||||
|
||||
Write a terminating '\0' to dest when the first byte of the encoded data
|
||||
is 0. This corner case was previously missed.
|
||||
|
||||
Signed-off-by: Daniel Fahlgren <daniel@fahlgren.se>
|
||||
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
||||
|
||||
Upstream-Status: Backport
|
||||
http://repo.or.cz/uclibc-ng.git/commit/bb01edff0377f2585ce304ecbadcb7b6cde372ac
|
||||
CVE: CVE-2016-2225
|
||||
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||
|
||||
---
|
||||
libc/inet/resolv.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
Index: git/libc/inet/resolv.c
|
||||
===================================================================
|
||||
--- git.orig/libc/inet/resolv.c
|
||||
+++ git/libc/inet/resolv.c
|
||||
@@ -671,6 +671,7 @@ int __decode_dotted(const unsigned char
|
||||
if (!packet)
|
||||
return -1;
|
||||
|
||||
+ dest[0] = '\0';
|
||||
while (--maxiter) {
|
||||
if (offset >= packet_len)
|
||||
return -1;
|
||||
@@ -182,6 +182,8 @@ UCLIBC_HAS_FLOATS=y
|
||||
|
||||
# COMPILE_IN_THUMB_MODE is not set
|
||||
|
||||
# needed by shadow
|
||||
UCLIBC_HAS_UTMP=y
|
||||
# needed by systemd
|
||||
UCLIBC_HAS_UTMPX=y
|
||||
UCLIBC_LINUX_MODULE_26=y
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user