diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-11-28 20:40:51 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-11-28 20:40:51 +0000 |
commit | 9c417bacd51da6d8b57fa9f37425161d30d4b95b (patch) | |
tree | 47c9d6e4243f39a1f48afd54c969b65b00a5c649 /net-libs/libslirp | |
parent | d934827bf44b7cfcf6711964418148fa60877668 (diff) |
gentoo resync : 28.11.2020
Diffstat (limited to 'net-libs/libslirp')
-rw-r--r-- | net-libs/libslirp/Manifest | 2 | ||||
-rw-r--r-- | net-libs/libslirp/files/libslirp-4.3.1-bug-756910-check-pkt_len.patch | 48 | ||||
-rw-r--r-- | net-libs/libslirp/libslirp-4.3.1-r1.ebuild | 39 |
3 files changed, 89 insertions, 0 deletions
diff --git a/net-libs/libslirp/Manifest b/net-libs/libslirp/Manifest index cb410af82617..de81814db3a0 100644 --- a/net-libs/libslirp/Manifest +++ b/net-libs/libslirp/Manifest @@ -1,3 +1,5 @@ +AUX libslirp-4.3.1-bug-756910-check-pkt_len.patch 1404 BLAKE2B 6e9d046f5f25bbdb574534cdd26ab69c708a56893336a09a7e146d654c4e74af338ad178c0067662e696453930f627117f386f8d99d20a555b28452e309884b4 SHA512 2ebf8293aed6c09c1a03123e5b3acca602ad1fd293653f093e1c69d691e2d4db15c1f9d10262fc0e5019771f81e1812788b6e5234a602f13b3b73172d6f6419f DIST libslirp-4.3.1.tar.gz 127008 BLAKE2B de40980521a54367fda73b9a67a80159ff14e8ea073086d8df3b42028ffe778b62f0aabe2b3f0929e168c73c453a8eda3fe0bb866d22de5b0712775e9cece19f SHA512 fa38a5e508b00802538f8466b8b52fc4842d6f7f74caa399db1011c15bb37198678415147327a606e3f259fd5def9390012df1d4dc76e8869e9bb77ca6514005 +EBUILD libslirp-4.3.1-r1.ebuild 943 BLAKE2B 07f2a7fd3c2f8f7e006d20753ff857d76e9660b42ffe415493bd49f798288de514f21e8b318a21bb2a35b9efa2f4e3a455b7d49f3137ed26688081716510ed01 SHA512 cdc7cec91c6b67abed1f8c6437eb18853241e950cd097898fd169b1092b9d5f3e977dab033a0b8071dc4132012c1083cf68546d932064ccd442d0a0a07c1602b EBUILD libslirp-4.3.1.ebuild 865 BLAKE2B cf25ff2e27f4220eba664b17cf08f300ee0e83c27a5c314944d0dde730d3dac8ddc8e4a2fa0f20cb90a635d262411f186ddd38b951c148ac54257f7ef2199ac8 SHA512 1e8701efac9726e608f6a42db0420a05be3e9654ac0c44610d6df6be74a1146d65cd32be97af2afba959482995d7fcb2cbd15012e009167fa17eb7282ba66a7a MISC metadata.xml 346 BLAKE2B f8c280b0fc3fadde1f7d8524d281b6c818d0489c98a3d54e9bcb54cf576bf34648041ddd2a9635544378e18fff67d34036626ae4f74ddc8a850347858137b458 SHA512 b237a26cef7a0e4e023b953ad63505c00338d7aab0434bdb346ac3e9810f81813a3567f7dbc2d13b03e0c63d50b9f151a9ece7051a90a0568281e410da2ba9da diff --git a/net-libs/libslirp/files/libslirp-4.3.1-bug-756910-check-pkt_len.patch b/net-libs/libslirp/files/libslirp-4.3.1-bug-756910-check-pkt_len.patch new file mode 100644 index 000000000000..aef7f19ba13a --- /dev/null +++ b/net-libs/libslirp/files/libslirp-4.3.1-bug-756910-check-pkt_len.patch @@ -0,0 +1,48 @@ +From: Prasad J Pandit <pjp@fedoraproject.org> +Date: Thu, 26 Nov 2020 13:57:06 +0000 +Subject: [PATCH] slirp: check pkt_len before reading protocol header + +While processing ARP/NCSI packets in 'arp_input' or 'ncsi_input' +routines, ensure that pkt_len is large enough to accommodate the +respective protocol headers, lest it should do an OOB access. +Add check to avoid it. + +Reported-by: Qiuhao Li @outlook.com; +Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> +--- + src/ncsi.c | 4 ++++ + src/slirp.c | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/src/ncsi.c b/src/ncsi.c +index 3c1dfef..75dcc08 100644 +--- a/src/ncsi.c ++++ b/src/ncsi.c +@@ -148,6 +148,10 @@ void ncsi_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) + uint32_t checksum; + uint32_t *pchecksum; + ++ if (pkt_len < ETH_HLEN + sizeof(struct ncsi_pkt_hdr)) { ++ return; /* packet too short */ ++ } ++ + memset(ncsi_reply, 0, sizeof(ncsi_reply)); + + memset(reh->h_dest, 0xff, ETH_ALEN); +diff --git a/src/slirp.c b/src/slirp.c +index 9bead0c..abb6f9a 100644 +--- a/src/slirp.c ++++ b/src/slirp.c +@@ -860,6 +860,10 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) + return; + } + ++ if (pkt_len < ETH_HLEN + sizeof(struct slirp_arphdr)) { ++ return; /* packet too short */ ++ } ++ + ar_op = ntohs(ah->ar_op); + switch (ar_op) { + case ARPOP_REQUEST: +-- +2.28.0 diff --git a/net-libs/libslirp/libslirp-4.3.1-r1.ebuild b/net-libs/libslirp/libslirp-4.3.1-r1.ebuild new file mode 100644 index 000000000000..90da793ff230 --- /dev/null +++ b/net-libs/libslirp/libslirp-4.3.1-r1.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit meson + +KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86" +MY_P="${PN}-v${PV}" +SRC_URI="https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v${PV}/${MY_P}.tar.gz -> ${P}.tar.gz" +DESCRIPTION="A general purpose TCP-IP emulator used by virtual machine hypervisors to provide virtual networking services." +HOMEPAGE="https://gitlab.freedesktop.org/slirp/libslirp" + +LICENSE="BSD" +SLOT="0" +IUSE="static-libs" + +RDEPEND="dev-libs/glib:=" + +DEPEND="${RDEPEND}" + +S=${WORKDIR}/${MY_P} + +PATCHES=( + "${FILESDIR}/libslirp-4.3.1-bug-756910-check-pkt_len.patch" +) + +src_prepare() { + default + echo "${PV}" > .tarball-version || die + echo -e "#!${BASH}\necho -n \$(cat '${S}/.tarball-version')" > build-aux/git-version-gen || die +} + +src_configure() { + local emesonargs=( + -Ddefault_library=$(usex static-libs both shared) + ) + meson_src_configure +} |