Skip to contentSkip to conversation

bash: Fix CVE-2019-18276

DISCUSSION Phil Reid 3 participants 5 messages Feb 17, 2020 – Feb 18, 2020

lore
Share & tools
lore

Phil Reid

author
#0 lore raw

Hi All,

I recently started get the following failure with bash after "b348e31c93f0 bash: Fix CVE-2019-18276" was applied to zeus.

Any thoughts?

NOTE: Applying patch 'bash50-001' (downloads/bash50-001)
NOTE: Applying patch 'bash50-002' (downloads/bash50-002)
NOTE: Applying patch 'bash50-003' (downloads/bash50-003)
NOTE: Applying patch 'bash50-004' (downloads/bash50-004)
NOTE: Applying patch 'bash50-005' (downloads/bash50-005)
NOTE: Applying patch 'bash50-006' (downloads/bash50-006)
NOTE: Applying patch 'bash50-007' (downloads/bash50-007)
NOTE: Applying patch 'execute_cmd.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/execute_cmd.patch)
NOTE: Applying patch 'mkbuiltins_have_stringize.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch)
NOTE: Applying patch 'build-tests.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/build-tests.patch)
NOTE: Applying patch 'test-output.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/test-output.patch)
NOTE: Applying patch 'fix-run-builtins.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/fix-run-builtins.patch)
NOTE: Applying patch 'bash-CVE-2019-18276.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/bash-CVE-2019-18276.patch)
ERROR: Command Error: 'quilt --quiltrc /home/preid/dev/linux/v2019.11/tmp-glibc/work/cortexa9t2hf-neon-emit-linux-gnueabi/bash/5.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch bash-CVE-2019-18276.patch
patching file MANIFEST
patching file bashline.c
patching file builtins/help.def
patching file config.h.in
patching file configure
Hunk #1 FAILED at 10281.
1 out of 1 hunk FAILED -- rejects in file configure
patching file configure.ac
patching file doc/bash.1
patching file doc/bashref.texi
patching file lib/glob/glob.c
patching file pathexp.c
patching file shell.c
patching file tests/glob.tests
patching file tests/glob6.sub
patching file tests/glob7.sub
Patch bash-CVE-2019-18276.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

Signature · 11 lines
Regards
Phil Reid

ElectroMagnetic Imaging Technology Pty Ltd
Development of Geophysical Instrumentation & Software
www.electromag.com.au

3 The Avenue, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: [email protected]
#1 lore raw
Quoted 36 lines · Phil Reid

Hi All,

I recently started get the following failure with bash after "b348e31c93f0 bash: Fix CVE-2019-18276" was applied to zeus.

Any thoughts?

NOTE: Applying patch 'bash50-001' (downloads/bash50-001)
NOTE: Applying patch 'bash50-002' (downloads/bash50-002)
NOTE: Applying patch 'bash50-003' (downloads/bash50-003)
NOTE: Applying patch 'bash50-004' (downloads/bash50-004)
NOTE: Applying patch 'bash50-005' (downloads/bash50-005)
NOTE: Applying patch 'bash50-006' (downloads/bash50-006)
NOTE: Applying patch 'bash50-007' (downloads/bash50-007)
NOTE: Applying patch 'execute_cmd.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/execute_cmd.patch)
NOTE: Applying patch 'mkbuiltins_have_stringize.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch)
NOTE: Applying patch 'build-tests.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/build-tests.patch)
NOTE: Applying patch 'test-output.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/test-output.patch)
NOTE: Applying patch 'fix-run-builtins.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/fix-run-builtins.patch)
NOTE: Applying patch 'bash-CVE-2019-18276.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/bash-CVE-2019-18276.patch)
ERROR: Command Error: 'quilt --quiltrc /home/preid/dev/linux/v2019.11/tmp-glibc/work/cortexa9t2hf-neon-emit-linux-gnueabi/bash/5.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch bash-CVE-2019-18276.patch
patching file MANIFEST
patching file bashline.c
patching file builtins/help.def
patching file config.h.in
patching file configure
Hunk #1 FAILED at 10281.
1 out of 1 hunk FAILED -- rejects in file configure
patching file configure.ac
patching file doc/bash.1
patching file doc/bashref.texi
patching file lib/glob/glob.c

Quoted 8 lines

patching file pathexp.c
patching file shell.c
patching file tests/glob.tests
patching file tests/glob6.sub
patching file tests/glob7.sub
Patch bash-CVE-2019-18276.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

Had the same issue the day before, re-building bash clean solved it. At first I wanted to report it as well, but then after I tried "-c cleanall" - the issue was gone.

Try to do a clean build of bash and see if it is still reproducible.

Quoted 18 lines

--
Regards
Phil Reid

ElectroMagnetic Imaging Technology Pty Ltd Development of Geophysical Instrumentation & Software www.electromag.com.au

3 The Avenue, Midland WA 6056, AUSTRALIA
Ph: +61 8 9250 8100
Fax: +61 8 9250 7100
Email: [email protected]
--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
Regards,
Andrey.
#2 lore raw
Quoted 57 lines · Andrey Zhizhikin
Quoted 46 lines · Phil Reid

Hi All,

I recently started get the following failure with bash after "b348e31c93f0 bash: Fix CVE-2019-18276"
was applied to zeus.

Any thoughts?

NOTE: Applying patch 'bash50-001' (downloads/bash50-001)
NOTE: Applying patch 'bash50-002' (downloads/bash50-002)
NOTE: Applying patch 'bash50-003' (downloads/bash50-003)
NOTE: Applying patch 'bash50-004' (downloads/bash50-004)
NOTE: Applying patch 'bash50-005' (downloads/bash50-005)
NOTE: Applying patch 'bash50-006' (downloads/bash50-006)
NOTE: Applying patch 'bash50-007' (downloads/bash50-007)
NOTE: Applying patch 'execute_cmd.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/execute_cmd.patch)
NOTE: Applying patch 'mkbuiltins_have_stringize.patch' (layers/openembedded-core/meta/recipes- extended/bash/bash/mkbuiltins_have_stringize.patch)
NOTE: Applying patch 'build-tests.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/build-tests.patch)
NOTE: Applying patch 'test-output.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/test-output.patch)
NOTE: Applying patch 'fix-run-builtins.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/fix-run-builtins.patch)
NOTE: Applying patch 'bash-CVE-2019-18276.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/bash-CVE- 2019-18276.patch)
ERROR: Command Error: 'quilt --quiltrc /home/preid/dev/linux/v2019.11/tmp-glibc/work/cortexa9t2hf-neon- emit-linux-gnueabi/bash/5.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch bash-CVE-2019-18276.patch
patching file MANIFEST
patching file bashline.c
patching file builtins/help.def
patching file config.h.in
patching file configure
Hunk #1 FAILED at 10281.
1 out of 1 hunk FAILED -- rejects in file configure patching file configure.ac
patching file doc/bash.1
patching file doc/bashref.texi
patching file lib/glob/glob.c

Quoted 8 lines

patching file pathexp.c
patching file shell.c
patching file tests/glob.tests
patching file tests/glob6.sub
patching file tests/glob7.sub
Patch bash-CVE-2019-18276.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

Quoted 5 lines

Had the same issue the day before, re-building bash clean solved it. At first I wanted to report it as well, but then after I tried "-c cleanall" - the issue was gone.

Try to do a clean build of bash and see if it is still reproducible.

I think I understand what happens here. When you do a rebuild, bitbake tries to pop off all the old patches, then apply the new ones.

In this case its patching configure which we rebuild. It therefore can't apply the new patch to configure since its changed by the do_configure task.

The fix is to remove the configure change from the patch since we just need the configure.ac piece.

Cheers,

Richard

author
#3 lore raw
Quoted 67 lines · Richard Purdie
Quoted 57 lines · Andrey Zhizhikin
Quoted 46 lines · Phil Reid

Hi All,

I recently started get the following failure with bash after "b348e31c93f0 bash: Fix CVE-2019-18276"
was applied to zeus.

Any thoughts?

NOTE: Applying patch 'bash50-001' (downloads/bash50-001)
NOTE: Applying patch 'bash50-002' (downloads/bash50-002)
NOTE: Applying patch 'bash50-003' (downloads/bash50-003)
NOTE: Applying patch 'bash50-004' (downloads/bash50-004)
NOTE: Applying patch 'bash50-005' (downloads/bash50-005)
NOTE: Applying patch 'bash50-006' (downloads/bash50-006)
NOTE: Applying patch 'bash50-007' (downloads/bash50-007)
NOTE: Applying patch 'execute_cmd.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/execute_cmd.patch)
NOTE: Applying patch 'mkbuiltins_have_stringize.patch' (layers/openembedded-core/meta/recipes- extended/bash/bash/mkbuiltins_have_stringize.patch)
NOTE: Applying patch 'build-tests.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/build-tests.patch)
NOTE: Applying patch 'test-output.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/test-output.patch)
NOTE: Applying patch 'fix-run-builtins.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/fix-run-builtins.patch)
NOTE: Applying patch 'bash-CVE-2019-18276.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/bash-CVE- 2019-18276.patch)
ERROR: Command Error: 'quilt --quiltrc /home/preid/dev/linux/v2019.11/tmp-glibc/work/cortexa9t2hf-neon- emit-linux-gnueabi/bash/5.0-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch bash-CVE-2019-18276.patch
patching file MANIFEST
patching file bashline.c
patching file builtins/help.def
patching file config.h.in
patching file configure
Hunk #1 FAILED at 10281.
1 out of 1 hunk FAILED -- rejects in file configure patching file configure.ac
patching file doc/bash.1
patching file doc/bashref.texi
patching file lib/glob/glob.c

Quoted 8 lines

patching file pathexp.c
patching file shell.c
patching file tests/glob.tests
patching file tests/glob6.sub
patching file tests/glob7.sub
Patch bash-CVE-2019-18276.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

Quoted 5 lines

Had the same issue the day before, re-building bash clean solved it. At first I wanted to report it as well, but then after I tried "-c cleanall" - the issue was gone.

Try to do a clean build of bash and see if it is still reproducible.

I think I understand what happens here. When you do a rebuild, bitbake tries to pop off all the old patches, then apply the new ones.

Quoted 7 lines

In this case its patching configure which we rebuild. It therefore can't apply the new patch to configure since its changed by the do_configure task.

The fix is to remove the configure change from the patch since we just need the configure.ac piece.

I've run "bitbake -c cleanall bash" and the build has then succeeded. I guess we wait and see if it pops up again when bash needs to be rebuilt.

I did try quickly hacking the patch and removing the configure patch section, but the resulting configure looked different. So I went with the easy option above.

Thanks
Phil

#4 lore raw
Quoted 86 lines · Phil Reid
Quoted 77 lines · Richard Purdie
Quoted 63 lines · Andrey Zhizhikin
Quoted 51 lines · Phil Reid

Hi All,

I recently started get the following failure with bash after "b348e31c93f0 bash: Fix CVE-2019-18276"
was applied to zeus.

Any thoughts?

NOTE: Applying patch 'bash50-001' (downloads/bash50-001)
NOTE: Applying patch 'bash50-002' (downloads/bash50-002)
NOTE: Applying patch 'bash50-003' (downloads/bash50-003)
NOTE: Applying patch 'bash50-004' (downloads/bash50-004)
NOTE: Applying patch 'bash50-005' (downloads/bash50-005)
NOTE: Applying patch 'bash50-006' (downloads/bash50-006)
NOTE: Applying patch 'bash50-007' (downloads/bash50-007)
NOTE: Applying patch 'execute_cmd.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/execute_cmd.patch)
NOTE: Applying patch 'mkbuiltins_have_stringize.patch' (layers/openembedded-core/meta/recipes- extended/bash/bash/mkbuiltins_have_stringize.patch)
NOTE: Applying patch 'build-tests.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/build-tests.patch)
NOTE: Applying patch 'test-output.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/test-output.patch)
NOTE: Applying patch 'fix-run-builtins.patch' (layers/openembedded- core/meta/recipes-extended/bash/bash/fix-run-builtins.patch)
NOTE: Applying patch 'bash-CVE-2019-18276.patch' (layers/openembedded-core/meta/recipes-extended/bash/bash/bash- CVE-
2019-18276.patch)
ERROR: Command Error: 'quilt --quiltrc /home/preid/dev/linux/v2019.11/tmp-glibc/work/cortexa9t2hf- neon-
emit-linux-gnueabi/bash/5.0-r0/recipe-sysroot- native/etc/quiltrc
push' exited with 0 Output:
Applying patch bash-CVE-2019-18276.patch
patching file MANIFEST
patching file bashline.c
patching file builtins/help.def
patching file config.h.in
patching file configure
Hunk #1 FAILED at 10281.
1 out of 1 hunk FAILED -- rejects in file configure patching file configure.ac
patching file doc/bash.1
patching file doc/bashref.texi
patching file lib/glob/glob.c
patching file pathexp.c

Quoted 8 lines

patching file shell.c
patching file tests/glob.tests
patching file tests/glob6.sub
patching file tests/glob7.sub
Patch bash-CVE-2019-18276.patch does not apply (enforce with -f)
DEBUG: Python function patch_do_patch finished
DEBUG: Python function do_patch finished

Quoted 8 lines

Had the same issue the day before, re-building bash clean solved it.
At first I wanted to report it as well, but then after I tried "- c
cleanall" - the issue was gone.

Try to do a clean build of bash and see if it is still reproducible.

I think I understand what happens here. When you do a rebuild, bitbake
tries to pop off all the old patches, then apply the new ones.

Quoted 8 lines

In this case its patching configure which we rebuild. It therefore can't apply the new patch to configure since its changed by the do_configure task.

The fix is to remove the configure change from the patch since we just
need the configure.ac piece.

Quoted 7 lines

I've run "bitbake -c cleanall bash" and the build has then succeeded. I guess we wait and see if it pops up again when bash needs to be rebuilt.

I did try quickly hacking the patch and removing the configure patch section, but the resulting configure looked different. So I went with the easy option above.

Reproducing should be as simple as:

bitbake bash -c configure
bitbake bash -c patch -f

Cheers,

Richard