mirror of
https://git.yoctoproject.org/poky
synced 2026-09-12 15:49:36 +02:00
Compare commits
270 Commits
yocto-5.0.
...
yocto-2.0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dade0e68c6 | ||
|
|
a325db9bc8 | ||
|
|
c940dd928f | ||
|
|
65306b0bfc | ||
|
|
f117786f24 | ||
|
|
6f8a7089b3 | ||
|
|
1945133a22 | ||
|
|
e3bf77e381 | ||
|
|
44585dd62a | ||
|
|
a4ee99f27a | ||
|
|
16d64def97 | ||
|
|
a31931e290 | ||
|
|
da75750122 | ||
|
|
ae691815c8 | ||
|
|
ba15486e27 | ||
|
|
2ef5feeb3d | ||
|
|
a201edefae | ||
|
|
00b016b010 | ||
|
|
877a6b3ef4 | ||
|
|
ed3fc1ab85 | ||
|
|
dafc9d7755 | ||
|
|
49ce0e7d4a | ||
|
|
6b2102cd59 | ||
|
|
504e742a5e | ||
|
|
6b9d2edd7d | ||
|
|
ed3115be57 | ||
|
|
c6864efbc0 | ||
|
|
328bd419be | ||
|
|
6dba9abd43 | ||
|
|
be42a1d4fd | ||
|
|
6d06b104ce | ||
|
|
5f5e9c4629 | ||
|
|
bb5e264604 | ||
|
|
2d452b19d6 | ||
|
|
f87869c6d6 | ||
|
|
a820a2073b | ||
|
|
bdd03ee432 | ||
|
|
87f7f062df | ||
|
|
16cb70663f | ||
|
|
3f54d40e23 | ||
|
|
909cf62394 | ||
|
|
e86f3240e6 | ||
|
|
2aeac77235 | ||
|
|
9e5370d2e6 | ||
|
|
07682c1bfb | ||
|
|
09e3b84ea5 | ||
|
|
4fe84e836d | ||
|
|
a9e1361611 | ||
|
|
3b223f75ee | ||
|
|
42ce9b8751 | ||
|
|
45a2977b83 | ||
|
|
c8e5c38b8a | ||
|
|
4823395a7d | ||
|
|
4a4fde53bd | ||
|
|
f8dd7e105a | ||
|
|
269c2bd717 | ||
|
|
1a51bb69b7 | ||
|
|
c484129d7b | ||
|
|
5f27b611cd | ||
|
|
6e32be7c7b | ||
|
|
d6fed74776 | ||
|
|
6e8edf0e0f | ||
|
|
87ba508688 | ||
|
|
9991263ffe | ||
|
|
b15baaee6f | ||
|
|
1a52eceaa5 | ||
|
|
6d601592e1 | ||
|
|
75c088f2e2 | ||
|
|
41265570c6 | ||
|
|
5ca77b2fc6 | ||
|
|
a4398c7ff7 | ||
|
|
05c31507da | ||
|
|
6945a4fdde | ||
|
|
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)
|
origud.method.download(origud, ld)
|
||||||
if hasattr(origud.method,"build_mirror_data"):
|
if hasattr(origud.method,"build_mirror_data"):
|
||||||
origud.method.build_mirror_data(origud, ld)
|
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
|
# Otherwise the result is a local file:// and we symlink to it
|
||||||
if not os.path.exists(origud.localpath):
|
if not os.path.exists(origud.localpath):
|
||||||
if os.path.islink(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)
|
(updated, newlines) = bb.utils.edit_metadata(self._origfile.splitlines(True), varlist, handle_var)
|
||||||
self.assertTrue(updated, 'List should be updated but isn\'t')
|
self.assertTrue(updated, 'List should be updated but isn\'t')
|
||||||
self.assertEqual(newlines, newfile5.splitlines(True))
|
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 not skip:
|
||||||
if checkspc:
|
if checkspc:
|
||||||
checkspc = False
|
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
|
# Squash blank line if there are two consecutive blanks after a removal
|
||||||
continue
|
continue
|
||||||
newlines.append(line)
|
newlines.append(line)
|
||||||
@@ -1201,7 +1201,19 @@ def edit_metadata_file(meta_file, variables, varfunc):
|
|||||||
|
|
||||||
|
|
||||||
def edit_bblayers_conf(bblayers_conf, add, remove):
|
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
|
import fnmatch
|
||||||
|
|
||||||
@@ -1210,6 +1222,13 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
|
|||||||
pth = pth[:-1]
|
pth = pth[:-1]
|
||||||
return pth
|
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):
|
def layerlist_param(value):
|
||||||
if not value:
|
if not value:
|
||||||
return []
|
return []
|
||||||
@@ -1218,49 +1237,80 @@ def edit_bblayers_conf(bblayers_conf, add, remove):
|
|||||||
else:
|
else:
|
||||||
return [remove_trailing_sep(value)]
|
return [remove_trailing_sep(value)]
|
||||||
|
|
||||||
notadded = []
|
|
||||||
notremoved = []
|
|
||||||
|
|
||||||
addlayers = layerlist_param(add)
|
addlayers = layerlist_param(add)
|
||||||
removelayers = layerlist_param(remove)
|
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
|
# Need to use a list here because we can't set non-local variables from a callback in python 2.x
|
||||||
bblayercalls = []
|
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):
|
def handle_bblayers(varname, origvalue, op, newlines):
|
||||||
bblayercalls.append(varname)
|
|
||||||
updated = False
|
updated = False
|
||||||
bblayers = [remove_trailing_sep(x) for x in origvalue.split()]
|
bblayers = [remove_trailing_sep(x) for x in origvalue.split()]
|
||||||
if removelayers:
|
if removelayers:
|
||||||
for removelayer in removelayers:
|
for removelayer in removelayers:
|
||||||
matched = False
|
|
||||||
for layer in bblayers:
|
for layer in bblayers:
|
||||||
if fnmatch.fnmatch(layer, removelayer):
|
if fnmatch.fnmatch(canonicalise_path(layer), canonicalise_path(removelayer)):
|
||||||
updated = True
|
updated = True
|
||||||
matched = True
|
|
||||||
bblayers.remove(layer)
|
bblayers.remove(layer)
|
||||||
|
removed.append(removelayer)
|
||||||
break
|
break
|
||||||
if not matched:
|
if addlayers and not plusequals:
|
||||||
notremoved.append(removelayer)
|
|
||||||
if addlayers:
|
|
||||||
for addlayer in addlayers:
|
for addlayer in addlayers:
|
||||||
if addlayer not in bblayers:
|
if addlayer not in bblayers:
|
||||||
updated = True
|
updated = True
|
||||||
bblayers.append(addlayer)
|
bblayers.append(addlayer)
|
||||||
else:
|
|
||||||
notadded.append(addlayer)
|
|
||||||
del addlayers[:]
|
del addlayers[:]
|
||||||
|
|
||||||
if updated:
|
if updated:
|
||||||
|
if op == '+=' and not bblayers:
|
||||||
|
bblayers = None
|
||||||
return (bblayers, None, 2, False)
|
return (bblayers, None, 2, False)
|
||||||
else:
|
else:
|
||||||
return (origvalue, None, 2, False)
|
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:
|
if not bblayercalls:
|
||||||
raise Exception('Unable to find BBLAYERS in %s' % bblayers_conf)
|
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)
|
return (notadded, notremoved)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdExcep
|
|||||||
from bldcontrol.models import BuildRequest, BuildEnvironment, BRError, BRVariable
|
from bldcontrol.models import BuildRequest, BuildEnvironment, BRError, BRVariable
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
import time
|
||||||
|
|
||||||
logger = logging.getLogger("ToasterScheduler")
|
logger = logging.getLogger("ToasterScheduler")
|
||||||
|
|
||||||
@@ -128,6 +129,12 @@ class Command(NoArgsCommand):
|
|||||||
|
|
||||||
|
|
||||||
def handle_noargs(self, **options):
|
def handle_noargs(self, **options):
|
||||||
self.cleanup()
|
while True:
|
||||||
self.archive()
|
try:
|
||||||
self.schedule()
|
self.cleanup()
|
||||||
|
self.archive()
|
||||||
|
self.schedule()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
|
|||||||
@@ -91,6 +91,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
@@ -103,6 +103,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
@@ -113,7 +118,7 @@
|
|||||||
<legalnotice>
|
<legalnotice>
|
||||||
<para>
|
<para>
|
||||||
Permission is granted to copy, distribute and/or modify this document under
|
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>
|
</para>
|
||||||
<note>
|
<note>
|
||||||
For the latest version of this manual associated with this
|
For the latest version of this manual associated with this
|
||||||
|
|||||||
@@ -4558,9 +4558,17 @@
|
|||||||
option or the equivalent rootfs derived from the
|
option or the equivalent rootfs derived from the
|
||||||
<filename>-e</filename> command-line
|
<filename>-e</filename> command-line
|
||||||
option.
|
option.
|
||||||
Exactly what those contents and
|
Exactly what those contents and filesystem type end
|
||||||
filesystem type end up being are dependent
|
up being are dependent on the given plugin
|
||||||
on the given plugin implementation.
|
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>
|
</para></listitem>
|
||||||
<listitem><para><emphasis><filename>--ondisk</filename> or <filename>--ondrive</filename>:</emphasis>
|
<listitem><para><emphasis><filename>--ondisk</filename> or <filename>--ondrive</filename>:</emphasis>
|
||||||
Forces the partition to be created on a particular
|
Forces the partition to be created on a particular
|
||||||
@@ -4604,6 +4612,49 @@
|
|||||||
This option is a <filename>wic</filename>-specific
|
This option is a <filename>wic</filename>-specific
|
||||||
option that says to start a partition on an
|
option that says to start a partition on an
|
||||||
x KBytes boundary.</para></listitem>
|
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>
|
</itemizedlist>
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
@@ -9890,6 +9941,28 @@
|
|||||||
Adding these statements to the configuration file ensures
|
Adding these statements to the configuration file ensures
|
||||||
that the licenses collected during package generation
|
that the licenses collected during package generation
|
||||||
are included on your image.
|
are included on your image.
|
||||||
|
<note>
|
||||||
|
<para>Setting all three variables to "1" results in the
|
||||||
|
image having two copies of the same license file.
|
||||||
|
One copy resides in
|
||||||
|
<filename>/usr/share/common-licenses</filename> and
|
||||||
|
the other resides in
|
||||||
|
<filename>/usr/share/license</filename>.</para>
|
||||||
|
|
||||||
|
<para>The reason for this behavior is because
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></ulink>
|
||||||
|
and
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></ulink>
|
||||||
|
add a copy of the license when the image is built but do not
|
||||||
|
offer a path for adding licenses for newly installed packages
|
||||||
|
to an image.
|
||||||
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></ulink>
|
||||||
|
adds a separate package and an upgrade path for adding
|
||||||
|
licenses to an image.</para>
|
||||||
|
</note>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
As the source archiver has already archived the original
|
As the source archiver has already archived the original
|
||||||
unmodified source that contains the license files,
|
unmodified source that contains the license files,
|
||||||
you would have already met the requirements for inclusion
|
you would have already met the requirements for inclusion
|
||||||
|
|||||||
@@ -197,28 +197,40 @@
|
|||||||
but also is not as easy to use or comprehensive
|
but also is not as easy to use or comprehensive
|
||||||
as the default.
|
as the default.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para><filename>kvm</filename>:
|
<listitem><para id='kvm-cond'><filename>kvm</filename>:
|
||||||
Enables KVM when running "qemux86" or "qemux86-64"
|
Enables KVM when running "qemux86" or "qemux86-64"
|
||||||
QEMU architectures.
|
QEMU architectures.
|
||||||
For KVM to work, all the following conditions must be met:
|
For KVM to work, all the following conditions must be met:
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Your <replaceable>MACHINE</replaceable> must be either
|
Your <replaceable>MACHINE</replaceable> must be either
|
||||||
"qemux86" or "qemux86-64".
|
qemux86" or "qemux86-64".
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Your build host has to have the KVM modules
|
Your build host has to have the KVM modules
|
||||||
installed, which are
|
installed, which are
|
||||||
<filename>/dev/kvm</filename>.
|
<filename>/dev/kvm</filename>.
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para>
|
|
||||||
Your build host has to have virtio net device, which
|
|
||||||
are <filename>/dev/vhost-net</filename>.
|
|
||||||
</para></listitem>
|
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
The build host <filename>/dev/kvm</filename>
|
The build host <filename>/dev/kvm</filename>
|
||||||
directory has to be both writable and readable.
|
directory has to be both writable and readable.
|
||||||
</para></listitem>
|
</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>
|
<listitem><para>
|
||||||
The build host <filename>/dev/vhost-net</filename>
|
The build host <filename>/dev/vhost-net</filename>
|
||||||
directory has to be either readable or writable
|
directory has to be either readable or writable
|
||||||
|
|||||||
@@ -81,6 +81,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
@@ -66,6 +66,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
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 |
@@ -50,6 +50,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<!ENTITY DISTRO "2.0">
|
<!ENTITY DISTRO "2.0.1">
|
||||||
<!ENTITY DISTRO_COMPRESSED "20">
|
<!ENTITY DISTRO_COMPRESSED "201">
|
||||||
<!ENTITY DISTRO_NAME "jethro">
|
<!ENTITY DISTRO_NAME "jethro">
|
||||||
<!ENTITY YOCTO_DOC_VERSION "2.0">
|
<!ENTITY YOCTO_DOC_VERSION "2.0.1">
|
||||||
<!ENTITY POKYVERSION "15.0.0">
|
<!ENTITY POKYVERSION "14.0.1">
|
||||||
<!ENTITY POKYVERSION_COMPRESSED "1400">
|
<!ENTITY POKYVERSION_COMPRESSED "1401">
|
||||||
|
<!ENTITY DISTRO_NAME_NO_CAP "jethro">
|
||||||
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
|
<!ENTITY YOCTO_POKY "poky-&DISTRO_NAME;-&POKYVERSION;">
|
||||||
<!ENTITY COPYRIGHT_YEAR "2010-2015">
|
<!ENTITY COPYRIGHT_YEAR "2010-2016">
|
||||||
<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
|
<!ENTITY YOCTO_DL_URL "http://downloads.yoctoproject.org">
|
||||||
<!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
|
<!ENTITY YOCTO_HOME_URL "http://www.yoctoproject.org">
|
||||||
<!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
|
<!ENTITY YOCTO_LISTS_URL "http://lists.yoctoproject.org">
|
||||||
@@ -67,4 +68,5 @@
|
|||||||
<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
|
<!ENTITY OPENSUSE_HOST_PACKAGES_ESSENTIAL "python gcc gcc-c++ git chrpath make wget python-xml \
|
||||||
diffstat makeinfo python-curses patch socat">
|
diffstat makeinfo python-curses patch socat">
|
||||||
<!ENTITY CENTOS_HOST_PACKAGES_ESSENTIAL "gawk make wget tar bzip2 gzip python unzip perl patch \
|
<!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">
|
||||||
|
|||||||
@@ -66,6 +66,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
@@ -254,9 +254,24 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
When you launch your build with the
|
When you launch your build with the
|
||||||
<filename>bitbake <replaceable>target</replaceable></filename> command, BitBake
|
<filename>bitbake <replaceable>target</replaceable></filename>
|
||||||
sorts out the configurations to ultimately define your build
|
command, BitBake sorts out the configurations to ultimately
|
||||||
environment.
|
define your build environment.
|
||||||
|
It is important to understand that the OpenEmbedded build system
|
||||||
|
reads the configuration files in a specific order:
|
||||||
|
<filename>site.conf</filename>, <filename>auto.conf</filename>,
|
||||||
|
and <filename>local.conf</filename>.
|
||||||
|
And, the build system applies the normal assignment statement
|
||||||
|
rules.
|
||||||
|
Because the files are parsed in a specific order, variable
|
||||||
|
assignments for the same variable could be affected.
|
||||||
|
For example, if the <filename>auto.conf</filename> file and
|
||||||
|
the <filename>local.conf</filename> set
|
||||||
|
<replaceable>variable1</replaceable> to different values, because
|
||||||
|
the build system parses <filename>local.conf</filename> after
|
||||||
|
<filename>auto.conf</filename>,
|
||||||
|
<replaceable>variable1</replaceable> is assigned the value from
|
||||||
|
the <filename>local.conf</filename> file.
|
||||||
</para>
|
</para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@@ -154,11 +154,14 @@
|
|||||||
<listitem><para>Ubuntu 13.10</para></listitem> -->
|
<listitem><para>Ubuntu 13.10</para></listitem> -->
|
||||||
<listitem><para>Ubuntu 14.04 (LTS)</para></listitem>
|
<listitem><para>Ubuntu 14.04 (LTS)</para></listitem>
|
||||||
<listitem><para>Ubuntu 14.10</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 16 (Verne)</para></listitem>
|
||||||
<listitem><para>Fedora 17 (Spherical)</para></listitem>
|
<listitem><para>Fedora 17 (Spherical)</para></listitem>
|
||||||
<listitem><para>Fedora release 19 (Schrödinger's Cat)</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 20 (Heisenbug)</para></listitem> -->
|
||||||
<listitem><para>Fedora release 21</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.6 (Final)</para></listitem>
|
||||||
<listitem><para>CentOS release 5.7 (Final)</para></listitem>
|
<listitem><para>CentOS release 5.7 (Final)</para></listitem>
|
||||||
<listitem><para>CentOS release 5.8 (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
|
support or if you are going to use the Eclipse
|
||||||
IDE:
|
IDE:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo dnf install SDL-devel xterm perl-Thread-Queue
|
$ sudo dnf install SDL-devel xterm
|
||||||
</literallayout></para></listitem>
|
</literallayout></para></listitem>
|
||||||
<listitem><para><emphasis>Documentation:</emphasis>
|
<listitem><para><emphasis>Documentation:</emphasis>
|
||||||
Packages needed if you are going to build out the
|
Packages needed if you are going to build out the
|
||||||
@@ -356,14 +359,14 @@
|
|||||||
The following list shows the required packages by function
|
The following list shows the required packages by function
|
||||||
given a supported CentOS Linux distribution:
|
given a supported CentOS Linux distribution:
|
||||||
<note>
|
<note>
|
||||||
For CentOS 6.x, some of the versions of the components
|
For CentOS 6.x, some of the versions
|
||||||
provided by the distribution are too old (e.g. Git, Python,
|
of the components provided by the distribution are
|
||||||
and tar).
|
too old (e.g. Git, Python, and tar).
|
||||||
It is recommended that you install the buildtools in order
|
It is recommended that you install the buildtools
|
||||||
to provide versions that will work with the OpenEmbedded
|
in order to provide versions that will work with
|
||||||
build system.
|
the OpenEmbedded build system.
|
||||||
For information on how to install the buildtools tarball,
|
For information on how to install the buildtools
|
||||||
see the
|
tarball, see the
|
||||||
"<link linkend='required-git-tar-and-python-versions'>Required Git, Tar, and Python Versions</link>"
|
"<link linkend='required-git-tar-and-python-versions'>Required Git, Tar, and Python Versions</link>"
|
||||||
section.
|
section.
|
||||||
</note>
|
</note>
|
||||||
@@ -372,33 +375,42 @@
|
|||||||
Packages needed to build an image for a headless
|
Packages needed to build an image for a headless
|
||||||
system:
|
system:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo dnf install &CENTOS_HOST_PACKAGES_ESSENTIAL;
|
$ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL;
|
||||||
</literallayout></para></listitem>
|
</literallayout></para></listitem>
|
||||||
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
<listitem><para><emphasis>Graphical and Eclipse Plug-In Extras:</emphasis>
|
||||||
Packages recommended if the host system has graphics
|
Packages recommended if the host system has graphics
|
||||||
support or if you are going to use the Eclipse
|
support or if you are going to use the Eclipse
|
||||||
IDE:
|
IDE:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo dnf install SDL-devel xterm
|
$ sudo yum install SDL-devel xterm
|
||||||
</literallayout></para></listitem>
|
</literallayout></para></listitem>
|
||||||
<listitem><para><emphasis>Documentation:</emphasis>
|
<listitem><para><emphasis>Documentation:</emphasis>
|
||||||
Packages needed if you are going to build out the
|
Packages needed if you are going to build out the
|
||||||
Yocto Project documentation manuals:
|
Yocto Project documentation manuals:
|
||||||
<literallayout class='monospaced'>
|
<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
|
docbook-dtds docbook-utils fop libxslt dblatex xmlto xsltproc
|
||||||
</literallayout></para></listitem>
|
</literallayout></para></listitem>
|
||||||
<listitem><para><emphasis>ADT Installer Extras:</emphasis>
|
<listitem><para><emphasis>ADT Installer Extras:</emphasis>
|
||||||
Packages needed if you are going to be using the
|
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>:
|
<ulink url='&YOCTO_DOCS_ADT_URL;#using-the-adt-installer'>Application Development Toolkit (ADT) Installer</ulink>:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo dnf install autoconf automake libtool glib2-devel libarchive-devel
|
$ sudo yum install autoconf automake libtool glib2-devel libarchive-devel
|
||||||
</literallayout></para></listitem>
|
</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 newer) packages, in that order.
|
||||||
|
</note>
|
||||||
|
</para></listitem>
|
||||||
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
<listitem><para><emphasis>OpenEmbedded Self-Test (<filename>oe-selftest</filename>):</emphasis>
|
||||||
Packages needed if you are going to run
|
Packages needed if you are going to run
|
||||||
<filename>oe-selftest</filename>:
|
<filename>oe-selftest</filename>:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo dnf install GitPython
|
$ sudo yum install GitPython
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
|||||||
@@ -2343,8 +2343,10 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For further details, please see
|
For further details, see
|
||||||
<ulink url='https://gcc.gnu.org/gcc-5/changes.html'></ulink>.
|
<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>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
|||||||
@@ -3225,10 +3225,10 @@
|
|||||||
<title><filename>staging.bbclass</filename></title>
|
<title><filename>staging.bbclass</filename></title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <filename>staging</filename> class provides support for staging
|
The <filename>staging</filename> class provides the
|
||||||
files into the sysroot during the
|
|
||||||
<link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
|
<link linkend='ref-tasks-populate_sysroot'><filename>do_populate_sysroot</filename></link>
|
||||||
task.
|
task, which stages files into the sysroot to make them available to
|
||||||
|
other recipes at build time.
|
||||||
The class is enabled by default because it is inherited by the
|
The class is enabled by default because it is inherited by the
|
||||||
<link linkend='ref-classes-base'><filename>base</filename></link>
|
<link linkend='ref-classes-base'><filename>base</filename></link>
|
||||||
class.
|
class.
|
||||||
|
|||||||
@@ -97,6 +97,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
@@ -2354,7 +2354,20 @@
|
|||||||
<filename>/usr/share/common-licenses</filename>,
|
<filename>/usr/share/common-licenses</filename>,
|
||||||
for each package.
|
for each package.
|
||||||
The license files are placed
|
The license files are placed
|
||||||
in directories within the image itself.
|
in directories within the image itself during build time.
|
||||||
|
<note>
|
||||||
|
The <filename>COPY_LIC_DIRS</filename> does not
|
||||||
|
offer a path for adding licenses for newly installed
|
||||||
|
packages to an image, which might be most suitable
|
||||||
|
for read-only filesystems that cannot be upgraded.
|
||||||
|
See the
|
||||||
|
<link linkend='var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></link>
|
||||||
|
variable for additional information.
|
||||||
|
You can also reference the
|
||||||
|
"<ulink url='&YOCTO_DOCS_DEV_URL;#providing-license-text'>Providing License Text</ulink>"
|
||||||
|
section in the Yocto Project Development Manual for
|
||||||
|
information on providing license text.
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
@@ -2369,7 +2382,20 @@
|
|||||||
If set to "1", the OpenEmbedded build system copies
|
If set to "1", the OpenEmbedded build system copies
|
||||||
the license manifest for the image to
|
the license manifest for the image to
|
||||||
<filename>/usr/share/common-licenses/license.manifest</filename>
|
<filename>/usr/share/common-licenses/license.manifest</filename>
|
||||||
within the image itself.
|
within the image itself during build time.
|
||||||
|
<note>
|
||||||
|
The <filename>COPY_LIC_MANIFEST</filename> does not
|
||||||
|
offer a path for adding licenses for newly installed
|
||||||
|
packages to an image, which might be most suitable
|
||||||
|
for read-only filesystems that cannot be upgraded.
|
||||||
|
See the
|
||||||
|
<link linkend='var-LICENSE_CREATE_PACKAGE'><filename>LICENSE_CREATE_PACKAGE</filename></link>
|
||||||
|
variable for additional information.
|
||||||
|
You can also reference the
|
||||||
|
"<ulink url='&YOCTO_DOCS_DEV_URL;#providing-license-text'>Providing License Text</ulink>"
|
||||||
|
section in the Yocto Project Development Manual for
|
||||||
|
information on providing license text.
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
@@ -5768,32 +5794,45 @@
|
|||||||
Specifies the complete list of supported image types
|
Specifies the complete list of supported image types
|
||||||
by default:
|
by default:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
jffs2
|
|
||||||
jffs2.sum
|
|
||||||
cramfs
|
|
||||||
ext2
|
|
||||||
ext2.gz
|
|
||||||
ext2.bz2
|
|
||||||
ext3
|
|
||||||
ext3.gz
|
|
||||||
ext2.lzma
|
|
||||||
btrfs
|
btrfs
|
||||||
live
|
|
||||||
squashfs
|
|
||||||
squashfs-xz
|
|
||||||
ubi
|
|
||||||
ubifs
|
|
||||||
tar
|
|
||||||
tar.gz
|
|
||||||
tar.bz2
|
|
||||||
tar.xz
|
|
||||||
cpio
|
cpio
|
||||||
cpio.gz
|
cpio.gz
|
||||||
cpio.xz
|
cpio.lz4
|
||||||
cpio.lzma
|
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
|
vdi
|
||||||
vmdk
|
vmdk
|
||||||
elf
|
wic
|
||||||
|
wic.bz2
|
||||||
|
wic.gz
|
||||||
|
wic.lzma
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@@ -7166,6 +7205,49 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
|
|||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
|
|
||||||
|
<glossentry id='var-LICENSE_CREATE_PACKAGE'><glossterm>LICENSE_CREATE_PACKAGE</glossterm>
|
||||||
|
<info>
|
||||||
|
LICENSE_CREATE_PACKAGE[doc] = "Creates an extra package (i.e. ${PN}-lic) for each recipe and adds that package to the RRECOMMENDS+${PN}."
|
||||||
|
</info>
|
||||||
|
<glossdef>
|
||||||
|
<para role="glossdeffirst">
|
||||||
|
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
||||||
|
Setting <filename>LICENSE_CREATE_PACKAGE</filename>
|
||||||
|
to "1" causes the OpenEmbedded build system to create
|
||||||
|
an extra package (i.e.
|
||||||
|
<filename>${</filename><link linkend='var-PN'><filename>PN</filename></link><filename>}-lic</filename>)
|
||||||
|
for each recipe and to add those packages to the
|
||||||
|
<link linkend='var-RRECOMMENDS'><filename>RRECOMMENDS</filename></link><filename>_${PN}</filename>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The <filename>${PN}-lic</filename> package installs a
|
||||||
|
directory in <filename>/usr/share/licenses</filename>
|
||||||
|
named <filename>${PN}</filename>, which is the recipe's
|
||||||
|
base name, and installs files in that directory that
|
||||||
|
contain license and copyright information (i.e. copies of
|
||||||
|
the appropriate license files from
|
||||||
|
<filename>meta/common-licenses</filename> that match the
|
||||||
|
licenses specified in the
|
||||||
|
<link linkend='var-LICENSE'><filename>LICENSE</filename></link>
|
||||||
|
variable of the recipe metadata and copies of files marked
|
||||||
|
in
|
||||||
|
<link linkend='var-LIC_FILES_CHKSUM'><filename>LIC_FILES_CHKSUM</filename></link>
|
||||||
|
as containing license text).
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
For related information on providing license text, see the
|
||||||
|
<link linkend='var-COPY_LIC_DIRS'><filename>COPY_LIC_DIRS</filename></link>
|
||||||
|
variable, the
|
||||||
|
<link linkend='var-COPY_LIC_MANIFEST'><filename>COPY_LIC_MANIFEST</filename></link>
|
||||||
|
variable, and the
|
||||||
|
"<ulink url='&YOCTO_DOCS_DEV_URL;#providing-license-text'>Providing License Text</ulink>"
|
||||||
|
section in the Yocto Project Development Manual.
|
||||||
|
</para>
|
||||||
|
</glossdef>
|
||||||
|
</glossentry>
|
||||||
|
|
||||||
<glossentry id='var-LICENSE_FLAGS'><glossterm>LICENSE_FLAGS</glossterm>
|
<glossentry id='var-LICENSE_FLAGS'><glossterm>LICENSE_FLAGS</glossterm>
|
||||||
<info>
|
<info>
|
||||||
LICENSE_FLAGS[doc] = "Specifies additional flags for a recipe you must whitelist through LICENSE_FLAGS_WHITELIST in order to allow the recipe to be built."
|
LICENSE_FLAGS[doc] = "Specifies additional flags for a recipe you must whitelist through LICENSE_FLAGS_WHITELIST in order to allow the recipe to be built."
|
||||||
@@ -10544,6 +10626,20 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
|
|||||||
poky/build/tmp/work/qemux86-poky-linux/db/5.1.19-r3/db-5.1.19
|
poky/build/tmp/work/qemux86-poky-linux/db/5.1.19-r3/db-5.1.19
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
This next example assumes a Git repository.
|
||||||
|
By default, Git repositories are cloned to
|
||||||
|
<filename>${WORKDIR}/git</filename> during
|
||||||
|
<link linkend='ref-tasks-fetch'><filename>do_fetch</filename></link>.
|
||||||
|
Since this path is different from the default value of
|
||||||
|
<filename>S</filename>, you must set it specifically
|
||||||
|
so the source can be located:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
SRC_URI = "git://path/to/repo.git"
|
||||||
|
S = "${WORKDIR}/git"
|
||||||
|
</literallayout>
|
||||||
|
</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
|
|
||||||
|
|||||||
@@ -662,7 +662,6 @@
|
|||||||
"IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
|
"IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
|
||||||
"IMAGE_INSTALL_append": "",
|
"IMAGE_INSTALL_append": "",
|
||||||
"PACKAGE_CLASSES": "package_rpm",
|
"PACKAGE_CLASSES": "package_rpm",
|
||||||
"SDKMACHINE" : "x86_64"
|
|
||||||
},
|
},
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
|
|||||||
@@ -318,6 +318,7 @@
|
|||||||
'PASSWORD': 'yourpasswordhere',
|
'PASSWORD': 'yourpasswordhere',
|
||||||
'HOST': 'localhost',
|
'HOST': 'localhost',
|
||||||
'PORT': '3306',
|
'PORT': '3306',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
@@ -347,7 +348,7 @@
|
|||||||
server defined earlier:
|
server defined earlier:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ mysql -u root -p
|
$ mysql -u root -p
|
||||||
mysql> CREATE DATABASE toaster;
|
mysql> CREATE DATABASE toaster_data;
|
||||||
mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
|
mysql> CREATE USER 'toaster'@'localhost' identified by 'yourpasswordhere';
|
||||||
mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
|
mysql> GRANT all on toaster_data.* to 'toaster'@'localhost';
|
||||||
mysql> quit
|
mysql> quit
|
||||||
@@ -358,9 +359,9 @@
|
|||||||
default data, and gather the statically-served files:
|
default data, and gather the statically-served files:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ cd /var/www/toaster/poky/
|
$ cd /var/www/toaster/poky/
|
||||||
$ ./bitbake/lib/toaster/manage.py syncdb --migrate
|
$ ./bitbake/lib/toaster/manage.py syncdb
|
||||||
$ ./bitbake/lib/toaster/manage.py loadconf ./meta-yocto/conf/toasterconf.json
|
$ ./bitbake/lib/toaster/manage.py migrate
|
||||||
$ ./bitbake/lib/toaster/manage.py lsupdates
|
$ TOASTER_DIR=`pwd` TOASTER_CONF=./meta-yocto/conf/toasterconf.json ./bitbake/lib/toaster/manage.py checksettings
|
||||||
$ ./bitbake/lib/toaster/manage.py collectstatic
|
$ ./bitbake/lib/toaster/manage.py collectstatic
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para>
|
</para>
|
||||||
@@ -368,33 +369,41 @@
|
|||||||
<para>
|
<para>
|
||||||
For the above set of commands, after moving to the
|
For the above set of commands, after moving to the
|
||||||
<filename>poky</filename> directory,
|
<filename>poky</filename> directory,
|
||||||
the <filename>syncdb</filename> command with the
|
the <filename>syncdb</filename> and <filename>migrate</filename>
|
||||||
<filename>migrate</filename> option makes sure the database
|
commands ensure the database
|
||||||
schema has had changes propagated correctly (i.e.
|
schema has had changes propagated correctly (i.e.
|
||||||
migrations).
|
migrations).
|
||||||
See the
|
|
||||||
<ulink url='https://south.readthedocs.org/en/latest/commands.html#syncdb'><filename>syncdb</filename></ulink>
|
|
||||||
command for more information.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The
|
The next line sets the Toaster root directory
|
||||||
<link linkend='toaster-command-loadconf'><filename>loadconf</filename></link>
|
<filename>TOASTER_DIR</filename> and the location of
|
||||||
command loads the
|
the Toaster configuration file
|
||||||
<filename>./meta-yocto/conf/toasterconf.json</filename>
|
<filename>TOASTER_CONF</filename>, which is
|
||||||
JSON file.
|
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>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <filename>lsupdates</filename> command fetches
|
This line also runs the <filename>checksettings</filename>
|
||||||
information about machines, recipes and
|
command, which configures the location of the Toaster
|
||||||
layers available as part of OpenEmbedded.
|
<ulink url='&YOCTO_DOCS_DEV_URL;#build-directory'>Build directory</ulink>.
|
||||||
The information is fetched from the
|
The Toaster root directory <filename>TOASTER_DIR</filename>
|
||||||
<ulink url='http://layers.openembedded.org/'>OpenEmbedded Metadata Index</ulink>.
|
determines where the Toaster build directory
|
||||||
This information provides easy access to metadata
|
is created on the file system.
|
||||||
from Toaster, and it is key for Toaster's usability.
|
In the example above,
|
||||||
It is not recommended that you use Toaster without
|
<filename>TOASTER_DIR</filename> is set as follows:
|
||||||
fetching this information."
|
<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>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@@ -402,8 +411,6 @@
|
|||||||
is a Django framework command that collects all the
|
is a Django framework command that collects all the
|
||||||
statically served files into a designated directory to
|
statically served files into a designated directory to
|
||||||
be served up by the Apache web server.
|
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>
|
</para></listitem>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Add an Apache configuration file for Toaster to your Apache web
|
Add an Apache configuration file for Toaster to your Apache web
|
||||||
@@ -438,6 +445,7 @@
|
|||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo a2enmod wsgi
|
$ sudo a2enmod wsgi
|
||||||
$ sudo a2enconf toaster
|
$ sudo a2enconf toaster
|
||||||
|
$ chmod +x bitbake/lib/toaster/toastermain/wsgi.py
|
||||||
</literallayout>
|
</literallayout>
|
||||||
Finally, restart Apache to make sure all new configuration
|
Finally, restart Apache to make sure all new configuration
|
||||||
is loaded.
|
is loaded.
|
||||||
|
|||||||
@@ -41,6 +41,11 @@
|
|||||||
<date>October 2015</date>
|
<date>October 2015</date>
|
||||||
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
<revremark>Released with the Yocto Project 2.0 Release.</revremark>
|
||||||
</revision>
|
</revision>
|
||||||
|
<revision>
|
||||||
|
<revnumber>2.0.1</revnumber>
|
||||||
|
<date>March 2016</date>
|
||||||
|
<revremark>Released with the Yocto Project 2.0.1 Release.</revremark>
|
||||||
|
</revision>
|
||||||
</revhistory>
|
</revhistory>
|
||||||
|
|
||||||
<copyright>
|
<copyright>
|
||||||
|
|||||||
@@ -2,32 +2,32 @@
|
|||||||
# This style is for manual folders like "yocto-project-qs" and "poky-ref-manual".
|
# This style is for manual folders like "yocto-project-qs" and "poky-ref-manual".
|
||||||
# This is the old way that did it. Can't do that now that we have "bitbake-user-manual" strings
|
# This is the old way that did it. Can't do that now that we have "bitbake-user-manual" strings
|
||||||
# in the mega-manual.
|
# in the mega-manual.
|
||||||
# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
|
# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/[a-z]*-[a-z]*-[a-z]*\/[a-z]*-[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/poky-ref-manual\/poky-ref-manual.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/poky-ref-manual\/poky-ref-manual.html#/\"link\" href=\"#/g
|
||||||
|
|
||||||
# Processes all other manuals (<word>-<word> style) except for the BitBake User Manual because
|
# Processes all other manuals (<word>-<word> style) except for the BitBake User Manual because
|
||||||
# it is not included in the mega-manual.
|
# it is not included in the mega-manual.
|
||||||
# This style is for manual folders that use two word, which is the standard now (e.g. "ref-manual").
|
# This style is for manual folders that use two word, which is the standard now (e.g. "ref-manual").
|
||||||
# This was the one-liner that worked before we introduced the BitBake User Manual, which is
|
# This was the one-liner that worked before we introduced the BitBake User Manual, which is
|
||||||
# not in the mega-manual.
|
# not in the mega-manual.
|
||||||
# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
|
# s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/[a-z]*-[a-z]*\/[a-z]*-[a-z]*.html#/\"link\" href=\"#/g
|
||||||
|
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/adt-manual\/adt-manual.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/adt-manual\/adt-manual.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/bsp-guide\/bsp-guide.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/bsp-guide\/bsp-guide.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/dev-manual\/dev-manual.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/dev-manual\/dev-manual.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/kernel-dev\/kernel-dev.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/kernel-dev\/kernel-dev.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/profile-manual\/profile-manual.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/profile-manual\/profile-manual.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/ref-manual\/ref-manual.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/ref-manual\/ref-manual.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/toaster-manual\/toaster-manual.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/toaster-manual\/toaster-manual.html#/\"link\" href=\"#/g
|
||||||
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
|
s/\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/yocto-project-qs\/yocto-project-qs.html#/\"link\" href=\"#/g
|
||||||
|
|
||||||
# Process cases where just an external manual is referenced without an id anchor
|
# Process cases where just an external manual is referenced without an id anchor
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/yocto-project-qs\/yocto-project-qs.html\" target=\"_top\">Yocto Project Quick Start<\/a>/Yocto Project Quick Start/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/dev-manual\/dev-manual.html\" target=\"_top\">Yocto Project Development Manual<\/a>/Yocto Project Development Manual/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/adt-manual\/adt-manual.html\" target=\"_top\">Yocto Project Application Developer's Guide<\/a>/Yocto Project Application Developer's Guide/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/adt-manual\/adt-manual.html\" target=\"_top\">Yocto Project Application Developer's Guide<\/a>/Yocto Project Application Developer's Guide/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/bsp-guide\/bsp-guide.html\" target=\"_top\">Yocto Project Board Support Package (BSP) Developer's Guide<\/a>/Yocto Project Board Support Package (BSP) Developer's Guide/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/profile-manual\/profile-manual.html\" target=\"_top\">Yocto Project Profiling and Tracing Manual<\/a>/Yocto Project Profiling and Tracing Manual/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/profile-manual\/profile-manual.html\" target=\"_top\">Yocto Project Profiling and Tracing Manual<\/a>/Yocto Project Profiling and Tracing Manual/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/kernel-dev\/kernel-dev.html\" target=\"_top\">Yocto Project Linux Kernel Development Manual<\/a>/Yocto Project Linux Kernel Development Manual/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/ref-manual\/ref-manual.html\" target=\"_top\">Yocto Project Reference Manual<\/a>/Yocto Project Reference Manual/g
|
||||||
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0\/toaster-manual\/toaster-manual.html\" target=\"_top\">Toaster User Manual<\/a>/Toaster User Manual/g
|
s/<a class=\"ulink\" href=\"http:\/\/www.yoctoproject.org\/docs\/2.0.1\/toaster-manual\/toaster-manual.html\" target=\"_top\">Toaster User Manual<\/a>/Toaster User Manual/g
|
||||||
|
|||||||
@@ -318,7 +318,7 @@
|
|||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para><emphasis>CentOS</emphasis>
|
<listitem><para><emphasis>CentOS</emphasis>
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ sudo dnf install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
|
$ sudo yum install &CENTOS_HOST_PACKAGES_ESSENTIAL; SDL-devel xterm
|
||||||
</literallayout>
|
</literallayout>
|
||||||
<note>
|
<note>
|
||||||
CentOS 6.x users need to ensure that the required
|
CentOS 6.x users need to ensure that the required
|
||||||
@@ -587,7 +587,7 @@
|
|||||||
</orderedlist>
|
</orderedlist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para id='qs-minnowboard-example'>
|
||||||
The following steps show how easy it is to set up to build an
|
The following steps show how easy it is to set up to build an
|
||||||
image for a new machine.
|
image for a new machine.
|
||||||
These steps build an image for the MinnowBoard MAX, which is
|
These steps build an image for the MinnowBoard MAX, which is
|
||||||
@@ -610,16 +610,35 @@
|
|||||||
Building an image for the MinnowBoard MAX requires the
|
Building an image for the MinnowBoard MAX requires the
|
||||||
<filename>meta-intel</filename> layer.
|
<filename>meta-intel</filename> layer.
|
||||||
Use the <filename>git clone</filename> command to create
|
Use the <filename>git clone</filename> command to create
|
||||||
a local copy of the repository:
|
a local copy of the repository inside your
|
||||||
|
<ulink url='&YOCTO_DOCS_DEV_URL;#source-directory'>Source Directory</ulink>,
|
||||||
|
which is <filename>poky</filename> in this example:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
|
$ cd $HOME/poky
|
||||||
$ git clone git://git.yoctoproject.org/meta-intel
|
$ git clone git://git.yoctoproject.org/meta-intel
|
||||||
Cloning into 'meta-intel'...
|
Cloning into 'meta-intel'...
|
||||||
remote: Counting objects: 10824, done.
|
remote: Counting objects: 11988, done.
|
||||||
remote: Compressing objects: 100% (3508/3508), done.
|
remote: Compressing objects: 100% (3884/3884), done.
|
||||||
remote: Total 10824 (delta 6219), reused 10580 (delta 5975)
|
Receiving objects: 100% (11988/11988), 2.93 MiB | 2.51 MiB/s, done.
|
||||||
Receiving objects: 100% (10824/10824), 2.72 MiB | 482.00 KiB/s, done.
|
remote: Total 11988 (delta 6881), reused 11752 (delta 6645)
|
||||||
Resolving deltas: 100% (6219/6219), done.
|
Resolving deltas: 100% (6881/6881), done.
|
||||||
Checking connectivity... done.
|
Checking connectivity... done.
|
||||||
|
</literallayout>
|
||||||
|
By default when you clone a Git repository, the
|
||||||
|
"master" branch is checked out.
|
||||||
|
Before you build your image that uses the
|
||||||
|
<filename>meta-intel</filename> layer, you must be
|
||||||
|
sure that both repositories
|
||||||
|
(<filename>meta-intel</filename> and
|
||||||
|
<filename>poky</filename>) are using the same releases.
|
||||||
|
Consequently, you need to checkout out the
|
||||||
|
"&DISTRO_NAME_NO_CAP;" release after cloning
|
||||||
|
<filename>meta-intel</filename>:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
$ cd $HOME/poky/meta-intel
|
||||||
|
$ git checkout &DISTRO_NAME_NO_CAP;
|
||||||
|
Branch &DISTRO_NAME_NO_CAP; set up to track remote branch &DISTRO_NAME_NO_CAP; from origin.
|
||||||
|
Switched to a new branch '&DISTRO_NAME_NO_CAP;'
|
||||||
</literallayout>
|
</literallayout>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para><emphasis>Configure the Build:</emphasis>
|
<listitem><para><emphasis>Configure the Build:</emphasis>
|
||||||
@@ -639,7 +658,8 @@
|
|||||||
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
|
<ulink url='&YOCTO_DOCS_REF_URL;#var-MACHINE'><filename>MACHINE</filename></ulink>
|
||||||
variable.
|
variable.
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
$ bitbake-layers add-layer "$HOME/source/poky/meta-intel"
|
$ cd $HOME/poky/build
|
||||||
|
$ bitbake-layers add-layer "$HOME/poky/meta-intel"
|
||||||
$ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
|
$ echo 'MACHINE = "intel-corei7-64"' >> conf/local.conf
|
||||||
</literallayout>
|
</literallayout>
|
||||||
<note><title>Notes</title>
|
<note><title>Notes</title>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ XSERVER ?= "${XSERVER_X86_BASE} \
|
|||||||
${XSERVER_X86_MODESETTING} \
|
${XSERVER_X86_MODESETTING} \
|
||||||
"
|
"
|
||||||
|
|
||||||
MACHINE_EXTRA_RRECOMMENDS += "linux-firmware v86d eee-acpi-scripts"
|
MACHINE_EXTRA_RRECOMMENDS += "linux-firmware eee-acpi-scripts"
|
||||||
|
|
||||||
GLIBC_ADDONS = "nptl"
|
GLIBC_ADDONS = "nptl"
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
|
|||||||
KMACHINE_genericx86 ?= "common-pc"
|
KMACHINE_genericx86 ?= "common-pc"
|
||||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||||
|
|
||||||
SRCREV_machine_genericx86 ?= "af1f7f586bd32d39c057f17606991b887eadb389"
|
SRCREV_machine_genericx86 ?= "d9bf859dfae6f88b88b157119c20ae4d5e51420a"
|
||||||
SRCREV_machine_genericx86-64 ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
SRCREV_machine_genericx86-64 ?= "93b2b800d85c1565af7d96f3776dc38c85ae1902"
|
||||||
SRCREV_machine_edgerouter ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
SRCREV_machine_edgerouter ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
||||||
SRCREV_machine_beaglebone ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
SRCREV_machine_beaglebone ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
|
||||||
SRCREV_machine_mpc8315e-rdb ?= "1cb1bbaf63cecc918cf36c89819a7464af4c4b13"
|
SRCREV_machine_mpc8315e-rdb ?= "1cb1bbaf63cecc918cf36c89819a7464af4c4b13"
|
||||||
@@ -18,3 +18,6 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
|
|||||||
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
||||||
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
|
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
|
||||||
COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
|
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 ?= "common-pc"
|
||||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||||
|
|
||||||
SRCREV_machine_genericx86 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
SRCREV_machine_genericx86 ?= "1583bf79b946cd5581d84d8c369b819a5ecb94b4"
|
||||||
SRCREV_machine_genericx86-64 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
SRCREV_machine_genericx86-64 ?= "1583bf79b946cd5581d84d8c369b819a5ecb94b4"
|
||||||
SRCREV_machine_edgerouter ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
SRCREV_machine_edgerouter ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
||||||
SRCREV_machine_beaglebone ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
SRCREV_machine_beaglebone ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
|
||||||
SRCREV_machine_mpc8315e-rdb ?= "2893f3e8ece72f6f47329714d6afe4c9c545bbf9"
|
SRCREV_machine_mpc8315e-rdb ?= "2893f3e8ece72f6f47329714d6afe4c9c545bbf9"
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ KBRANCH_mpc8315e-rdb = "standard/fsl-mpc8315e-rdb"
|
|||||||
KMACHINE_genericx86 ?= "common-pc"
|
KMACHINE_genericx86 ?= "common-pc"
|
||||||
KMACHINE_genericx86-64 ?= "common-pc-64"
|
KMACHINE_genericx86-64 ?= "common-pc-64"
|
||||||
|
|
||||||
SRCREV_machine_genericx86 ?= "dbe692d91c8e55d1430f2c45fd578c8e4e71e482"
|
SRCREV_machine_genericx86 ?= "2e0ac7b6c4e3ada23a84756287e9b7051ace939a"
|
||||||
SRCREV_machine_genericx86-64 ?= "dbe692d91c8e55d1430f2c45fd578c8e4e71e482"
|
SRCREV_machine_genericx86-64 ?= "2e0ac7b6c4e3ada23a84756287e9b7051ace939a"
|
||||||
SRCREV_machine_edgerouter ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
|
SRCREV_machine_edgerouter ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
|
||||||
SRCREV_machine_beaglebone ?= "efb6ffb2ca96a364f916c9890ad023fc595e0e6e"
|
SRCREV_machine_beaglebone ?= "efb6ffb2ca96a364f916c9890ad023fc595e0e6e"
|
||||||
SRCREV_machine_mpc8315e-rdb ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
|
SRCREV_machine_mpc8315e-rdb ?= "79a31b9d23db126f8a6be3eb88fd683056a213f1"
|
||||||
@@ -18,3 +18,6 @@ COMPATIBLE_MACHINE_genericx86-64 = "genericx86-64"
|
|||||||
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
COMPATIBLE_MACHINE_edgerouter = "edgerouter"
|
||||||
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
|
COMPATIBLE_MACHINE_beaglebone = "beaglebone"
|
||||||
COMPATIBLE_MACHINE_mpc8315e-rdb = "mpc8315e-rdb"
|
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 = "poky"
|
||||||
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
|
||||||
DISTRO_VERSION = "2.0"
|
DISTRO_VERSION = "2.0.2"
|
||||||
DISTRO_CODENAME = "jethro"
|
DISTRO_CODENAME = "jethro"
|
||||||
SDK_VENDOR = "-pokysdk"
|
SDK_VENDOR = "-pokysdk"
|
||||||
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"
|
||||||
@@ -64,10 +64,7 @@ https://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n"
|
|||||||
# fetch from the network (and warn you if not). To disable the test set
|
# fetch from the network (and warn you if not). To disable the test set
|
||||||
# the variable to be empty.
|
# the variable to be empty.
|
||||||
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master
|
# Git example url: git://git.yoctoproject.org/yocto-firewall-test;protocol=git;rev=master
|
||||||
|
CONNECTIVITY_CHECK_URIS ?= "https://www.example.com/"
|
||||||
CONNECTIVITY_CHECK_URIS ?= " \
|
|
||||||
https://eula-downloads.yoctoproject.org/index.php \
|
|
||||||
http://bugzilla.yoctoproject.org/report.cgi"
|
|
||||||
|
|
||||||
SANITY_TESTED_DISTROS ?= " \
|
SANITY_TESTED_DISTROS ?= " \
|
||||||
poky-1.7 \n \
|
poky-1.7 \n \
|
||||||
|
|||||||
@@ -225,11 +225,12 @@ BB_DISKMON_DIRS = "\
|
|||||||
# Qemu configuration
|
# Qemu configuration
|
||||||
#
|
#
|
||||||
# By default qemu will build with a builtin VNC server where graphical output can be
|
# By default qemu will build with a builtin VNC server where graphical output can be
|
||||||
# seen. The two lines below enable the SDL backend too. This assumes there is a
|
# seen. The two lines below enable the SDL backend too. By default libsdl-native will
|
||||||
# libsdl library available on your build system.
|
# be built, if you want to use your host's libSDL instead of the minimal libsdl built
|
||||||
|
# by libsdl-native then uncomment the ASSUME_PROVIDED line below.
|
||||||
PACKAGECONFIG_append_pn-qemu-native = " sdl"
|
PACKAGECONFIG_append_pn-qemu-native = " sdl"
|
||||||
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
|
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
|
||||||
ASSUME_PROVIDED += "libsdl-native"
|
#ASSUME_PROVIDED += "libsdl-native"
|
||||||
|
|
||||||
|
|
||||||
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
|
# CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
|
||||||
|
|||||||
@@ -27,6 +27,10 @@ python () {
|
|||||||
d.setVar("PACKAGE_EXTRA_ARCHS", "")
|
d.setVar("PACKAGE_EXTRA_ARCHS", "")
|
||||||
d.setVar("SDK_ARCH", "none")
|
d.setVar("SDK_ARCH", "none")
|
||||||
d.setVar("SDK_CC_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
|
# Avoid this being unnecessarily different due to nuances of
|
||||||
# the target machine that aren't important for "all" arch
|
# the target machine that aren't important for "all" arch
|
||||||
|
|||||||
@@ -77,16 +77,20 @@ CONFIGUREOPTS = " --build=${BUILD_SYS} \
|
|||||||
${@append_libtool_sysroot(d)}"
|
${@append_libtool_sysroot(d)}"
|
||||||
CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
|
CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
|
||||||
|
|
||||||
|
AUTOTOOLS_SCRIPT_PATH ?= "${S}"
|
||||||
|
CONFIGURE_SCRIPT ?= "${AUTOTOOLS_SCRIPT_PATH}/configure"
|
||||||
|
|
||||||
|
AUTOTOOLS_AUXDIR ?= "${AUTOTOOLS_SCRIPT_PATH}"
|
||||||
|
|
||||||
oe_runconf () {
|
oe_runconf () {
|
||||||
cfgscript="${S}/configure"
|
cfgscript="${CONFIGURE_SCRIPT}"
|
||||||
if [ -x "$cfgscript" ] ; then
|
if [ -x "$cfgscript" ] ; then
|
||||||
bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
|
bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
|
||||||
set +e
|
set +e
|
||||||
${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
|
${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
echo "Configure failed. The contents of all config.log files follows to aid debugging"
|
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"
|
die "oe_runconf failed"
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
@@ -95,8 +99,6 @@ oe_runconf () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
AUTOTOOLS_AUXDIR ?= "${S}"
|
|
||||||
|
|
||||||
CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
|
CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
|
||||||
|
|
||||||
autotools_preconfigure() {
|
autotools_preconfigure() {
|
||||||
@@ -134,7 +136,7 @@ do_configure[postfuncs] += "autotools_postconfigure"
|
|||||||
ACLOCALDIR = "${B}/aclocal-copy"
|
ACLOCALDIR = "${B}/aclocal-copy"
|
||||||
|
|
||||||
python autotools_copy_aclocals () {
|
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 os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
|
||||||
if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
|
if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
|
||||||
return
|
return
|
||||||
@@ -228,13 +230,13 @@ autotools_do_configure() {
|
|||||||
( for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do
|
( for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do
|
||||||
rm -f `dirname $ac`/configure
|
rm -f `dirname $ac`/configure
|
||||||
done )
|
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`
|
olddir=`pwd`
|
||||||
cd ${S}
|
cd ${AUTOTOOLS_SCRIPT_PATH}
|
||||||
ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
|
ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
|
||||||
if [ x"${acpaths}" = xdefault ]; then
|
if [ x"${acpaths}" = xdefault ]; then
|
||||||
acpaths=
|
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
|
grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
|
||||||
acpaths="$acpaths -I $i"
|
acpaths="$acpaths -I $i"
|
||||||
done
|
done
|
||||||
@@ -265,21 +267,20 @@ autotools_do_configure() {
|
|||||||
bbnote Executing glib-gettextize --force --copy
|
bbnote Executing glib-gettextize --force --copy
|
||||||
echo "no" | glib-gettextize --force --copy
|
echo "no" | glib-gettextize --force --copy
|
||||||
fi
|
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...
|
# We'd call gettextize here if it wasn't so broken...
|
||||||
cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
|
cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
|
||||||
if [ -d ${S}/po/ ]; then
|
if [ -d ${S}/po/ ]; then
|
||||||
cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
|
cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
|
||||||
if [ ! -e ${S}/po/remove-potcdate.sin ]; then
|
if [ ! -e ${S}/po/remove-potcdate.sin ]; then
|
||||||
cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
|
cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
|
||||||
fi
|
|
||||||
fi
|
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
|
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
|
fi
|
||||||
mkdir -p m4
|
mkdir -p m4
|
||||||
if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
|
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."
|
ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
|
||||||
cd $olddir
|
cd $olddir
|
||||||
fi
|
fi
|
||||||
if [ -e ${S}/configure ]; then
|
if [ -e ${CONFIGURE_SCRIPT} ]; then
|
||||||
oe_runconf
|
oe_runconf
|
||||||
else
|
else
|
||||||
bbnote "nothing to configure"
|
bbnote "nothing to configure"
|
||||||
|
|||||||
@@ -363,7 +363,10 @@ python () {
|
|||||||
newappends.append(a)
|
newappends.append(a)
|
||||||
elif a.startswith("virtual/"):
|
elif a.startswith("virtual/"):
|
||||||
subs = a.split("/", 1)[1]
|
subs = a.split("/", 1)[1]
|
||||||
newappends.append("virtual/" + prefix + subs + extension)
|
if subs.startswith(prefix):
|
||||||
|
newappends.append(a + extension)
|
||||||
|
else:
|
||||||
|
newappends.append("virtual/" + prefix + subs + extension)
|
||||||
else:
|
else:
|
||||||
if a.startswith(prefix):
|
if a.startswith(prefix):
|
||||||
newappends.append(a + extension)
|
newappends.append(a + extension)
|
||||||
|
|||||||
@@ -121,6 +121,8 @@ build_boot_dd() {
|
|||||||
# done in blocks, thus the mod by 16 instead of 32.
|
# done in blocks, thus the mod by 16 instead of 32.
|
||||||
BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
|
BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
|
||||||
|
|
||||||
|
# Remove it since mkdosfs would fail when it exists
|
||||||
|
rm -f $HDDIMG
|
||||||
mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C $HDDIMG $BLOCKS
|
mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C $HDDIMG $BLOCKS
|
||||||
mcopy -i $HDDIMG -s $HDDDIR/* ::/
|
mcopy -i $HDDIMG -s $HDDDIR/* ::/
|
||||||
|
|
||||||
|
|||||||
@@ -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 ;\
|
POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host ;\
|
||||||
buildhistory_get_sdk_installed_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):
|
def buildhistory_get_build_id(d):
|
||||||
if d.getVar('BB_WORKERCONTEXT', True) != '1':
|
if d.getVar('BB_WORKERCONTEXT', True) != '1':
|
||||||
|
|||||||
@@ -271,9 +271,9 @@ python do_checkpkg() {
|
|||||||
from bb.fetch2 import FetchError, NoMethodError, decodeurl
|
from bb.fetch2 import FetchError, NoMethodError, decodeurl
|
||||||
|
|
||||||
"""first check whether a uri is provided"""
|
"""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:
|
if src_uri:
|
||||||
uri_type, _, _, _, _, _ = decodeurl(src_uri)
|
uri_type, _, _, _, _, _ = decodeurl(src_uri[0])
|
||||||
else:
|
else:
|
||||||
uri_type = "none"
|
uri_type = "none"
|
||||||
|
|
||||||
|
|||||||
@@ -170,15 +170,38 @@ IMAGE_CMD_ubi () {
|
|||||||
|
|
||||||
IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}"
|
IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}"
|
||||||
|
|
||||||
|
WKS_FILE ?= "${IMAGE_BASENAME}.${MACHINE}.wks"
|
||||||
|
WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
|
||||||
|
WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
|
||||||
|
WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or ''}"
|
||||||
|
|
||||||
|
def wks_search(files, search_path):
|
||||||
|
for f in files:
|
||||||
|
if os.path.isabs(f):
|
||||||
|
if os.path.exists(f):
|
||||||
|
return f
|
||||||
|
else:
|
||||||
|
searched = bb.utils.which(search_path, f)
|
||||||
|
if searched:
|
||||||
|
return searched
|
||||||
|
|
||||||
IMAGE_CMD_wic () {
|
IMAGE_CMD_wic () {
|
||||||
out=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}
|
out="${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}"
|
||||||
wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.${MACHINE}.wks
|
wks="${WKS_FULL_PATH}"
|
||||||
[ -e $wks ] || wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.wks
|
if [ -z "$wks" ]; then
|
||||||
[ -e $wks ] || bbfatal "Kiskstart file $wks doesn't exist"
|
bbfatal "No kickstart files from WKS_FILES were found: ${WKS_FILES}. Please set WKS_FILE or WKS_FILES appropriately."
|
||||||
BUILDDIR=${TOPDIR} wic create $wks --vars ${STAGING_DIR_TARGET}/imgdata/ -e ${IMAGE_BASENAME} -o $out/
|
fi
|
||||||
mv $out/build/${IMAGE_BASENAME}*.direct $out.rootfs.wic
|
|
||||||
rm -rf $out/
|
BUILDDIR="${TOPDIR}" wic create "$wks" --vars "${STAGING_DIR_TARGET}/imgdata/" -e "${IMAGE_BASENAME}" -o "$out/"
|
||||||
|
mv "$out/build/$(basename "${wks%.wks}")"*.direct "$out.rootfs.wic"
|
||||||
|
rm -rf "$out/"
|
||||||
}
|
}
|
||||||
|
IMAGE_CMD_wic[vardepsexclude] = "WKS_FULL_PATH WKS_FILES"
|
||||||
|
|
||||||
|
# Rebuild when the wks file or vars in WICVARS change
|
||||||
|
USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${COMPRESSIONTYPES}'.split()), '1', '', d)}"
|
||||||
|
do_rootfs[file-checksums] += "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
|
||||||
|
do_rootfs[vardeps] += "${@bb.utils.contains("USING_WIC", "1", "${WICVARS}", "", d)}"
|
||||||
|
|
||||||
EXTRA_IMAGECMD = ""
|
EXTRA_IMAGECMD = ""
|
||||||
|
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ COMPRESS_CMD_bz2.u-boot = "${COMPRESS_CMD_bz2}; oe_mkimage ${IMAGE_NAME}.ro
|
|||||||
COMPRESS_DEPENDS_lzma.u-boot = "u-boot-mkimage-native"
|
COMPRESS_DEPENDS_lzma.u-boot = "u-boot-mkimage-native"
|
||||||
COMPRESS_CMD_lzma.u-boot = "${COMPRESS_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma clean"
|
COMPRESS_CMD_lzma.u-boot = "${COMPRESS_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma clean"
|
||||||
|
|
||||||
IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot"
|
IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot cpio.gz.u-boot"
|
||||||
|
|
||||||
|
|||||||
@@ -184,11 +184,18 @@ do_kernel_checkout() {
|
|||||||
source_dir=`echo ${S} | sed 's%/$%%'`
|
source_dir=`echo ${S} | sed 's%/$%%'`
|
||||||
source_workdir="${WORKDIR}/git"
|
source_workdir="${WORKDIR}/git"
|
||||||
if [ -d "${WORKDIR}/git/" ]; then
|
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 S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
|
||||||
if [ "${source_dir}" != "${source_workdir}" ]; then
|
if [ "${source_dir}" != "${source_workdir}" ]; then
|
||||||
rm -rf ${S}
|
if [ -d "${source_workdir}/.git" ]; then
|
||||||
mv ${WORKDIR}/git ${S}
|
# 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
|
fi
|
||||||
cd ${S}
|
cd ${S}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -185,6 +185,18 @@ def copy_license_files(lic_files_paths, destdir):
|
|||||||
os.remove(dst)
|
os.remove(dst)
|
||||||
if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
|
if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
|
||||||
os.link(src, dst)
|
os.link(src, dst)
|
||||||
|
try:
|
||||||
|
os.chown(dst,0,0)
|
||||||
|
except OSError as err:
|
||||||
|
import errno
|
||||||
|
if err.errno in (errno.EPERM, errno.EINVAL):
|
||||||
|
# Suppress "Operation not permitted" error, as
|
||||||
|
# sometimes this function is not executed under pseudo.
|
||||||
|
# Also ignore "Invalid argument" errors that happen in
|
||||||
|
# some (unprivileged) container environments (no root).
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
shutil.copyfile(src, dst)
|
shutil.copyfile(src, dst)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -474,6 +486,7 @@ do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
|
|||||||
do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/"
|
do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/"
|
||||||
|
|
||||||
ROOTFS_POSTPROCESS_COMMAND_prepend = "write_package_manifest; license_create_manifest; "
|
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[dirs] = "${LICSSTATEDIR}/${PN}"
|
||||||
do_populate_lic_setscene[cleandirs] = "${LICSSTATEDIR}"
|
do_populate_lic_setscene[cleandirs] = "${LICSSTATEDIR}"
|
||||||
|
|||||||
@@ -65,19 +65,19 @@ def base_get_metadata_svn_revision(path, d):
|
|||||||
return revision
|
return revision
|
||||||
|
|
||||||
def base_get_metadata_git_branch(path, d):
|
def base_get_metadata_git_branch(path, d):
|
||||||
import subprocess
|
import bb.process
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"],
|
rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path)
|
||||||
cwd=path).strip()
|
except bb.process.ExecutionError:
|
||||||
except:
|
rev = '<unknown>'
|
||||||
return "<unknown>"
|
return rev.strip()
|
||||||
|
|
||||||
def base_get_metadata_git_revision(path, d):
|
def base_get_metadata_git_revision(path, d):
|
||||||
import subprocess
|
import bb.process
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return subprocess.check_output(["git", "rev-parse", "HEAD"],
|
rev, _ = bb.process.run('git rev-parse HEAD', cwd=path)
|
||||||
cwd=path).strip()
|
except bb.process.ExecutionError:
|
||||||
except:
|
rev = '<unknown>'
|
||||||
return "<unknown>"
|
return rev.strip()
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ python copy_buildsystem () {
|
|||||||
core_meta_subdir = ''
|
core_meta_subdir = ''
|
||||||
|
|
||||||
# Copy in all metadata layers + bitbake (as repositories)
|
# 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)
|
baseoutpath = d.getVar('SDK_OUTPUT', True) + '/' + d.getVar('SDKPATH', True)
|
||||||
layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers')
|
layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers')
|
||||||
|
|
||||||
@@ -155,7 +155,7 @@ python copy_buildsystem () {
|
|||||||
f.write('NATIVELSBSTRING_forcevariable = "%s"\n\n' % fixedlsbstring)
|
f.write('NATIVELSBSTRING_forcevariable = "%s"\n\n' % fixedlsbstring)
|
||||||
|
|
||||||
# Ensure locked sstate cache objects are re-used without error
|
# 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
|
# If you define a sdk_extraconf() function then it can contain additional config
|
||||||
extraconf = (d.getVar('sdk_extraconf', True) or '').strip()
|
extraconf = (d.getVar('sdk_extraconf', True) or '').strip()
|
||||||
@@ -187,10 +187,7 @@ python copy_buildsystem () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def extsdk_get_buildtools_filename(d):
|
def extsdk_get_buildtools_filename(d):
|
||||||
# This is somewhat of a hack
|
return '*-buildtools-nativesdk-standalone-*.sh'
|
||||||
localdata = bb.data.createCopy(d)
|
|
||||||
localdata.setVar('PN', 'buildtools-tarball')
|
|
||||||
return localdata.expand('${SDK_NAME}-buildtools-nativesdk-standalone-*.sh')
|
|
||||||
|
|
||||||
install_tools() {
|
install_tools() {
|
||||||
install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
|
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() {
|
sdk_ext_postinst() {
|
||||||
printf "\nExtracting buildtools...\n"
|
printf "\nExtracting buildtools...\n"
|
||||||
cd $target_sdk_dir
|
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
|
# Make sure when the user sets up the environment, they also get
|
||||||
# the buildtools-tarball tools in their path.
|
# 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
|
# dash which is /bin/sh on Ubuntu will not preserve the
|
||||||
# current working directory when first ran, nor will it set $1 when
|
# current working directory when first ran, nor will it set $1 when
|
||||||
# sourcing a script. That is why this has to look so ugly.
|
# 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
|
fi
|
||||||
rm -f $target_sdk_dir/ext-sdk-prepare.sh
|
rm -f $target_sdk_dir/ext-sdk-prepare.sh
|
||||||
echo done
|
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; "
|
SDK_POSTPROCESS_COMMAND_prepend_task-populate-sdk-ext = "copy_buildsystem; install_tools; "
|
||||||
|
|
||||||
fakeroot python do_populate_sdk_ext() {
|
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)
|
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_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
|
||||||
echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
|
echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
|
||||||
echo "export PYTHONHOME=$sdkpathnative$prefix" >> $script
|
echo "export PYTHONHOME=$sdkpathnative$prefix" >> $script
|
||||||
|
echo 'unset command_not_found_handle' >> $script
|
||||||
|
|
||||||
toolchain_shared_env_script
|
toolchain_shared_env_script
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
NATIVELSBSTRING = "universal"
|
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
|
addhandler uninative_eventhandler
|
||||||
uninative_eventhandler[eventmask] = "bb.event.BuildStarted"
|
uninative_eventhandler[eventmask] = "bb.event.BuildStarted"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ AVAILTUNES += "corei7-32"
|
|||||||
TUNE_FEATURES_tune-corei7-32 = "${TUNE_FEATURES_tune-x86} corei7"
|
TUNE_FEATURES_tune-corei7-32 = "${TUNE_FEATURES_tune-x86} corei7"
|
||||||
BASE_LIB_tune-corei7-32 = "lib"
|
BASE_LIB_tune-corei7-32 = "lib"
|
||||||
TUNE_PKGARCH_tune-corei7-32 = "corei7-32"
|
TUNE_PKGARCH_tune-corei7-32 = "corei7-32"
|
||||||
PACKAGE_EXTRA_ARCHS_tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS_tune-core2} corei7-32"
|
PACKAGE_EXTRA_ARCHS_tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS_tune-core2-32} corei7-32"
|
||||||
|
|
||||||
AVAILTUNES += "corei7-64"
|
AVAILTUNES += "corei7-64"
|
||||||
TUNE_FEATURES_tune-corei7-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
|
TUNE_FEATURES_tune-corei7-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ fi
|
|||||||
|
|
||||||
if [ "$SDK_EXTENSIBLE" = "1" ]; then
|
if [ "$SDK_EXTENSIBLE" = "1" ]; then
|
||||||
# We're going to be running the build system, additional restrictions apply
|
# 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" \
|
echo "The target directory path ($target_sdk_dir) contains illegal" \
|
||||||
"characters such as spaces, @ or +. Abort!"
|
"characters such as spaces, @, \$ or +. Abort!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
@@ -169,9 +169,20 @@ echo "done"
|
|||||||
|
|
||||||
printf "Setting it up..."
|
printf "Setting it up..."
|
||||||
# fix environment paths
|
# fix environment paths
|
||||||
|
real_env_setup_script=""
|
||||||
for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
|
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
|
$SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $env_setup_script
|
||||||
done
|
done
|
||||||
|
if [ -n "$real_env_setup_script" ] ; then
|
||||||
|
env_setup_script="$real_env_setup_script"
|
||||||
|
fi
|
||||||
|
|
||||||
@SDK_POST_INSTALL_COMMAND@
|
@SDK_POST_INSTALL_COMMAND@
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,9 @@ def _smart_copy(src, dest):
|
|||||||
shutil.copymode(src, dest)
|
shutil.copymode(src, dest)
|
||||||
|
|
||||||
class BuildSystem(object):
|
class BuildSystem(object):
|
||||||
def __init__(self, d):
|
def __init__(self, context, d):
|
||||||
self.d = d
|
self.d = d
|
||||||
|
self.context = context
|
||||||
self.layerdirs = d.getVar('BBLAYERS', True).split()
|
self.layerdirs = d.getVar('BBLAYERS', True).split()
|
||||||
|
|
||||||
def copy_bitbake_and_layers(self, destdir):
|
def copy_bitbake_and_layers(self, destdir):
|
||||||
@@ -38,7 +39,7 @@ class BuildSystem(object):
|
|||||||
if os.path.exists(layerconf):
|
if os.path.exists(layerconf):
|
||||||
with open(layerconf, 'r') as f:
|
with open(layerconf, 'r') as f:
|
||||||
if f.readline().startswith("# ### workspace layer auto-generated by devtool ###"):
|
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
|
continue
|
||||||
|
|
||||||
# If the layer was already under corebase, leave it there
|
# 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),
|
self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True),
|
||||||
arch))
|
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):
|
def _create_config(self):
|
||||||
with open(self.config_file, "w+") as config_file:
|
with open(self.config_file, "w+") as config_file:
|
||||||
priority = 1
|
priority = 1
|
||||||
@@ -1486,6 +1496,15 @@ class OpkgPM(PackageManager):
|
|||||||
config_file.write("src oe-%s file:%s\n" %
|
config_file.write("src oe-%s file:%s\n" %
|
||||||
(arch, pkgs_dir))
|
(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):
|
def insert_feeds_uris(self):
|
||||||
if self.feed_uris == "":
|
if self.feed_uris == "":
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -383,14 +383,15 @@ class GitApplyTree(PatchTree):
|
|||||||
reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip()
|
reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip()
|
||||||
if not reporoot:
|
if not reporoot:
|
||||||
raise Exception("Cannot get repository root for directory %s" % self.dir)
|
raise Exception("Cannot get repository root for directory %s" % self.dir)
|
||||||
commithook = os.path.join(reporoot, '.git', 'hooks', 'commit-msg')
|
hooks_dir = os.path.join(reporoot, '.git', 'hooks')
|
||||||
commithook_backup = commithook + '.devtool-orig'
|
hooks_dir_backup = hooks_dir + '.devtool-orig'
|
||||||
applyhook = os.path.join(reporoot, '.git', 'hooks', 'applypatch-msg')
|
if os.path.lexists(hooks_dir_backup):
|
||||||
applyhook_backup = applyhook + '.devtool-orig'
|
raise Exception("Git hooks backup directory already exists: %s" % hooks_dir_backup)
|
||||||
if os.path.exists(commithook):
|
if os.path.lexists(hooks_dir):
|
||||||
shutil.move(commithook, commithook_backup)
|
shutil.move(hooks_dir, hooks_dir_backup)
|
||||||
if os.path.exists(applyhook):
|
os.mkdir(hooks_dir)
|
||||||
shutil.move(applyhook, applyhook_backup)
|
commithook = os.path.join(hooks_dir, 'commit-msg')
|
||||||
|
applyhook = os.path.join(hooks_dir, 'applypatch-msg')
|
||||||
with open(commithook, 'w') as f:
|
with open(commithook, 'w') as f:
|
||||||
# NOTE: the formatting here is significant; if you change it you'll also need to
|
# NOTE: the formatting here is significant; if you change it you'll also need to
|
||||||
# change other places which read it back
|
# change other places which read it back
|
||||||
@@ -439,12 +440,9 @@ class GitApplyTree(PatchTree):
|
|||||||
os.remove(tmpfile)
|
os.remove(tmpfile)
|
||||||
return output
|
return output
|
||||||
finally:
|
finally:
|
||||||
os.remove(commithook)
|
shutil.rmtree(hooks_dir)
|
||||||
os.remove(applyhook)
|
if os.path.lexists(hooks_dir_backup):
|
||||||
if os.path.exists(commithook_backup):
|
shutil.move(hooks_dir_backup, hooks_dir)
|
||||||
shutil.move(commithook_backup, commithook)
|
|
||||||
if os.path.exists(applyhook_backup):
|
|
||||||
shutil.move(applyhook_backup, applyhook)
|
|
||||||
|
|
||||||
|
|
||||||
class QuiltTree(PatchSet):
|
class QuiltTree(PatchSet):
|
||||||
|
|||||||
@@ -582,7 +582,7 @@ class DevtoolTests(DevtoolBase):
|
|||||||
# Now try with auto mode
|
# Now try with auto mode
|
||||||
runCmd('cd %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, os.path.basename(recipefile)))
|
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('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()
|
topleveldir = result.output.strip()
|
||||||
relpatchpath = os.path.join(os.path.relpath(os.path.dirname(recipefile), topleveldir), testrecipe)
|
relpatchpath = os.path.join(os.path.relpath(os.path.dirname(recipefile), topleveldir), testrecipe)
|
||||||
expected_status = [(' M', os.path.relpath(recipefile, topleveldir)),
|
expected_status = [(' M', os.path.relpath(recipefile, topleveldir)),
|
||||||
|
|||||||
@@ -46,10 +46,11 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
|||||||
|
|
||||||
SRC_URI_append += "file://appendtest.txt"
|
SRC_URI_append += "file://appendtest.txt"
|
||||||
"""
|
"""
|
||||||
layerappend = "BBLAYERS += \"COREBASE/meta-layertest0 COREBASE/meta-layertest1 COREBASE/meta-layertest2\""
|
layerappend = ''
|
||||||
|
|
||||||
def tearDownLocal(self):
|
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)
|
@testcase(1196)
|
||||||
def test_layer_appends(self):
|
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:
|
with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
|
||||||
f.write("Layer 2 test")
|
f.write("Layer 2 test")
|
||||||
self.track_for_cleanup(layer)
|
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")
|
bitbake("layerappendtest")
|
||||||
data = ftools.read_file(stagingdir + "/appendtest.txt")
|
data = ftools.read_file(stagingdir + "/appendtest.txt")
|
||||||
self.assertEqual(data, "Layer 2 test")
|
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-Unset-need_charset_alias-when-building-for-musl.patch \
|
||||||
file://0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch \
|
file://0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch \
|
||||||
file://grub2-fix-initrd-size-bug.patch \
|
file://grub2-fix-initrd-size-bug.patch \
|
||||||
|
file://CVE-2015-8370.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
DEPENDS = "flex-native bison-native xz"
|
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) {
|
||||||
138
meta/recipes-connectivity/bind/bind/CVE-2016-1285.patch
Normal file
138
meta/recipes-connectivity/bind/bind/CVE-2016-1285.patch
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
From e7e15d1302b26a96fa0a5307d6f2cb0d8ad4ea63 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mark Andrews <marka@isc.org>
|
||||||
|
Date: Thu, 18 Feb 2016 12:11:27 +1100
|
||||||
|
Subject: [PATCH] 4318. [security] Malformed control messages can
|
||||||
|
trigger assertions in named and rndc. (CVE-2016-1285) [RT #41666]
|
||||||
|
|
||||||
|
(cherry picked from commit a2b15b3305acd52179e6f3dc7d073b07fbc40b8e)
|
||||||
|
|
||||||
|
Hand applied Changelog changes.
|
||||||
|
|
||||||
|
CVE: CVE-2016-1285
|
||||||
|
Upstream-Status: Backport
|
||||||
|
|
||||||
|
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
|
||||||
|
---
|
||||||
|
diff -ruN a/bin/named/control.c b/bin/named/control.c
|
||||||
|
--- a/bin/named/control.c 2015-08-15 02:28:49.000000000 +0200
|
||||||
|
+++ b/bin/named/control.c 2016-04-11 09:38:20.940827528 +0200
|
||||||
|
@@ -69,7 +69,7 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
data = isccc_alist_lookup(message, "_data");
|
||||||
|
- if (data == NULL) {
|
||||||
|
+ if (!isccc_alist_alistp(data)) {
|
||||||
|
/*
|
||||||
|
* No data section.
|
||||||
|
*/
|
||||||
|
diff -ruN a/bin/named/controlconf.c b/bin/named/controlconf.c
|
||||||
|
--- a/bin/named/controlconf.c 2015-08-15 02:28:49.000000000 +0200
|
||||||
|
+++ b/bin/named/controlconf.c 2016-04-11 09:38:20.944827355 +0200
|
||||||
|
@@ -402,7 +402,7 @@
|
||||||
|
* Limit exposure to replay attacks.
|
||||||
|
*/
|
||||||
|
_ctrl = isccc_alist_lookup(request, "_ctrl");
|
||||||
|
- if (_ctrl == NULL) {
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl)) {
|
||||||
|
log_invalid(&conn->ccmsg, ISC_R_FAILURE);
|
||||||
|
goto cleanup_request;
|
||||||
|
}
|
||||||
|
diff -ruN a/bin/rndc/rndc.c b/bin/rndc/rndc.c
|
||||||
|
--- a/bin/rndc/rndc.c 2015-08-15 02:28:49.000000000 +0200
|
||||||
|
+++ b/bin/rndc/rndc.c 2016-04-11 09:38:20.944827355 +0200
|
||||||
|
@@ -254,8 +254,8 @@
|
||||||
|
isccc_cc_fromwire(&source, &response, algorithm, &secret));
|
||||||
|
|
||||||
|
data = isccc_alist_lookup(response, "_data");
|
||||||
|
- if (data == NULL)
|
||||||
|
- fatal("no data section in response");
|
||||||
|
+ if (!isccc_alist_alistp(data))
|
||||||
|
+ fatal("bad or missing data section in response");
|
||||||
|
result = isccc_cc_lookupstring(data, "err", &errormsg);
|
||||||
|
if (result == ISC_R_SUCCESS) {
|
||||||
|
failed = ISC_TRUE;
|
||||||
|
@@ -320,8 +320,8 @@
|
||||||
|
isccc_cc_fromwire(&source, &response, algorithm, &secret));
|
||||||
|
|
||||||
|
_ctrl = isccc_alist_lookup(response, "_ctrl");
|
||||||
|
- if (_ctrl == NULL)
|
||||||
|
- fatal("_ctrl section missing");
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl))
|
||||||
|
+ fatal("bad or missing ctrl section in response");
|
||||||
|
nonce = 0;
|
||||||
|
if (isccc_cc_lookupuint32(_ctrl, "_nonce", &nonce) != ISC_R_SUCCESS)
|
||||||
|
nonce = 0;
|
||||||
|
diff -ruN a/CHANGES b/CHANGES
|
||||||
|
--- a/CHANGES 2016-04-11 09:36:08.546578759 +0200
|
||||||
|
+++ b/CHANGES 2016-04-11 09:39:59.356552273 +0200
|
||||||
|
@@ -1,3 +1,6 @@
|
||||||
|
+4318. [security] Malformed control messages can trigger assertions
|
||||||
|
+ in named and rndc. (CVE-2016-1285) [RT #41666]
|
||||||
|
+
|
||||||
|
4146. [bug] Address reference leak that could prevent a clean
|
||||||
|
shutdown. [RT #37125]
|
||||||
|
|
||||||
|
diff -ruN a/lib/isccc/cc.c b/lib/isccc/cc.c
|
||||||
|
--- a/lib/isccc/cc.c 2015-08-15 02:28:49.000000000 +0200
|
||||||
|
+++ b/lib/isccc/cc.c 2016-04-11 09:38:20.944827355 +0200
|
||||||
|
@@ -403,13 +403,13 @@
|
||||||
|
* Extract digest.
|
||||||
|
*/
|
||||||
|
_auth = isccc_alist_lookup(alist, "_auth");
|
||||||
|
- if (_auth == NULL)
|
||||||
|
+ if (!isccc_alist_alistp(_auth))
|
||||||
|
return (ISC_R_FAILURE);
|
||||||
|
if (algorithm == ISCCC_ALG_HMACMD5)
|
||||||
|
hmac = isccc_alist_lookup(_auth, "hmd5");
|
||||||
|
else
|
||||||
|
hmac = isccc_alist_lookup(_auth, "hsha");
|
||||||
|
- if (hmac == NULL)
|
||||||
|
+ if (!isccc_sexpr_binaryp(hmac))
|
||||||
|
return (ISC_R_FAILURE);
|
||||||
|
/*
|
||||||
|
* Compute digest.
|
||||||
|
@@ -728,7 +728,7 @@
|
||||||
|
REQUIRE(ackp != NULL && *ackp == NULL);
|
||||||
|
|
||||||
|
_ctrl = isccc_alist_lookup(message, "_ctrl");
|
||||||
|
- if (_ctrl == NULL ||
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl) ||
|
||||||
|
isccc_cc_lookupuint32(_ctrl, "_ser", &serial) != ISC_R_SUCCESS ||
|
||||||
|
isccc_cc_lookupuint32(_ctrl, "_tim", &t) != ISC_R_SUCCESS)
|
||||||
|
return (ISC_R_FAILURE);
|
||||||
|
@@ -773,7 +773,7 @@
|
||||||
|
isccc_sexpr_t *_ctrl;
|
||||||
|
|
||||||
|
_ctrl = isccc_alist_lookup(message, "_ctrl");
|
||||||
|
- if (_ctrl == NULL)
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl))
|
||||||
|
return (ISC_FALSE);
|
||||||
|
if (isccc_cc_lookupstring(_ctrl, "_ack", NULL) == ISC_R_SUCCESS)
|
||||||
|
return (ISC_TRUE);
|
||||||
|
@@ -786,7 +786,7 @@
|
||||||
|
isccc_sexpr_t *_ctrl;
|
||||||
|
|
||||||
|
_ctrl = isccc_alist_lookup(message, "_ctrl");
|
||||||
|
- if (_ctrl == NULL)
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl))
|
||||||
|
return (ISC_FALSE);
|
||||||
|
if (isccc_cc_lookupstring(_ctrl, "_rpl", NULL) == ISC_R_SUCCESS)
|
||||||
|
return (ISC_TRUE);
|
||||||
|
@@ -806,7 +806,7 @@
|
||||||
|
|
||||||
|
_ctrl = isccc_alist_lookup(message, "_ctrl");
|
||||||
|
_data = isccc_alist_lookup(message, "_data");
|
||||||
|
- if (_ctrl == NULL || _data == NULL ||
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl) || !isccc_alist_alistp(_data) ||
|
||||||
|
isccc_cc_lookupuint32(_ctrl, "_ser", &serial) != ISC_R_SUCCESS ||
|
||||||
|
isccc_cc_lookupstring(_data, "type", &type) != ISC_R_SUCCESS)
|
||||||
|
return (ISC_R_FAILURE);
|
||||||
|
@@ -995,7 +995,7 @@
|
||||||
|
isccc_sexpr_t *_ctrl;
|
||||||
|
|
||||||
|
_ctrl = isccc_alist_lookup(message, "_ctrl");
|
||||||
|
- if (_ctrl == NULL ||
|
||||||
|
+ if (!isccc_alist_alistp(_ctrl) ||
|
||||||
|
isccc_cc_lookupstring(_ctrl, "_ser", &_ser) != ISC_R_SUCCESS ||
|
||||||
|
isccc_cc_lookupstring(_ctrl, "_tim", &_tim) != ISC_R_SUCCESS)
|
||||||
|
return (ISC_R_FAILURE);
|
||||||
79
meta/recipes-connectivity/bind/bind/CVE-2016-1286_1.patch
Normal file
79
meta/recipes-connectivity/bind/bind/CVE-2016-1286_1.patch
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
From 456e1eadd2a3a2fb9617e60d4db90ef4ba7c6ba3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mukund Sivaraman <muks@isc.org>
|
||||||
|
Date: Mon, 22 Feb 2016 12:22:43 +0530
|
||||||
|
Subject: [PATCH] Fix resolver assertion failure due to improper DNAME handling
|
||||||
|
(CVE-2016-1286) (#41753)
|
||||||
|
|
||||||
|
(cherry picked from commit 5995fec51cc8bb7e53804e4936e60aa1537f3673)
|
||||||
|
|
||||||
|
Hand applied Changelog changes.
|
||||||
|
|
||||||
|
CVE: CVE-2016-1286
|
||||||
|
Upstream-Status: Backport
|
||||||
|
|
||||||
|
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
|
||||||
|
---
|
||||||
|
diff -ruN a/CHANGES b/CHANGES
|
||||||
|
--- a/CHANGES 2016-04-11 09:46:42.075057394 +0200
|
||||||
|
+++ b/CHANGES 2016-04-11 09:44:21.857148819 +0200
|
||||||
|
@@ -1,3 +1,7 @@
|
||||||
|
+4319. [security] Fix resolver assertion failure due to improper
|
||||||
|
+ DNAME handling when parsing fetch reply messages.
|
||||||
|
+ (CVE-2016-1286) [RT #41753]
|
||||||
|
+
|
||||||
|
4318. [security] Malformed control messages can trigger assertions
|
||||||
|
in named and rndc. (CVE-2016-1285) [RT #41666]
|
||||||
|
|
||||||
|
diff -ruN a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||||
|
--- a/lib/dns/resolver.c 2016-04-11 09:36:08.550578585 +0200
|
||||||
|
+++ b/lib/dns/resolver.c 2016-04-11 09:43:23.091701714 +0200
|
||||||
|
@@ -6634,21 +6634,26 @@
|
||||||
|
isc_boolean_t found_dname = ISC_FALSE;
|
||||||
|
dns_name_t *dname_name;
|
||||||
|
|
||||||
|
+ /*
|
||||||
|
+ * Only pass DNAME or RRSIG(DNAME).
|
||||||
|
+ */
|
||||||
|
+ if (rdataset->type != dns_rdatatype_dname &&
|
||||||
|
+ (rdataset->type != dns_rdatatype_rrsig ||
|
||||||
|
+ rdataset->covers != dns_rdatatype_dname))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * If we're not chaining, then the DNAME and
|
||||||
|
+ * its signature should not be external.
|
||||||
|
+ */
|
||||||
|
+ if (!chaining && external) {
|
||||||
|
+ log_formerr(fctx, "external DNAME");
|
||||||
|
+ return (DNS_R_FORMERR);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
found = ISC_FALSE;
|
||||||
|
aflag = 0;
|
||||||
|
if (rdataset->type == dns_rdatatype_dname) {
|
||||||
|
- /*
|
||||||
|
- * We're looking for something else,
|
||||||
|
- * but we found a DNAME.
|
||||||
|
- *
|
||||||
|
- * If we're not chaining, then the
|
||||||
|
- * DNAME should not be external.
|
||||||
|
- */
|
||||||
|
- if (!chaining && external) {
|
||||||
|
- log_formerr(fctx,
|
||||||
|
- "external DNAME");
|
||||||
|
- return (DNS_R_FORMERR);
|
||||||
|
- }
|
||||||
|
found = ISC_TRUE;
|
||||||
|
want_chaining = ISC_TRUE;
|
||||||
|
POST(want_chaining);
|
||||||
|
@@ -6677,9 +6682,7 @@
|
||||||
|
&fctx->domain)) {
|
||||||
|
return (DNS_R_SERVFAIL);
|
||||||
|
}
|
||||||
|
- } else if (rdataset->type == dns_rdatatype_rrsig
|
||||||
|
- && rdataset->covers ==
|
||||||
|
- dns_rdatatype_dname) {
|
||||||
|
+ } else {
|
||||||
|
/*
|
||||||
|
* We've found a signature that
|
||||||
|
* covers the DNAME.
|
||||||
318
meta/recipes-connectivity/bind/bind/CVE-2016-1286_2.patch
Normal file
318
meta/recipes-connectivity/bind/bind/CVE-2016-1286_2.patch
Normal file
@@ -0,0 +1,318 @@
|
|||||||
|
From 499952eb459c9a41d2092f1d98899c131f9103b2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Mark Andrews <marka@isc.org>
|
||||||
|
Date: Mon, 29 Feb 2016 07:16:48 +1100
|
||||||
|
Subject: [PATCH] Part 2 of: 4319.[security] Fix resolver assertion
|
||||||
|
failure due to improper DNAME handling when parsing fetch reply messages.
|
||||||
|
(CVE-2016-1286) [RT #41753]
|
||||||
|
|
||||||
|
(cherry picked from commit 2de89ee9de8c8da9dc153a754b02dcdbb7fe2374)
|
||||||
|
|
||||||
|
CVE: CVE-2016-1286 [part 2]
|
||||||
|
Upstream-Status: Backport
|
||||||
|
|
||||||
|
Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
|
||||||
|
---
|
||||||
|
lib/dns/resolver.c | 192 ++++++++++++++++++++++++++---------------------------
|
||||||
|
1 file changed, 93 insertions(+), 99 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||||
|
index 23d636b..fbc0af0 100644
|
||||||
|
--- a/lib/dns/resolver.c
|
||||||
|
+++ b/lib/dns/resolver.c
|
||||||
|
@@ -6088,14 +6088,11 @@ cname_target(dns_rdataset_t *rdataset, dns_name_t *tname) {
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline isc_result_t
|
||||||
|
-dname_target(fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname,
|
||||||
|
- dns_name_t *oname, dns_fixedname_t *fixeddname)
|
||||||
|
+dname_target(dns_rdataset_t *rdataset, dns_name_t *qname,
|
||||||
|
+ unsigned int nlabels, dns_fixedname_t *fixeddname)
|
||||||
|
{
|
||||||
|
isc_result_t result;
|
||||||
|
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||||
|
- unsigned int nlabels;
|
||||||
|
- int order;
|
||||||
|
- dns_namereln_t namereln;
|
||||||
|
dns_rdata_dname_t dname;
|
||||||
|
dns_fixedname_t prefix;
|
||||||
|
|
||||||
|
@@ -6110,21 +6107,6 @@ dname_target(fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname,
|
||||||
|
if (result != ISC_R_SUCCESS)
|
||||||
|
return (result);
|
||||||
|
|
||||||
|
- /*
|
||||||
|
- * Get the prefix of qname.
|
||||||
|
- */
|
||||||
|
- namereln = dns_name_fullcompare(qname, oname, &order, &nlabels);
|
||||||
|
- if (namereln != dns_namereln_subdomain) {
|
||||||
|
- char qbuf[DNS_NAME_FORMATSIZE];
|
||||||
|
- char obuf[DNS_NAME_FORMATSIZE];
|
||||||
|
-
|
||||||
|
- dns_rdata_freestruct(&dname);
|
||||||
|
- dns_name_format(qname, qbuf, sizeof(qbuf));
|
||||||
|
- dns_name_format(oname, obuf, sizeof(obuf));
|
||||||
|
- log_formerr(fctx, "unrelated DNAME in answer: "
|
||||||
|
- "%s is not in %s", qbuf, obuf);
|
||||||
|
- return (DNS_R_FORMERR);
|
||||||
|
- }
|
||||||
|
dns_fixedname_init(&prefix);
|
||||||
|
dns_name_split(qname, nlabels, dns_fixedname_name(&prefix), NULL);
|
||||||
|
dns_fixedname_init(fixeddname);
|
||||||
|
@@ -6750,13 +6732,13 @@ static isc_result_t
|
||||||
|
answer_response(fetchctx_t *fctx) {
|
||||||
|
isc_result_t result;
|
||||||
|
dns_message_t *message;
|
||||||
|
- dns_name_t *name, *qname, tname, *ns_name;
|
||||||
|
+ dns_name_t *name, *dname, *qname, tname, *ns_name;
|
||||||
|
dns_rdataset_t *rdataset, *ns_rdataset;
|
||||||
|
isc_boolean_t done, external, chaining, aa, found, want_chaining;
|
||||||
|
isc_boolean_t have_answer, found_cname, found_type, wanted_chaining;
|
||||||
|
unsigned int aflag;
|
||||||
|
dns_rdatatype_t type;
|
||||||
|
- dns_fixedname_t dname, fqname;
|
||||||
|
+ dns_fixedname_t fdname, fqname;
|
||||||
|
dns_view_t *view;
|
||||||
|
|
||||||
|
FCTXTRACE("answer_response");
|
||||||
|
@@ -6784,10 +6766,15 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
view = fctx->res->view;
|
||||||
|
result = dns_message_firstname(message, DNS_SECTION_ANSWER);
|
||||||
|
while (!done && result == ISC_R_SUCCESS) {
|
||||||
|
+ dns_namereln_t namereln;
|
||||||
|
+ int order;
|
||||||
|
+ unsigned int nlabels;
|
||||||
|
+
|
||||||
|
name = NULL;
|
||||||
|
dns_message_currentname(message, DNS_SECTION_ANSWER, &name);
|
||||||
|
external = ISC_TF(!dns_name_issubdomain(name, &fctx->domain));
|
||||||
|
- if (dns_name_equal(name, qname)) {
|
||||||
|
+ namereln = dns_name_fullcompare(qname, name, &order, &nlabels);
|
||||||
|
+ if (namereln == dns_namereln_equal) {
|
||||||
|
wanted_chaining = ISC_FALSE;
|
||||||
|
for (rdataset = ISC_LIST_HEAD(name->list);
|
||||||
|
rdataset != NULL;
|
||||||
|
@@ -6912,10 +6899,11 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
*/
|
||||||
|
INSIST(!external);
|
||||||
|
if (aflag ==
|
||||||
|
- DNS_RDATASETATTR_ANSWER)
|
||||||
|
+ DNS_RDATASETATTR_ANSWER) {
|
||||||
|
have_answer = ISC_TRUE;
|
||||||
|
- name->attributes |=
|
||||||
|
- DNS_NAMEATTR_ANSWER;
|
||||||
|
+ name->attributes |=
|
||||||
|
+ DNS_NAMEATTR_ANSWER;
|
||||||
|
+ }
|
||||||
|
rdataset->attributes |= aflag;
|
||||||
|
if (aa)
|
||||||
|
rdataset->trust =
|
||||||
|
@@ -6970,6 +6958,8 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
if (wanted_chaining)
|
||||||
|
chaining = ISC_TRUE;
|
||||||
|
} else {
|
||||||
|
+ dns_rdataset_t *dnameset = NULL;
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Look for a DNAME (or its SIG). Anything else is
|
||||||
|
* ignored.
|
||||||
|
@@ -6977,10 +6967,8 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
wanted_chaining = ISC_FALSE;
|
||||||
|
for (rdataset = ISC_LIST_HEAD(name->list);
|
||||||
|
rdataset != NULL;
|
||||||
|
- rdataset = ISC_LIST_NEXT(rdataset, link)) {
|
||||||
|
- isc_boolean_t found_dname = ISC_FALSE;
|
||||||
|
- dns_name_t *dname_name;
|
||||||
|
-
|
||||||
|
+ rdataset = ISC_LIST_NEXT(rdataset, link))
|
||||||
|
+ {
|
||||||
|
/*
|
||||||
|
* Only pass DNAME or RRSIG(DNAME).
|
||||||
|
*/
|
||||||
|
@@ -6994,20 +6982,41 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
* its signature should not be external.
|
||||||
|
*/
|
||||||
|
if (!chaining && external) {
|
||||||
|
- log_formerr(fctx, "external DNAME");
|
||||||
|
+ char qbuf[DNS_NAME_FORMATSIZE];
|
||||||
|
+ char obuf[DNS_NAME_FORMATSIZE];
|
||||||
|
+
|
||||||
|
+ dns_name_format(name, qbuf,
|
||||||
|
+ sizeof(qbuf));
|
||||||
|
+ dns_name_format(&fctx->domain, obuf,
|
||||||
|
+ sizeof(obuf));
|
||||||
|
+ log_formerr(fctx, "external DNAME or "
|
||||||
|
+ "RRSIG covering DNAME "
|
||||||
|
+ "in answer: %s is "
|
||||||
|
+ "not in %s", qbuf, obuf);
|
||||||
|
+ return (DNS_R_FORMERR);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (namereln != dns_namereln_subdomain) {
|
||||||
|
+ char qbuf[DNS_NAME_FORMATSIZE];
|
||||||
|
+ char obuf[DNS_NAME_FORMATSIZE];
|
||||||
|
+
|
||||||
|
+ dns_name_format(qname, qbuf,
|
||||||
|
+ sizeof(qbuf));
|
||||||
|
+ dns_name_format(name, obuf,
|
||||||
|
+ sizeof(obuf));
|
||||||
|
+ log_formerr(fctx, "unrelated DNAME "
|
||||||
|
+ "in answer: %s is "
|
||||||
|
+ "not in %s", qbuf, obuf);
|
||||||
|
return (DNS_R_FORMERR);
|
||||||
|
}
|
||||||
|
|
||||||
|
- found = ISC_FALSE;
|
||||||
|
aflag = 0;
|
||||||
|
if (rdataset->type == dns_rdatatype_dname) {
|
||||||
|
- found = ISC_TRUE;
|
||||||
|
want_chaining = ISC_TRUE;
|
||||||
|
POST(want_chaining);
|
||||||
|
aflag = DNS_RDATASETATTR_ANSWER;
|
||||||
|
- result = dname_target(fctx, rdataset,
|
||||||
|
- qname, name,
|
||||||
|
- &dname);
|
||||||
|
+ result = dname_target(rdataset, qname,
|
||||||
|
+ nlabels, &fdname);
|
||||||
|
if (result == ISC_R_NOSPACE) {
|
||||||
|
/*
|
||||||
|
* We can't construct the
|
||||||
|
@@ -7019,14 +7028,12 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
} else if (result != ISC_R_SUCCESS)
|
||||||
|
return (result);
|
||||||
|
else
|
||||||
|
- found_dname = ISC_TRUE;
|
||||||
|
+ dnameset = rdataset;
|
||||||
|
|
||||||
|
- dname_name = dns_fixedname_name(&dname);
|
||||||
|
+ dname = dns_fixedname_name(&fdname);
|
||||||
|
if (!is_answertarget_allowed(view,
|
||||||
|
- qname,
|
||||||
|
- rdataset->type,
|
||||||
|
- dname_name,
|
||||||
|
- &fctx->domain)) {
|
||||||
|
+ qname, rdataset->type,
|
||||||
|
+ dname, &fctx->domain)) {
|
||||||
|
return (DNS_R_SERVFAIL);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
@@ -7034,73 +7041,60 @@ answer_response(fetchctx_t *fctx) {
|
||||||
|
* We've found a signature that
|
||||||
|
* covers the DNAME.
|
||||||
|
*/
|
||||||
|
- found = ISC_TRUE;
|
||||||
|
aflag = DNS_RDATASETATTR_ANSWERSIG;
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (found) {
|
||||||
|
+ /*
|
||||||
|
+ * We've found an answer to our
|
||||||
|
+ * question.
|
||||||
|
+ */
|
||||||
|
+ name->attributes |= DNS_NAMEATTR_CACHE;
|
||||||
|
+ rdataset->attributes |= DNS_RDATASETATTR_CACHE;
|
||||||
|
+ rdataset->trust = dns_trust_answer;
|
||||||
|
+ if (!chaining) {
|
||||||
|
/*
|
||||||
|
- * We've found an answer to our
|
||||||
|
- * question.
|
||||||
|
+ * This data is "the" answer to
|
||||||
|
+ * our question only if we're
|
||||||
|
+ * not chaining.
|
||||||
|
*/
|
||||||
|
- name->attributes |=
|
||||||
|
- DNS_NAMEATTR_CACHE;
|
||||||
|
- rdataset->attributes |=
|
||||||
|
- DNS_RDATASETATTR_CACHE;
|
||||||
|
- rdataset->trust = dns_trust_answer;
|
||||||
|
- if (!chaining) {
|
||||||
|
- /*
|
||||||
|
- * This data is "the" answer
|
||||||
|
- * to our question only if
|
||||||
|
- * we're not chaining.
|
||||||
|
- */
|
||||||
|
- INSIST(!external);
|
||||||
|
- if (aflag ==
|
||||||
|
- DNS_RDATASETATTR_ANSWER)
|
||||||
|
- have_answer = ISC_TRUE;
|
||||||
|
+ INSIST(!external);
|
||||||
|
+ if (aflag == DNS_RDATASETATTR_ANSWER) {
|
||||||
|
+ have_answer = ISC_TRUE;
|
||||||
|
name->attributes |=
|
||||||
|
DNS_NAMEATTR_ANSWER;
|
||||||
|
- rdataset->attributes |= aflag;
|
||||||
|
- if (aa)
|
||||||
|
- rdataset->trust =
|
||||||
|
- dns_trust_authanswer;
|
||||||
|
- } else if (external) {
|
||||||
|
- rdataset->attributes |=
|
||||||
|
- DNS_RDATASETATTR_EXTERNAL;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /*
|
||||||
|
- * DNAME chaining.
|
||||||
|
- */
|
||||||
|
- if (found_dname) {
|
||||||
|
- /*
|
||||||
|
- * Copy the dname into the
|
||||||
|
- * qname fixed name.
|
||||||
|
- *
|
||||||
|
- * Although we check for
|
||||||
|
- * failure of the copy
|
||||||
|
- * operation, in practice it
|
||||||
|
- * should never fail since
|
||||||
|
- * we already know that the
|
||||||
|
- * result fits in a fixedname.
|
||||||
|
- */
|
||||||
|
- dns_fixedname_init(&fqname);
|
||||||
|
- result = dns_name_copy(
|
||||||
|
- dns_fixedname_name(&dname),
|
||||||
|
- dns_fixedname_name(&fqname),
|
||||||
|
- NULL);
|
||||||
|
- if (result != ISC_R_SUCCESS)
|
||||||
|
- return (result);
|
||||||
|
- wanted_chaining = ISC_TRUE;
|
||||||
|
- name->attributes |=
|
||||||
|
- DNS_NAMEATTR_CHAINING;
|
||||||
|
- rdataset->attributes |=
|
||||||
|
- DNS_RDATASETATTR_CHAINING;
|
||||||
|
- qname = dns_fixedname_name(
|
||||||
|
- &fqname);
|
||||||
|
}
|
||||||
|
+ rdataset->attributes |= aflag;
|
||||||
|
+ if (aa)
|
||||||
|
+ rdataset->trust =
|
||||||
|
+ dns_trust_authanswer;
|
||||||
|
+ } else if (external) {
|
||||||
|
+ rdataset->attributes |=
|
||||||
|
+ DNS_RDATASETATTR_EXTERNAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * DNAME chaining.
|
||||||
|
+ */
|
||||||
|
+ if (dnameset != NULL) {
|
||||||
|
+ /*
|
||||||
|
+ * Copy the dname into the qname fixed name.
|
||||||
|
+ *
|
||||||
|
+ * Although we check for failure of the copy
|
||||||
|
+ * operation, in practice it should never fail
|
||||||
|
+ * since we already know that the result fits
|
||||||
|
+ * in a fixedname.
|
||||||
|
+ */
|
||||||
|
+ dns_fixedname_init(&fqname);
|
||||||
|
+ qname = dns_fixedname_name(&fqname);
|
||||||
|
+ result = dns_name_copy(dname, qname, NULL);
|
||||||
|
+ if (result != ISC_R_SUCCESS)
|
||||||
|
+ return (result);
|
||||||
|
+ wanted_chaining = ISC_TRUE;
|
||||||
|
+ name->attributes |= DNS_NAMEATTR_CHAINING;
|
||||||
|
+ dnameset->attributes |=
|
||||||
|
+ DNS_RDATASETATTR_CHAINING;
|
||||||
|
+ }
|
||||||
|
if (wanted_chaining)
|
||||||
|
chaining = ISC_TRUE;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.9.1
|
||||||
|
|
||||||
@@ -21,6 +21,13 @@ SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
|
|||||||
file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
|
file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
|
||||||
file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
|
file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
|
||||||
file://0001-lib-dns-gen.c-fix-too-long-error.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 \
|
||||||
|
file://CVE-2016-1285.patch \
|
||||||
|
file://CVE-2016-1286_1.patch \
|
||||||
|
file://CVE-2016-1286_2.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "8b1f5064837756c938eadc1537dec5c7"
|
SRC_URI[md5sum] = "8b1f5064837756c938eadc1537dec5c7"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
|
|||||||
|
|
||||||
SRC_URI = "\
|
SRC_URI = "\
|
||||||
${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
|
${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'file://0001-Allow-using-obexd-without-systemd-in-the-user-sessio.patch', d)} \
|
||||||
"
|
"
|
||||||
S = "${WORKDIR}/bluez-${PV}"
|
S = "${WORKDIR}/bluez-${PV}"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
From: Giovanni Campagna <gcampagna-cNUdlRotFMnNLxjTenLetw@public.gmane.org>
|
||||||
|
Date: Sat, 12 Oct 2013 17:45:25 +0200
|
||||||
|
Subject: [PATCH] Allow using obexd without systemd in the user session
|
||||||
|
|
||||||
|
Not all sessions run systemd --user (actually, the majority
|
||||||
|
doesn't), so the dbus daemon must be able to spawn obexd
|
||||||
|
directly, and to do so it needs the full path of the daemon.
|
||||||
|
|
||||||
|
Upstream-Status: Denied
|
||||||
|
|
||||||
|
Not accepted by upstream maintainer for being a distro specific
|
||||||
|
configuration. See thread:
|
||||||
|
|
||||||
|
http://thread.gmane.org/gmane.linux.bluez.kernel/38725/focus=38843
|
||||||
|
|
||||||
|
Signed-off-by: Javier Viguera <javier.viguera@digi.com>
|
||||||
|
---
|
||||||
|
Makefile.obexd | 4 ++--
|
||||||
|
obexd/src/org.bluez.obex.service | 4 ----
|
||||||
|
obexd/src/org.bluez.obex.service.in | 4 ++++
|
||||||
|
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
delete mode 100644 obexd/src/org.bluez.obex.service
|
||||||
|
create mode 100644 obexd/src/org.bluez.obex.service.in
|
||||||
|
|
||||||
|
diff --git a/Makefile.obexd b/Makefile.obexd
|
||||||
|
index 2e33cbc72f2b..d5d858c857b4 100644
|
||||||
|
--- a/Makefile.obexd
|
||||||
|
+++ b/Makefile.obexd
|
||||||
|
@@ -2,12 +2,12 @@
|
||||||
|
if SYSTEMD
|
||||||
|
systemduserunitdir = @SYSTEMD_USERUNITDIR@
|
||||||
|
systemduserunit_DATA = obexd/src/obex.service
|
||||||
|
+endif
|
||||||
|
|
||||||
|
dbussessionbusdir = @DBUS_SESSIONBUSDIR@
|
||||||
|
dbussessionbus_DATA = obexd/src/org.bluez.obex.service
|
||||||
|
-endif
|
||||||
|
|
||||||
|
-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
|
||||||
|
+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
|
||||||
|
|
||||||
|
obex_plugindir = $(libdir)/obex/plugins
|
||||||
|
|
||||||
|
diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
|
||||||
|
deleted file mode 100644
|
||||||
|
index a53808884554..000000000000
|
||||||
|
--- a/obexd/src/org.bluez.obex.service
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,4 +0,0 @@
|
||||||
|
-[D-BUS Service]
|
||||||
|
-Name=org.bluez.obex
|
||||||
|
-Exec=/bin/false
|
||||||
|
-SystemdService=dbus-org.bluez.obex.service
|
||||||
|
diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
|
||||||
|
new file mode 100644
|
||||||
|
index 000000000000..9c815f246b77
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/obexd/src/org.bluez.obex.service.in
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+[D-BUS Service]
|
||||||
|
+Name=org.bluez.obex
|
||||||
|
+Exec=@libexecdir@/obexd
|
||||||
|
+SystemdService=dbus-org.bluez.obex.service
|
||||||
99
meta/recipes-connectivity/dhcp/dhcp/CVE-2015-8605.patch
Normal file
99
meta/recipes-connectivity/dhcp/dhcp/CVE-2015-8605.patch
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
Solves CVE-2015-8605 that caused DoS when an invalid lenght field in IPv4 UDP
|
||||||
|
was recived by the server.
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
CVE: CVE-2015-8605
|
||||||
|
|
||||||
|
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
diff --git a/common/packet.c b/common/packet.c
|
||||||
|
index b530432..e600e37 100644
|
||||||
|
--- a/common/packet.c
|
||||||
|
+++ b/common/packet.c
|
||||||
|
@@ -220,7 +220,28 @@ ssize_t decode_hw_header (interface, buf, bufix, from)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-/* UDP header and IP header decoded together for convenience. */
|
||||||
|
+/*!
|
||||||
|
+ *
|
||||||
|
+ * \brief UDP header and IP header decoded together for convenience.
|
||||||
|
+ *
|
||||||
|
+ * Attempt to decode the UDP and IP headers and, if necessary, checksum
|
||||||
|
+ * the packet.
|
||||||
|
+ *
|
||||||
|
+ * \param inteface - the interface on which the packet was recevied
|
||||||
|
+ * \param buf - a pointer to the buffer for the received packet
|
||||||
|
+ * \param bufix - where to start processing the buffer, previous
|
||||||
|
+ * routines may have processed parts of the buffer already
|
||||||
|
+ * \param from - space to return the address of the packet sender
|
||||||
|
+ * \param buflen - remaining length of the buffer, this will have been
|
||||||
|
+ * decremented by bufix by the caller
|
||||||
|
+ * \param rbuflen - space to return the length of the payload from the udp
|
||||||
|
+ * header
|
||||||
|
+ * \param csum_ready - indication if the checksum is valid for use
|
||||||
|
+ * non-zero indicates the checksum should be validated
|
||||||
|
+ *
|
||||||
|
+ * \return - the index to the first byte of the udp payload (that is the
|
||||||
|
+ * start of the DHCP packet
|
||||||
|
+ */
|
||||||
|
|
||||||
|
ssize_t
|
||||||
|
decode_udp_ip_header(struct interface_info *interface,
|
||||||
|
@@ -231,7 +252,7 @@ decode_udp_ip_header(struct interface_info *interface,
|
||||||
|
unsigned char *data;
|
||||||
|
struct ip ip;
|
||||||
|
struct udphdr udp;
|
||||||
|
- unsigned char *upp, *endbuf;
|
||||||
|
+ unsigned char *upp;
|
||||||
|
u_int32_t ip_len, ulen, pkt_len;
|
||||||
|
static unsigned int ip_packets_seen = 0;
|
||||||
|
static unsigned int ip_packets_bad_checksum = 0;
|
||||||
|
@@ -241,11 +262,8 @@ decode_udp_ip_header(struct interface_info *interface,
|
||||||
|
static unsigned int udp_packets_length_overflow = 0;
|
||||||
|
unsigned len;
|
||||||
|
|
||||||
|
- /* Designate the end of the input buffer for bounds checks. */
|
||||||
|
- endbuf = buf + bufix + buflen;
|
||||||
|
-
|
||||||
|
/* Assure there is at least an IP header there. */
|
||||||
|
- if ((buf + bufix + sizeof(ip)) > endbuf)
|
||||||
|
+ if (sizeof(ip) > buflen)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* Copy the IP header into a stack aligned structure for inspection.
|
||||||
|
@@ -257,13 +275,17 @@ decode_udp_ip_header(struct interface_info *interface,
|
||||||
|
ip_len = (*upp & 0x0f) << 2;
|
||||||
|
upp += ip_len;
|
||||||
|
|
||||||
|
- /* Check the IP packet length. */
|
||||||
|
+ /* Check packet lengths are within the buffer:
|
||||||
|
+ * first the ip header (ip_len)
|
||||||
|
+ * then the packet length from the ip header (pkt_len)
|
||||||
|
+ * then the udp header (ip_len + sizeof(udp)
|
||||||
|
+ * We are liberal in what we accept, the udp payload should fit within
|
||||||
|
+ * pkt_len, but we only check against the full buffer size.
|
||||||
|
+ */
|
||||||
|
pkt_len = ntohs(ip.ip_len);
|
||||||
|
- if (pkt_len > buflen)
|
||||||
|
- return -1;
|
||||||
|
-
|
||||||
|
- /* Assure after ip_len bytes that there is enough room for a UDP header. */
|
||||||
|
- if ((upp + sizeof(udp)) > endbuf)
|
||||||
|
+ if ((ip_len > buflen) ||
|
||||||
|
+ (pkt_len > buflen) ||
|
||||||
|
+ ((ip_len + sizeof(udp)) > buflen))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* Copy the UDP header into a stack aligned structure for inspection. */
|
||||||
|
@@ -284,7 +306,8 @@ decode_udp_ip_header(struct interface_info *interface,
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
udp_packets_length_checked++;
|
||||||
|
- if ((upp + ulen) > endbuf) {
|
||||||
|
+ /* verify that the payload length from the udp packet fits in the buffer */
|
||||||
|
+ if ((ip_len + ulen) > buflen) {
|
||||||
|
udp_packets_length_overflow++;
|
||||||
|
if (((udp_packets_length_checked > 4) &&
|
||||||
|
(udp_packets_length_overflow != 0)) &&
|
||||||
@@ -6,6 +6,7 @@ SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
|
|||||||
file://fixsepbuild.patch \
|
file://fixsepbuild.patch \
|
||||||
file://dhclient-script-drop-resolv.conf.dhclient.patch \
|
file://dhclient-script-drop-resolv.conf.dhclient.patch \
|
||||||
file://replace-ifconfig-route.patch \
|
file://replace-ifconfig-route.patch \
|
||||||
|
file://CVE-2015-8605.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "5a284875dd2c12ddd388416d69156a67"
|
SRC_URI[md5sum] = "5a284875dd2c12ddd388416d69156a67"
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
From 398fed3bb0350cb1229e54e7020ae0e044c206d1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
|
||||||
|
Date: Wed, 17 Feb 2016 08:33:45 +0100
|
||||||
|
Subject: bugfix: adjust statd service name
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Upstream uses 'rpc-statd.service' and Yocto introduced 'nfs-statd.service'
|
||||||
|
instead but forgot to update the mount.nfs helper 'start-statd' accordingly.
|
||||||
|
|
||||||
|
Upstream-Status: Inappropriate [other]
|
||||||
|
|
||||||
|
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
|
||||||
|
---
|
||||||
|
utils/statd/start-statd | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
|
||||||
|
index 8211a90..3c2aa6f 100755
|
||||||
|
--- a/utils/statd/start-statd
|
||||||
|
+++ b/utils/statd/start-statd
|
||||||
|
@@ -16,7 +16,7 @@ fi
|
||||||
|
# First try systemd if it's installed.
|
||||||
|
if [ -d /run/systemd/system ]; then
|
||||||
|
# Quit only if the call worked.
|
||||||
|
- systemctl start rpc-statd.service && exit
|
||||||
|
+ systemctl start nfs-statd.service && exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fall back to launching it ourselves.
|
||||||
|
--
|
||||||
|
2.1.4
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
|
|||||||
file://proc-fs-nfsd.mount \
|
file://proc-fs-nfsd.mount \
|
||||||
file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
|
file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
|
||||||
file://nfs-utils-debianize-start-statd.patch \
|
file://nfs-utils-debianize-start-statd.patch \
|
||||||
|
file://bugfix-adjust-statd-service-name.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "8de676b9ff34b8f9addc1d0800fabdf8"
|
SRC_URI[md5sum] = "8de676b9ff34b8f9addc1d0800fabdf8"
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
From 4b4bfb01cd40b9ddb948e6026ddd287cc303d871 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "djm@openbsd.org" <djm@openbsd.org>
|
||||||
|
Date: Thu, 10 Mar 2016 11:47:57 +0000
|
||||||
|
Subject: [PATCH] upstream commit
|
||||||
|
|
||||||
|
sanitise characters destined for xauth reported by
|
||||||
|
github.com/tintinweb feedback and ok deraadt and markus
|
||||||
|
|
||||||
|
Upstream-ID: 18ad8d0d74cbd2ea3306a16595a306ee356aa261
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
CVE: CVE-2016-3115
|
||||||
|
https://anongit.mindrot.org/openssh.git/commit/?id=4b4bfb01cd40b9ddb948e6026ddd287cc303d871
|
||||||
|
|
||||||
|
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
session.c | 34 +++++++++++++++++++++++++++++++---
|
||||||
|
1 file changed, 31 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
Index: openssh-7.1p2/session.c
|
||||||
|
===================================================================
|
||||||
|
--- openssh-7.1p2.orig/session.c
|
||||||
|
+++ openssh-7.1p2/session.c
|
||||||
|
@@ -46,6 +46,7 @@
|
||||||
|
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
+#include <ctype.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <grp.h>
|
||||||
|
@@ -273,6 +274,21 @@ do_authenticated(Authctxt *authctxt)
|
||||||
|
do_cleanup(authctxt);
|
||||||
|
}
|
||||||
|
|
||||||
|
+/* Check untrusted xauth strings for metacharacters */
|
||||||
|
+static int
|
||||||
|
+xauth_valid_string(const char *s)
|
||||||
|
+{
|
||||||
|
+ size_t i;
|
||||||
|
+
|
||||||
|
+ for (i = 0; s[i] != '\0'; i++) {
|
||||||
|
+ if (!isalnum((u_char)s[i]) &&
|
||||||
|
+ s[i] != '.' && s[i] != ':' && s[i] != '/' &&
|
||||||
|
+ s[i] != '-' && s[i] != '_')
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Prepares for an interactive session. This is called after the user has
|
||||||
|
* been successfully authenticated. During this message exchange, pseudo
|
||||||
|
@@ -346,7 +362,13 @@ do_authenticated1(Authctxt *authctxt)
|
||||||
|
s->screen = 0;
|
||||||
|
}
|
||||||
|
packet_check_eom();
|
||||||
|
- success = session_setup_x11fwd(s);
|
||||||
|
+ if (xauth_valid_string(s->auth_proto) &&
|
||||||
|
+ xauth_valid_string(s->auth_data))
|
||||||
|
+ success = session_setup_x11fwd(s);
|
||||||
|
+ else {
|
||||||
|
+ success = 0;
|
||||||
|
+ error("Invalid X11 forwarding data");
|
||||||
|
+ }
|
||||||
|
if (!success) {
|
||||||
|
free(s->auth_proto);
|
||||||
|
free(s->auth_data);
|
||||||
|
@@ -2181,7 +2203,13 @@ session_x11_req(Session *s)
|
||||||
|
s->screen = packet_get_int();
|
||||||
|
packet_check_eom();
|
||||||
|
|
||||||
|
- success = session_setup_x11fwd(s);
|
||||||
|
+ if (xauth_valid_string(s->auth_proto) &&
|
||||||
|
+ xauth_valid_string(s->auth_data))
|
||||||
|
+ success = session_setup_x11fwd(s);
|
||||||
|
+ else {
|
||||||
|
+ success = 0;
|
||||||
|
+ error("Invalid X11 forwarding data");
|
||||||
|
+ }
|
||||||
|
if (!success) {
|
||||||
|
free(s->auth_proto);
|
||||||
|
free(s->auth_data);
|
||||||
@@ -20,12 +20,17 @@ SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.
|
|||||||
file://sshdgenkeys.service \
|
file://sshdgenkeys.service \
|
||||||
file://volatiles.99_sshd \
|
file://volatiles.99_sshd \
|
||||||
file://add-test-support-for-busybox.patch \
|
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 \
|
||||||
|
file://CVE-2016-3115.patch \
|
||||||
|
"
|
||||||
|
|
||||||
PAM_SRC_URI = "file://sshd"
|
PAM_SRC_URI = "file://sshd"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "8709736bc8a8c253bc4eeb4829888ca5"
|
SRC_URI[md5sum] = "4d8547670e2a220d5ef805ad9e47acf2"
|
||||||
SRC_URI[sha256sum] = "fc0a6d2d1d063d5c66dffd952493d0cda256cad204f681de0f84ef85b2ad8428"
|
SRC_URI[sha256sum] = "dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd"
|
||||||
|
|
||||||
inherit useradd update-rc.d update-alternatives systemd
|
inherit useradd update-rc.d update-alternatives systemd
|
||||||
|
|
||||||
@@ -17,15 +17,13 @@ URL: https://bugs.gentoo.org/542618
|
|||||||
|
|
||||||
Signed-off-By: Armin Kuster <akuster@mvista.com>
|
Signed-off-By: Armin Kuster <akuster@mvista.com>
|
||||||
|
|
||||||
Index: openssl-1.0.2a/crypto/perlasm/x86_64-xlate.pl
|
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
|
||||||
===================================================================
|
--- a/crypto/perlasm/x86_64-xlate.pl
|
||||||
--- openssl-1.0.2a.orig/crypto/perlasm/x86_64-xlate.pl
|
+++ b/crypto/perlasm/x86_64-xlate.pl
|
||||||
+++ openssl-1.0.2a/crypto/perlasm/x86_64-xlate.pl
|
@@ -196,6 +196,10 @@ my %globals;
|
||||||
@@ -194,7 +194,10 @@ my %globals;
|
|
||||||
}
|
|
||||||
sub out {
|
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
-
|
|
||||||
|
$self->{value} =~ s/\b(0b[0-1]+)/oct($1)/eig;
|
||||||
+ # When building on x32 ABIs, the expanded hex value might be too
|
+ # When building on x32 ABIs, the expanded hex value might be too
|
||||||
+ # big to fit into 32bits. Enable transparent 64bit support here
|
+ # big to fit into 32bits. Enable transparent 64bit support here
|
||||||
+ # so we can safely print it out.
|
+ # so we can safely print it out.
|
||||||
|
|||||||
@@ -9,14 +9,15 @@ Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
|
|||||||
Reviewed-by: Dr Stephen N Henson <shenson@drh-consultancy.co.uk>
|
Reviewed-by: Dr Stephen N Henson <shenson@drh-consultancy.co.uk>
|
||||||
|
|
||||||
This is not meant as final patch.
|
This is not meant as final patch.
|
||||||
|
|
||||||
Upstream-Status: Backport [debian]
|
Upstream-Status: Backport [debian]
|
||||||
|
|
||||||
|
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||||
|
|
||||||
Index: openssl-1.0.2/crypto/x509/x509_vfy.c
|
Index: openssl-1.0.2g/crypto/x509/x509_vfy.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- openssl-1.0.2.orig/crypto/x509/x509_vfy.c
|
--- openssl-1.0.2g.orig/crypto/x509/x509_vfy.c
|
||||||
+++ openssl-1.0.2/crypto/x509/x509_vfy.c
|
+++ openssl-1.0.2g/crypto/x509/x509_vfy.c
|
||||||
@@ -119,6 +119,7 @@ static int check_trust(X509_STORE_CTX *c
|
@@ -119,6 +119,7 @@ static int check_trust(X509_STORE_CTX *c
|
||||||
static int check_revocation(X509_STORE_CTX *ctx);
|
static int check_revocation(X509_STORE_CTX *ctx);
|
||||||
static int check_cert(X509_STORE_CTX *ctx);
|
static int check_cert(X509_STORE_CTX *ctx);
|
||||||
@@ -25,17 +26,17 @@ Index: openssl-1.0.2/crypto/x509/x509_vfy.c
|
|||||||
|
|
||||||
static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
|
static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
|
||||||
unsigned int *preasons, X509_CRL *crl, X509 *x);
|
unsigned int *preasons, X509_CRL *crl, X509 *x);
|
||||||
@@ -438,6 +439,9 @@ int X509_verify_cert(X509_STORE_CTX *ctx
|
@@ -489,6 +490,9 @@ int X509_verify_cert(X509_STORE_CTX *ctx
|
||||||
if (!ok)
|
if (!ok)
|
||||||
goto end;
|
goto err;
|
||||||
|
|
||||||
+ ok = check_ca_blacklist(ctx);
|
+ ok = check_ca_blacklist(ctx);
|
||||||
+ if(!ok) goto end;
|
+ if(!ok) goto err;
|
||||||
+
|
+
|
||||||
#ifndef OPENSSL_NO_RFC3779
|
#ifndef OPENSSL_NO_RFC3779
|
||||||
/* RFC 3779 path validation, now that CRL check has been done */
|
/* RFC 3779 path validation, now that CRL check has been done */
|
||||||
ok = v3_asid_validate_path(ctx);
|
ok = v3_asid_validate_path(ctx);
|
||||||
@@ -938,6 +942,29 @@ static int check_crl_time(X509_STORE_CTX
|
@@ -996,6 +1000,29 @@ static int check_crl_time(X509_STORE_CTX
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld 2014-02-24 22:19:08.601827266 +0100
|
+++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld 2014-02-24 22:19:08.601827266 +0100
|
||||||
@@ -0,0 +1,4615 @@
|
@@ -0,0 +1,4621 @@
|
||||||
+OPENSSL_1.0.0 {
|
+OPENSSL_1.0.0 {
|
||||||
+ global:
|
+ global:
|
||||||
+ BIO_f_ssl;
|
+ BIO_f_ssl;
|
||||||
@@ -4631,6 +4631,12 @@ Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld
|
|||||||
+ SSL_test_functions;
|
+ SSL_test_functions;
|
||||||
+} OPENSSL_1.0.1d;
|
+} OPENSSL_1.0.1d;
|
||||||
+
|
+
|
||||||
|
+OPENSSL_1.0.2g {
|
||||||
|
+ global:
|
||||||
|
+ SRP_VBASE_get1_by_user;
|
||||||
|
+ SRP_user_pwd_free;
|
||||||
|
+} OPENSSL_1.0.2;
|
||||||
|
+
|
||||||
Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/openssl.ld
|
Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/openssl.ld
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
@@ -8,16 +8,16 @@ http://www.mail-archive.com/openssl-dev@openssl.org/msg32860.html
|
|||||||
|
|
||||||
Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
|
Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
|
||||||
---
|
---
|
||||||
Index: openssl-1.0.2/crypto/evp/digest.c
|
Index: openssl-1.0.2h/crypto/evp/digest.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- openssl-1.0.2.orig/crypto/evp/digest.c
|
--- openssl-1.0.2h.orig/crypto/evp/digest.c
|
||||||
+++ openssl-1.0.2/crypto/evp/digest.c
|
+++ openssl-1.0.2h/crypto/evp/digest.c
|
||||||
@@ -208,7 +208,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c
|
@@ -211,7 +211,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c
|
||||||
return 0;
|
type = ctx->digest;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
- if (ctx->digest != type) {
|
- if (ctx->digest != type) {
|
||||||
+ if (type && (ctx->digest != type)) {
|
+ if (type && (ctx->digest != type)) {
|
||||||
if (ctx->digest && ctx->digest->ctx_size)
|
if (ctx->digest && ctx->digest->ctx_size) {
|
||||||
OPENSSL_free(ctx->md_data);
|
OPENSSL_free(ctx->md_data);
|
||||||
ctx->digest = type;
|
ctx->md_data = NULL;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ DEPENDS += "cryptodev-linux"
|
|||||||
|
|
||||||
CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
|
CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
|
||||||
|
|
||||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=27ffa5d74bb5a337056c14b2ef93fbf6"
|
||||||
|
|
||||||
export DIRS = "crypto ssl apps engines"
|
export DIRS = "crypto ssl apps engines"
|
||||||
export OE_LDFLAGS="${LDFLAGS}"
|
export OE_LDFLAGS="${LDFLAGS}"
|
||||||
@@ -25,7 +25,7 @@ SRC_URI += "file://configure-targets.patch \
|
|||||||
file://debian/no-rpath.patch \
|
file://debian/no-rpath.patch \
|
||||||
file://debian/no-symbolic.patch \
|
file://debian/no-symbolic.patch \
|
||||||
file://debian/pic.patch \
|
file://debian/pic.patch \
|
||||||
file://debian/version-script.patch \
|
file://debian1.0.2/version-script.patch \
|
||||||
file://openssl_fix_for_x32.patch \
|
file://openssl_fix_for_x32.patch \
|
||||||
file://fix-cipher-des-ede3-cfb1.patch \
|
file://fix-cipher-des-ede3-cfb1.patch \
|
||||||
file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
|
file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
|
||||||
@@ -39,8 +39,8 @@ SRC_URI += "file://configure-targets.patch \
|
|||||||
file://ptest_makefile_deps.patch \
|
file://ptest_makefile_deps.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "38dd619b2e77cbac69b99f52a053d25a"
|
SRC_URI[md5sum] = "9392e65072ce4b614c1392eefc1f23d0"
|
||||||
SRC_URI[sha256sum] = "671c36487785628a703374c652ad2cebea45fa920ae5681515df25d9f2c9a8c8"
|
SRC_URI[sha256sum] = "1d4007e53aad94a5b2002fe045ee7bb0b3d98f1a47f8b2bc851dcd1c74332919"
|
||||||
|
|
||||||
PACKAGES =+ " \
|
PACKAGES =+ " \
|
||||||
${PN}-engines \
|
${PN}-engines \
|
||||||
@@ -56,3 +56,13 @@ PARALLEL_MAKEINST = ""
|
|||||||
do_configure_prepend() {
|
do_configure_prepend() {
|
||||||
cp ${WORKDIR}/find.pl ${S}/util/find.pl
|
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 \
|
SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
|
||||||
file://Makefile.in-fix-for-parallel-build.patch \
|
file://Makefile.in-fix-for-parallel-build.patch \
|
||||||
|
file://CVE-2016-2217.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[md5sum] = "b607edb65bc6c57f4a43f06247504274"
|
SRC_URI[md5sum] = "b607edb65bc6c57f4a43f06247504274"
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
From c13401c723a039971bcd91b3856d76c6041b15f2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jouni Malinen <j@w1.fi>
|
||||||
|
Date: Fri, 13 Nov 2015 05:54:18 -0500
|
||||||
|
Subject: [PATCH] NFC: Fix payload length validation in NDEF record parser
|
||||||
|
|
||||||
|
It was possible for the 32-bit record->total_length value to end up
|
||||||
|
wrapping around due to integer overflow if the longer form of payload
|
||||||
|
length field is used and record->payload_length gets a value close to
|
||||||
|
2^32. This could result in ndef_parse_record() accepting a too large
|
||||||
|
payload length value and the record type filter reading up to about 20
|
||||||
|
bytes beyond the end of the buffer and potentially killing the process.
|
||||||
|
This could also result in an attempt to allocate close to 2^32 bytes of
|
||||||
|
heap memory and if that were to succeed, a buffer read overflow of the
|
||||||
|
same length which would most likely result in the process termination.
|
||||||
|
In case of record->total_length ending up getting the value 0, there
|
||||||
|
would be no buffer read overflow, but record parsing would result in an
|
||||||
|
infinite loop in ndef_parse_records().
|
||||||
|
|
||||||
|
Any of these error cases could potentially be used for denial of service
|
||||||
|
attacks over NFC by using a malformed NDEF record on an NFC Tag or
|
||||||
|
sending them during NFC connection handover if the application providing
|
||||||
|
the NDEF message to hostapd/wpa_supplicant did no validation of the
|
||||||
|
received records. While such validation is likely done in the NFC stack
|
||||||
|
that needs to parse the NFC messages before further processing,
|
||||||
|
hostapd/wpa_supplicant better be prepared for any data being included
|
||||||
|
here.
|
||||||
|
|
||||||
|
Fix this by validating record->payload_length value in a way that
|
||||||
|
detects integer overflow. (CID 122668)
|
||||||
|
|
||||||
|
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||||
|
|
||||||
|
Upstream-Status: Backport [from http://w1.fi/security/2015-5/]
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
src/wps/ndef.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/wps/ndef.c b/src/wps/ndef.c
|
||||||
|
index d45dfc8..f7f729b 100644
|
||||||
|
--- a/src/wps/ndef.c
|
||||||
|
+++ b/src/wps/ndef.c
|
||||||
|
@@ -48,6 +48,8 @@ static int ndef_parse_record(const u8 *data, u32 size,
|
||||||
|
if (size < 6)
|
||||||
|
return -1;
|
||||||
|
record->payload_length = ntohl(*(u32 *)pos);
|
||||||
|
+ if (record->payload_length > size - 6)
|
||||||
|
+ return -1;
|
||||||
|
pos += sizeof(u32);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -68,7 +70,8 @@ static int ndef_parse_record(const u8 *data, u32 size,
|
||||||
|
pos += record->payload_length;
|
||||||
|
|
||||||
|
record->total_length = pos - data;
|
||||||
|
- if (record->total_length > size)
|
||||||
|
+ if (record->total_length > size ||
|
||||||
|
+ record->total_length < record->payload_length)
|
||||||
|
return -1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.9.1
|
||||||
|
|
||||||
@@ -32,6 +32,7 @@ SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \
|
|||||||
file://0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch \
|
file://0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch \
|
||||||
file://0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch \
|
file://0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch \
|
||||||
file://0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch \
|
file://0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch \
|
||||||
|
file://0001-NFC-Fix-payload-length-validation-in-NDEF-record-par.patch \
|
||||||
"
|
"
|
||||||
SRC_URI[md5sum] = "f0037dbe03897dcaf2ad2722e659095d"
|
SRC_URI[md5sum] = "f0037dbe03897dcaf2ad2722e659095d"
|
||||||
SRC_URI[sha256sum] = "058dc832c096139a059e6df814080f50251a8d313c21b13364c54a1e70109122"
|
SRC_URI[sha256sum] = "058dc832c096139a059e6df814080f50251a8d313c21b13364c54a1e70109122"
|
||||||
|
|||||||
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
|
||||||
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
From 4d15068d83054a9f82b3f8842706cd6deb401e25 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Vladislav Grishenko <themiron@mail.ru>
|
||||||
|
Date: Thu, 19 Mar 2015 16:19:35 +0500
|
||||||
|
Subject: [PATCH] zcip: fix wrong comparison of source IP with our IP
|
||||||
|
|
||||||
|
Commit "zcip: fix link-local IP conflict detection" has introduced
|
||||||
|
wrong comparsion of source IP with our IP. This leads to a new IP
|
||||||
|
being picked unnecessarily on every incoming ARP packet.
|
||||||
|
|
||||||
|
Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
|
||||||
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
|
||||||
|
This change was picked from Busybox without modification
|
||||||
|
(git://git.busybox.net/busybox, commit 4d15068)
|
||||||
|
|
||||||
|
Upstream-Status: Backport (added in 1.24)
|
||||||
|
Signed-off-by: Brad Mouring <brad.mouring@ni.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
networking/zcip.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/networking/zcip.c b/networking/zcip.c
|
||||||
|
index a3307c5..962ba2e 100644
|
||||||
|
--- a/networking/zcip.c
|
||||||
|
+++ b/networking/zcip.c
|
||||||
|
@@ -521,7 +521,7 @@ int zcip_main(int argc UNUSED_PARAM, char **argv)
|
||||||
|
target_ip_conflict = 0;
|
||||||
|
|
||||||
|
if (memcmp(&p.arp.arp_sha, ð_addr, ETH_ALEN) != 0) {
|
||||||
|
- if (memcmp(p.arp.arp_spa, &ip.s_addr, sizeof(struct in_addr))) {
|
||||||
|
+ if (memcmp(p.arp.arp_spa, &ip.s_addr, sizeof(struct in_addr)) == 0) {
|
||||||
|
/* A probe or reply with source_ip == chosen ip */
|
||||||
|
source_ip_conflict = 1;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.7.3
|
||||||
|
|
||||||
57
meta/recipes-core/busybox/busybox/CVE-2016-2147.patch
Normal file
57
meta/recipes-core/busybox/busybox/CVE-2016-2147.patch
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
From d474ffc68290e0a83651c4432eeabfa62cd51e87 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
Date: Thu, 10 Mar 2016 11:47:58 +0100
|
||||||
|
Subject: [PATCH] udhcp: fix a SEGV on malformed RFC1035-encoded domain name
|
||||||
|
|
||||||
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
CVE: CVE-2016-2147
|
||||||
|
|
||||||
|
https://git.busybox.net/busybox/commit/?id=d474ffc
|
||||||
|
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
networking/udhcp/domain_codec.c | 13 +++++++++----
|
||||||
|
1 file changed, 9 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
Index: busybox-1.23.2/networking/udhcp/domain_codec.c
|
||||||
|
===================================================================
|
||||||
|
--- busybox-1.23.2.orig/networking/udhcp/domain_codec.c
|
||||||
|
+++ busybox-1.23.2/networking/udhcp/domain_codec.c
|
||||||
|
@@ -63,11 +63,10 @@ char* FAST_FUNC dname_dec(const uint8_t
|
||||||
|
if (crtpos + *c + 1 > clen) /* label too long? abort */
|
||||||
|
return NULL;
|
||||||
|
if (dst)
|
||||||
|
- memcpy(dst + len, c + 1, *c);
|
||||||
|
+ /* \3com ---> "com." */
|
||||||
|
+ ((char*)mempcpy(dst + len, c + 1, *c))[0] = '.';
|
||||||
|
len += *c + 1;
|
||||||
|
crtpos += *c + 1;
|
||||||
|
- if (dst)
|
||||||
|
- dst[len - 1] = '.';
|
||||||
|
} else {
|
||||||
|
/* NUL: end of current domain name */
|
||||||
|
if (retpos == 0) {
|
||||||
|
@@ -78,7 +77,10 @@ char* FAST_FUNC dname_dec(const uint8_t
|
||||||
|
crtpos = retpos;
|
||||||
|
retpos = depth = 0;
|
||||||
|
}
|
||||||
|
- if (dst)
|
||||||
|
+ if (dst && len != 0)
|
||||||
|
+ /* \4host\3com\0\4host and we are at \0:
|
||||||
|
+ * \3com was converted to "com.", change dot to space.
|
||||||
|
+ */
|
||||||
|
dst[len - 1] = ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -228,6 +230,9 @@ int main(int argc, char **argv)
|
||||||
|
int len;
|
||||||
|
uint8_t *encoded;
|
||||||
|
|
||||||
|
+ uint8_t str[6] = { 0x00, 0x00, 0x02, 0x65, 0x65, 0x00 };
|
||||||
|
+ printf("NUL:'%s'\n", dname_dec(str, 6, ""));
|
||||||
|
+
|
||||||
|
#define DNAME_DEC(encoded,pre) dname_dec((uint8_t*)(encoded), sizeof(encoded), (pre))
|
||||||
|
printf("'%s'\n", DNAME_DEC("\4host\3com\0", "test1:"));
|
||||||
|
printf("test2:'%s'\n", DNAME_DEC("\4host\3com\0\4host\3com\0", ""));
|
||||||
32
meta/recipes-core/busybox/busybox/CVE-2016-2147_2.patch
Normal file
32
meta/recipes-core/busybox/busybox/CVE-2016-2147_2.patch
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
From 1b7c17391de66502dd7a97c866e0a33681edbb1f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
Date: Fri, 11 Mar 2016 00:26:58 +0100
|
||||||
|
Subject: [PATCH] udhcpc: fix a warning in debug code
|
||||||
|
|
||||||
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
Upsteam-Status: Backport
|
||||||
|
CVE: CVE-2016-2147 regression fix
|
||||||
|
|
||||||
|
https://git.busybox.net/busybox/commit/?id=1b7c17
|
||||||
|
|
||||||
|
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
networking/udhcp/domain_codec.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/networking/udhcp/domain_codec.c b/networking/udhcp/domain_codec.c
|
||||||
|
index cee31f1..5a923cc 100644
|
||||||
|
--- a/networking/udhcp/domain_codec.c
|
||||||
|
+++ b/networking/udhcp/domain_codec.c
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||||
|
*/
|
||||||
|
#ifdef DNS_COMPR_TESTING
|
||||||
|
+# define _GNU_SOURCE
|
||||||
|
# define FAST_FUNC /* nothing */
|
||||||
|
# define xmalloc malloc
|
||||||
|
# include <stdlib.h>
|
||||||
|
--
|
||||||
|
2.3.5
|
||||||
|
|
||||||
74
meta/recipes-core/busybox/busybox/CVE-2016-2148.patch
Normal file
74
meta/recipes-core/busybox/busybox/CVE-2016-2148.patch
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
From 352f79acbd759c14399e39baef21fc4ffe180ac2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
Date: Fri, 26 Feb 2016 15:54:56 +0100
|
||||||
|
Subject: [PATCH] udhcpc: fix OPTION_6RD parsing (could overflow its malloced
|
||||||
|
buffer)
|
||||||
|
|
||||||
|
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
||||||
|
|
||||||
|
Upstream-Status: Backport
|
||||||
|
CVE: CVE-2016-2148
|
||||||
|
https://git.busybox.net/busybox/commit/?id=352f79
|
||||||
|
|
||||||
|
Signed-off-by: Armin Kuster <akuster@mvista.com>
|
||||||
|
|
||||||
|
---
|
||||||
|
networking/udhcp/common.c | 15 +++++++++++++--
|
||||||
|
networking/udhcp/dhcpc.c | 4 ++--
|
||||||
|
2 files changed, 15 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
Index: busybox-1.23.2/networking/udhcp/common.c
|
||||||
|
===================================================================
|
||||||
|
--- busybox-1.23.2.orig/networking/udhcp/common.c
|
||||||
|
+++ busybox-1.23.2/networking/udhcp/common.c
|
||||||
|
@@ -142,7 +142,7 @@ const char dhcp_option_strings[] ALIGN1
|
||||||
|
* udhcp_str2optset: to determine how many bytes to allocate.
|
||||||
|
* xmalloc_optname_optval: to estimate string length
|
||||||
|
* from binary option length: (option[LEN] / dhcp_option_lengths[opt_type])
|
||||||
|
- * is the number of elements, multiply in by one element's string width
|
||||||
|
+ * is the number of elements, multiply it by one element's string width
|
||||||
|
* (len_of_option_as_string[opt_type]) and you know how wide string you need.
|
||||||
|
*/
|
||||||
|
const uint8_t dhcp_option_lengths[] ALIGN1 = {
|
||||||
|
@@ -162,7 +162,18 @@ const uint8_t dhcp_option_lengths[] ALIG
|
||||||
|
[OPTION_S32] = 4,
|
||||||
|
/* Just like OPTION_STRING, we use minimum length here */
|
||||||
|
[OPTION_STATIC_ROUTES] = 5,
|
||||||
|
- [OPTION_6RD] = 22, /* ignored by udhcp_str2optset */
|
||||||
|
+ [OPTION_6RD] = 12, /* ignored by udhcp_str2optset */
|
||||||
|
+ /* The above value was chosen as follows:
|
||||||
|
+ * len_of_option_as_string[] for this option is >60: it's a string of the form
|
||||||
|
+ * "32 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 ".
|
||||||
|
+ * Each additional ipv4 address takes 4 bytes in binary option and appends
|
||||||
|
+ * another "255.255.255.255 " 16-byte string. We can set [OPTION_6RD] = 4
|
||||||
|
+ * but this severely overestimates string length: instead of 16 bytes,
|
||||||
|
+ * it adds >60 for every 4 bytes in binary option.
|
||||||
|
+ * We cheat and declare here that option is in units of 12 bytes.
|
||||||
|
+ * This adds more than 60 bytes for every three ipv4 addresses - more than enough.
|
||||||
|
+ * (Even 16 instead of 12 should work, but let's be paranoid).
|
||||||
|
+ */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Index: busybox-1.23.2/networking/udhcp/dhcpc.c
|
||||||
|
===================================================================
|
||||||
|
--- busybox-1.23.2.orig/networking/udhcp/dhcpc.c
|
||||||
|
+++ busybox-1.23.2/networking/udhcp/dhcpc.c
|
||||||
|
@@ -103,7 +103,7 @@ static const uint8_t len_of_option_as_st
|
||||||
|
[OPTION_IP ] = sizeof("255.255.255.255 "),
|
||||||
|
[OPTION_IP_PAIR ] = sizeof("255.255.255.255 ") * 2,
|
||||||
|
[OPTION_STATIC_ROUTES ] = sizeof("255.255.255.255/32 255.255.255.255 "),
|
||||||
|
- [OPTION_6RD ] = sizeof("32 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 "),
|
||||||
|
+ [OPTION_6RD ] = sizeof("132 128 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff 255.255.255.255 "),
|
||||||
|
[OPTION_STRING ] = 1,
|
||||||
|
[OPTION_STRING_HOST ] = 1,
|
||||||
|
#if ENABLE_FEATURE_UDHCP_RFC3397
|
||||||
|
@@ -214,7 +214,7 @@ static NOINLINE char *xmalloc_optname_op
|
||||||
|
type = optflag->flags & OPTION_TYPE_MASK;
|
||||||
|
optlen = dhcp_option_lengths[type];
|
||||||
|
upper_length = len_of_option_as_string[type]
|
||||||
|
- * ((unsigned)(len + optlen - 1) / (unsigned)optlen);
|
||||||
|
+ * ((unsigned)(len + optlen) / (unsigned)optlen);
|
||||||
|
|
||||||
|
dest = ret = xmalloc(upper_length + strlen(opt_name) + 2);
|
||||||
|
dest += sprintf(ret, "%s=", opt_name);
|
||||||
@@ -35,10 +35,15 @@ SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
|
|||||||
file://0001-chown-fix-help-text.patch \
|
file://0001-chown-fix-help-text.patch \
|
||||||
file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
|
file://0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch \
|
||||||
file://0002-Passthrough-r-to-linker.patch \
|
file://0002-Passthrough-r-to-linker.patch \
|
||||||
|
file://0001-randconfig-fix.patch \
|
||||||
|
file://0001-zcip-fix-wrong-comparison-of-source-IP-with-our-IP.patch \
|
||||||
file://mount-via-label.cfg \
|
file://mount-via-label.cfg \
|
||||||
file://sha1sum.cfg \
|
file://sha1sum.cfg \
|
||||||
file://sha256sum.cfg \
|
file://sha256sum.cfg \
|
||||||
file://getopts.cfg \
|
file://getopts.cfg \
|
||||||
|
file://CVE-2016-2148.patch \
|
||||||
|
file://CVE-2016-2147.patch \
|
||||||
|
file://CVE-2016-2147_2.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
SRC_URI[tarball.md5sum] = "7925683d7dd105aabe9b6b618d48cc73"
|
SRC_URI[tarball.md5sum] = "7925683d7dd105aabe9b6b618d48cc73"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require busybox.inc
|
require busybox.inc
|
||||||
|
|
||||||
SRCREV = "be947c4d97c0dacb703a6f24dd813ff6dd3a33b6"
|
SRCREV = "4d15068d83054a9f82b3f8842706cd6deb401e25"
|
||||||
# Lookout for PV bump too when SRCREV is changed
|
# Lookout for PV bump too when SRCREV is changed
|
||||||
PV = "1.23.2+git${SRCPV}"
|
PV = "1.23.2+git${SRCPV}"
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
|
|||||||
SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
|
||||||
git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
|
git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
|
||||||
file://fix_for_centos_5.8.patch \
|
file://fix_for_centos_5.8.patch \
|
||||||
|
file://strcoll-Remove-incorrect-STRDIFF-based-optimization-.patch \
|
||||||
${EGLIBCPATCHES} \
|
${EGLIBCPATCHES} \
|
||||||
"
|
"
|
||||||
EGLIBCPATCHES = "\
|
EGLIBCPATCHES = "\
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ do_install () {
|
|||||||
if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
|
if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
|
||||||
cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
|
cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
|
||||||
fi
|
fi
|
||||||
chown root.root -R ${D}
|
chown root:root -R ${D}
|
||||||
cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
|
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)
|
||||||
199
meta/recipes-core/glibc/glibc/CVE-2015-8778.patch
Normal file
199
meta/recipes-core/glibc/glibc/CVE-2015-8778.patch
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
From d0f05d1e39adb336a8bbccbc276a344e6ff427e3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Weimer <fweimer@redhat.com>
|
||||||
|
Date: Thu, 28 Jan 2016 13:59:11 +0100
|
||||||
|
Subject: [PATCH] Improve check against integer wraparound in hcreate_r [BZ
|
||||||
|
#18240]
|
||||||
|
|
||||||
|
CVE: CVE-2015-8778
|
||||||
|
|
||||||
|
Improve check against integer wraparound in hcreate_r [BZ #18240]
|
||||||
|
|
||||||
|
This is an integer overflow in hcreate and hcreate_r which can result in
|
||||||
|
an out-of-bound memory access. This could lead to application crashes
|
||||||
|
or, potentially, arbitrary code execution.
|
||||||
|
|
||||||
|
Upstream-Status: Backport [2.23]
|
||||||
|
(cherry-picked from commit bae7c7c7, 4bd228c8)
|
||||||
|
|
||||||
|
Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
|
||||||
|
---
|
||||||
|
ChangeLog | 6 +++++
|
||||||
|
NEWS | 2 +-
|
||||||
|
misc/Makefile | 2 +-
|
||||||
|
misc/bug18240.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
misc/hsearch_r.c | 28 ++++++++++++---------
|
||||||
|
5 files changed, 100 insertions(+), 13 deletions(-)
|
||||||
|
create mode 100644 misc/bug18240.c
|
||||||
|
|
||||||
|
diff --git a/ChangeLog b/ChangeLog
|
||||||
|
index b7701d1..a9dc8a2 100644
|
||||||
|
--- a/ChangeLog
|
||||||
|
+++ b/ChangeLog
|
||||||
|
@@ -1,3 +1,9 @@
|
||||||
|
+2016-01-27 Paul Eggert <eggert@cs.ucla.edu>
|
||||||
|
+
|
||||||
|
+ [BZ #18240]
|
||||||
|
+ * misc/hsearch_r.c (isprime, __hcreate_r): Protect against
|
||||||
|
+ unsigned int wraparound.
|
||||||
|
+
|
||||||
|
2016-02-15 Carlos O'Donell <carlos@redhat.com>
|
||||||
|
|
||||||
|
[BZ #18665]
|
||||||
|
diff --git a/NEWS b/NEWS
|
||||||
|
index cda7a73..fd77c27 100644
|
||||||
|
--- a/NEWS
|
||||||
|
+++ b/NEWS
|
||||||
|
@@ -9,7 +9,7 @@ Version 2.22.1
|
||||||
|
|
||||||
|
* The following bugs are resolved with this release:
|
||||||
|
|
||||||
|
- 18778, 18781, 18787, 17905.
|
||||||
|
+ 18240, 18778, 18781, 18787, 17905.
|
||||||
|
|
||||||
|
Version 2.22
|
||||||
|
|
||||||
|
diff --git a/misc/Makefile b/misc/Makefile
|
||||||
|
index e6b7c23..463a238 100644
|
||||||
|
--- a/misc/Makefile
|
||||||
|
+++ b/misc/Makefile
|
||||||
|
@@ -83,7 +83,7 @@ install-lib := libg.a
|
||||||
|
gpl2lgpl := error.c error.h
|
||||||
|
|
||||||
|
tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
|
||||||
|
- tst-pselect tst-insremque tst-mntent2 bug-hsearch1
|
||||||
|
+ tst-pselect tst-insremque tst-mntent2 bug-hsearch1 bug18240
|
||||||
|
tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += tst-error1
|
||||||
|
tests-$(OPTION_EGLIBC_FCVT) += tst-efgcvt
|
||||||
|
ifeq ($(run-built-tests),yes)
|
||||||
|
diff --git a/misc/bug18240.c b/misc/bug18240.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..4b26865
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/misc/bug18240.c
|
||||||
|
@@ -0,0 +1,75 @@
|
||||||
|
+/* Test integer wraparound in hcreate.
|
||||||
|
+ 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/>. */
|
||||||
|
+
|
||||||
|
+#include <errno.h>
|
||||||
|
+#include <limits.h>
|
||||||
|
+#include <search.h>
|
||||||
|
+#include <stdbool.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+test_size (size_t size)
|
||||||
|
+{
|
||||||
|
+ int res = hcreate (size);
|
||||||
|
+ if (res == 0)
|
||||||
|
+ {
|
||||||
|
+ if (errno == ENOMEM)
|
||||||
|
+ return;
|
||||||
|
+ printf ("error: hcreate (%zu): %m\n", size);
|
||||||
|
+ exit (1);
|
||||||
|
+ }
|
||||||
|
+ char *keys[100];
|
||||||
|
+ for (int i = 0; i < 100; ++i)
|
||||||
|
+ {
|
||||||
|
+ if (asprintf (keys + i, "%d", i) < 0)
|
||||||
|
+ {
|
||||||
|
+ printf ("error: asprintf: %m\n");
|
||||||
|
+ exit (1);
|
||||||
|
+ }
|
||||||
|
+ ENTRY e = { keys[i], (char *) "value" };
|
||||||
|
+ if (hsearch (e, ENTER) == NULL)
|
||||||
|
+ {
|
||||||
|
+ printf ("error: hsearch (\"%s\"): %m\n", keys[i]);
|
||||||
|
+ exit (1);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ hdestroy ();
|
||||||
|
+
|
||||||
|
+ for (int i = 0; i < 100; ++i)
|
||||||
|
+ free (keys[i]);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int
|
||||||
|
+do_test (void)
|
||||||
|
+{
|
||||||
|
+ test_size (500);
|
||||||
|
+ test_size (-1);
|
||||||
|
+ test_size (-3);
|
||||||
|
+ test_size (INT_MAX - 2);
|
||||||
|
+ test_size (INT_MAX - 1);
|
||||||
|
+ test_size (INT_MAX);
|
||||||
|
+ test_size (((unsigned) INT_MAX) + 1);
|
||||||
|
+ test_size (UINT_MAX - 2);
|
||||||
|
+ test_size (UINT_MAX - 1);
|
||||||
|
+ test_size (UINT_MAX);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#define TEST_FUNCTION do_test ()
|
||||||
|
+#include "../test-skeleton.c"
|
||||||
|
diff --git a/misc/hsearch_r.c b/misc/hsearch_r.c
|
||||||
|
index 9f55e84..6000ce2 100644
|
||||||
|
--- a/misc/hsearch_r.c
|
||||||
|
+++ b/misc/hsearch_r.c
|
||||||
|
@@ -46,15 +46,12 @@ static int
|
||||||
|
isprime (unsigned int number)
|
||||||
|
{
|
||||||
|
/* no even number will be passed */
|
||||||
|
- unsigned int div = 3;
|
||||||
|
-
|
||||||
|
- while (div * div < number && number % div != 0)
|
||||||
|
- div += 2;
|
||||||
|
-
|
||||||
|
- return number % div != 0;
|
||||||
|
+ for (unsigned int div = 3; div <= number / div; div += 2)
|
||||||
|
+ if (number % div == 0)
|
||||||
|
+ return 0;
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
-
|
||||||
|
/* Before using the hash table we must allocate memory for it.
|
||||||
|
Test for an existing table are done. We allocate one element
|
||||||
|
more as the found prime number says. This is done for more effective
|
||||||
|
@@ -81,10 +78,19 @@ __hcreate_r (nel, htab)
|
||||||
|
use will not work. */
|
||||||
|
if (nel < 3)
|
||||||
|
nel = 3;
|
||||||
|
- /* Change nel to the first prime number not smaller as nel. */
|
||||||
|
- nel |= 1; /* make odd */
|
||||||
|
- while (!isprime (nel))
|
||||||
|
- nel += 2;
|
||||||
|
+
|
||||||
|
+ /* Change nel to the first prime number in the range [nel, UINT_MAX - 2],
|
||||||
|
+ The '- 2' means 'nel += 2' cannot overflow. */
|
||||||
|
+ for (nel |= 1; ; nel += 2)
|
||||||
|
+ {
|
||||||
|
+ if (UINT_MAX - 2 < nel)
|
||||||
|
+ {
|
||||||
|
+ __set_errno (ENOMEM);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ if (isprime (nel))
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
htab->size = nel;
|
||||||
|
htab->filled = 0;
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user