Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 690136 (CVE-2019-13636, CVE-2019-13638) - <sys-devel/patch-2.7.6-r4: multiple vulnerabilities
Summary: <sys-devel/patch-2.7.6-r4: multiple vulnerabilities
Alias: CVE-2019-13636, CVE-2019-13638
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Security
Whiteboard: A2 [glsa+ cve]
Depends on:
Reported: 2019-07-18 08:43 UTC by D'juan McDonald (domhnall)
Modified: 2019-08-23 10:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---
stable-bot: sanity-check+

patch-2.7.6-r4.ebuild (patch-2.7.6-r4.ebuild,1.36 KB, text/plain)
2019-08-16 08:07 UTC, Teika kazura
no flags Details
patch-2.7.6-CVE-2019-13636.patch (patch-2.7.6-CVE-2019-13636.patch,3.66 KB, patch)
2019-08-16 08:08 UTC, Teika kazura
no flags Details | Diff
patch-2.7.6-CVE-2019-13638.patch (patch-2.7.6-CVE-2019-13638.patch,1.16 KB, patch)
2019-08-16 08:09 UTC, Teika kazura
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description D'juan McDonald (domhnall) 2019-07-18 08:43:29 UTC

In GNU patch through 2.7.6, the following of symlinks is mishandled in certain cases other than input files. This affects inp.c and util.c.

upstream patch:

Gentoo Security Padawan
Comment 1 Teika kazura 2019-07-29 00:02:22 UTC
There's also cve-2019-13638 (shell command injection vuln). See e.g. 
The upstream fix is also ready:

Comment 2 Teika kazura 2019-08-16 08:07:09 UTC
Created attachment 587032 [details]

I've created an ebuild that incorporates the above two patches for Gentoo users' sake.

Use at your own risk. At least it can src_prepare itself.
Comment 3 Teika kazura 2019-08-16 08:08:25 UTC
Created attachment 587034 [details, diff]

CVE-2019-13636 part.
Comment 4 Teika kazura 2019-08-16 08:09:36 UTC
Created attachment 587036 [details, diff]

CVE-2019-13638 part.

Best regards.
Comment 5 Teika kazura 2019-08-16 08:22:06 UTC
The above ebuild is my personal work, *NOT* by a Gentoo developer. Sorry to have forgotten to mention it in the first place. But hope it helps for someone.
Comment 6 Larry the Git Cow gentoo-dev 2019-08-16 12:40:31 UTC
The bug has been referenced in the following commit(s):

commit b4e5bfd9d4c04c2f942bbecce62e4394d827de16
Author:     Thomas Deutschmann <>
AuthorDate: 2019-08-16 12:38:46 +0000
Commit:     Thomas Deutschmann <>
CommitDate: 2019-08-16 12:40:22 +0000

    sys-devel/patch: rev bump to add some patches
    Package-Manager: Portage-2.3.71, Repoman-2.3.17
    Signed-off-by: Thomas Deutschmann <>

 ...lid-memory-access-in-context-format-diffs.patch |  26 +++++
 .../files/patch-2.7.6-CVE-2018-1000156-fix1.patch  | 102 +++++++++++++++++++
 .../files/patch-2.7.6-CVE-2018-1000156-fix2.patch  |  37 +++++++
 .../patch/files/patch-2.7.6-CVE-2019-13636.patch   | 108 +++++++++++++++++++++
 .../patch/files/patch-2.7.6-CVE-2019-13638.patch   |  38 ++++++++
 ...hen-RLIMIT_NOFILE-is-set-to-RLIM_INFINITY.patch |  89 +++++++++++++++++
 sys-devel/patch/patch-2.7.6-r4.ebuild              |  46 +++++++++
 7 files changed, 446 insertions(+)
Comment 7 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-08-16 21:50:05 UTC
amd64 stable
Comment 8 Aaron Bauman (RETIRED) gentoo-dev 2019-08-16 21:52:52 UTC
arm64 stable
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2019-08-16 22:40:05 UTC
x86 stable
Comment 10 GLSAMaker/CVETool Bot gentoo-dev 2019-08-18 02:25:30 UTC
This issue was resolved and addressed in
 GLSA 201908-22 at
by GLSA coordinator Aaron Bauman (b-man).
Comment 11 Aaron Bauman (RETIRED) gentoo-dev 2019-08-18 02:26:01 UTC
re-open for final arches
Comment 12 Rolf Eike Beer archtester 2019-08-18 08:39:59 UTC
sparc stable
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2019-08-18 10:16:40 UTC
ia64/ppc/ppc64 stable
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2019-08-19 07:03:08 UTC
hppa stable
Comment 15 Agostino Sarubbo gentoo-dev 2019-08-23 10:00:34 UTC
s390 stable
Comment 16 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-08-23 10:24:33 UTC
sh stable
Comment 17 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-08-23 10:24:56 UTC
m68k stable
Comment 18 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-08-23 10:25:17 UTC
alpha stable
Comment 19 Mikle Kolyada (RETIRED) archtester Gentoo Infrastructure gentoo-dev Security 2019-08-23 10:25:58 UTC
arm stable