Skip to contentSkip to conversation

netkit-telnetd: Fix buffer overflow in netoprintf

PATCH In review Julius Hemanth Pitti 2 participants 5 messages Jul 20, 2020 – Jul 21, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netkit-telnetd: Fix buffer overflow in netoprintf

netoprintf() was not handling a case where
return value of vsnprintf is greater than
"size"(2nd argument), results in buffer overflow
while adjusting "nfrontp" pointer to point
beyond "netobuf" buffer.

Here is one such case where "nfrontp"
crossed boundaries of "netobuf", and
pointing to another global variable.

(gdb) p &netobuf[8255]
$5 = 0x55c93afe8b1f <netobuf+8255> ""
(gdb) p nfrontp
$6 = 0x55c93afe8c20 <terminaltype> "\377"
(gdb) p &terminaltype
$7 = (char **) 0x55c93afe8c20 <terminaltype>
(gdb)

This resulted in crash of telnetd service
with segmentation fault.

---
 ....c-Fix-buffer-overflow-in-netoprintf.patch | 56 +++++++++++++++++++
 .../netkit-telnet/netkit-telnet_0.17.bb       |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 meta-networking/recipes-netkit/netkit-telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch
meta-networking/recipes-netkit/netkit-telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch new file +56 -0
new file mode 100644
index 000000000..8f983e40a
@@ -0,0 +1,56 @@
+From 9c81c8e5bc7782e8ae12c078615abc3c896059f2 Mon Sep 17 00:00:00 2001
+From: Julius Hemanth Pitti <[email protected]>
+Date: Tue, 14 Jul 2020 22:34:19 -0700
+Subject: [PATCH] telnetd/utility.c: Fix buffer overflow in netoprintf
+
+As per man page of vsnprintf, when formated
+string size is greater than "size"(2nd argument),
+then vsnprintf returns size of formated string,
+not "size"(2nd argument).
+
+netoprintf() was not handling a case where
+return value of vsnprintf is greater than
+"size"(2nd argument), results in buffer overflow
+while adjusting "nfrontp" pointer to point
+beyond "netobuf" buffer.
+
+Here is one such case where "nfrontp"
+crossed boundaries of "netobuf", and
+pointing to another global variable.
+
+(gdb) p &netobuf[8255]
+$5 = 0x55c93afe8b1f <netobuf+8255> ""
+(gdb) p nfrontp
+$6 = 0x55c93afe8c20 <terminaltype> "\377"
+(gdb) p &terminaltype
+$7 = (char **) 0x55c93afe8c20 <terminaltype>
+(gdb)
+
+This resulted in crash of telnetd service
+with segmentation fault.
+
+Though this is DoS security bug, I couldn't
+find any CVE ID for this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Julius Hemanth Pitti <[email protected]>
+---
+ telnetd/utility.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index b9a46a6..4811f14 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -66,7 +66,7 @@ netoprintf(const char *fmt, ...)
+       len = vsnprintf(nfrontp, maxsize, fmt, ap);
+       va_end(ap);
+ 
+-      if (len<0 || len==maxsize) {
++      if (len<0 || len>=maxsize) {
+ 	 /* didn't fit */
+ 	 netflush();
+       }
+--
+2.19.1
meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb +1 -0
index 0e92add63..08dd532b6 100644
@@ -13,6 +13,7 @@ SRC_URI = "http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \
            file://0001-telnet-telnetd-Fix-print-format-strings.patch \
            file://0001-telnet-telnetd-Fix-deadlock-on-cleanup.patch \
            file://CVE-2020-10188.patch \
+           file://0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch \
            "
 
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
Signature · 1 line
2.19.1
#1 lore raw
Quoted 19 lines · Julius Hemanth Pitti

netoprintf() was not handling a case where
return value of vsnprintf is greater than
"size"(2nd argument), results in buffer overflow
while adjusting "nfrontp" pointer to point
beyond "netobuf" buffer.

Here is one such case where "nfrontp"
crossed boundaries of "netobuf", and
pointing to another global variable.

(gdb) p &netobuf[8255]
$5 = 0x55c93afe8b1f <netobuf+8255> ""
(gdb) p nfrontp
$6 = 0x55c93afe8c20 <terminaltype> "\377"
(gdb) p &terminaltype
$7 = (char **) 0x55c93afe8c20 <terminaltype>
(gdb)

Quoted 3 lines

This resulted in crash of telnetd service
with segmentation fault.

it seems like one. Can you also reproduce it with something like fedora ?

Quoted 84 lines
---
 ....c-Fix-buffer-overflow-in-netoprintf.patch | 56 +++++++++++++++++++
 .../netkit-telnet/netkit-telnet_0.17.bb       |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 meta-networking/recipes-netkit/netkit-telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch
meta-networking/recipes-netkit/netkit-telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch new file +56 -0
new file mode 100644
index 000000000..8f983e40a
@@ -0,0 +1,56 @@
+From 9c81c8e5bc7782e8ae12c078615abc3c896059f2 Mon Sep 17 00:00:00 2001
+From: Julius Hemanth Pitti <[email protected]>
+Date: Tue, 14 Jul 2020 22:34:19 -0700
+Subject: [PATCH] telnetd/utility.c: Fix buffer overflow in netoprintf
+
+As per man page of vsnprintf, when formated
+string size is greater than "size"(2nd argument),
+then vsnprintf returns size of formated string,
+not "size"(2nd argument).
+
+netoprintf() was not handling a case where
+return value of vsnprintf is greater than
+"size"(2nd argument), results in buffer overflow
+while adjusting "nfrontp" pointer to point
+beyond "netobuf" buffer.
+
+Here is one such case where "nfrontp"
+crossed boundaries of "netobuf", and
+pointing to another global variable.
+
+(gdb) p &netobuf[8255]
+$5 = 0x55c93afe8b1f <netobuf+8255> ""
+(gdb) p nfrontp
+$6 = 0x55c93afe8c20 <terminaltype> "\377"
+(gdb) p &terminaltype
+$7 = (char **) 0x55c93afe8c20 <terminaltype>
+(gdb)
+
+This resulted in crash of telnetd service
+with segmentation fault.
+
+Though this is DoS security bug, I couldn't
+find any CVE ID for this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Julius Hemanth Pitti <[email protected]>
+---
+ telnetd/utility.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index b9a46a6..4811f14 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -66,7 +66,7 @@ netoprintf(const char *fmt, ...)
+       len = vsnprintf(nfrontp, maxsize, fmt, ap);
+       va_end(ap);
+
+-      if (len<0 || len==maxsize) {
++      if (len<0 || len>=maxsize) {
+        /* didn't fit */
+        netflush();
+       }
+--
+2.19.1
meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb +1 -1
index 0e92add63..08dd532b6 100644
@@ -13,6 +13,7 @@ SRC_URI = "http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \
            file://0001-telnet-telnetd-Fix-print-format-strings.patch \
            file://0001-telnet-telnetd-Fix-deadlock-on-cleanup.patch \
            file://CVE-2020-10188.patch \
+           file://0001-telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch \
            "
 
 UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
--

2.19.1

#2 lore raw
Quoted 21 lines · Khem Raj
Quoted 19 lines · Julius Hemanth Pitti

netoprintf() was not handling a case where return value of vsnprintf is greater than "size"(2nd argument), results in buffer overflow while adjusting "nfrontp" pointer to point beyond "netobuf" buffer.

Here is one such case where "nfrontp" crossed boundaries of "netobuf", and pointing to another global variable.

(gdb) p &netobuf[8255]
$5 = 0x55c93afe8b1f <netobuf+8255> "" (gdb) p nfrontp
$6 = 0x55c93afe8c20 <terminaltype> "\377" (gdb) p &terminaltype
$7 = (char **) 0x55c93afe8c20 <terminaltype> (gdb)

Quoted 7 lines
Quoted 3 lines

This resulted in crash of telnetd service with segmentation fault.

it seems like one. Can you also reproduce it with something like fedora ?

I looked at latest centos and ubuntu, their refactored code do not have this bug.

Quoted 102 lines
Quoted 102 lines
---
 ....c-Fix-buffer-overflow-in-netoprintf.patch | 56
+++++++++++++++++++
 .../netkit-telnet/netkit-telnet_0.17.bb       |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 meta-networking/recipes-netkit/netkit-

telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch

(quoted diff) +0 -0

telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch b/meta-networking/recipes-netkit/netkit- telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch
new file mode 100644
index 000000000..8f983e40a

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +0 -0

telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +1 -0
@@ -0,0 +1,56 @@
+From 9c81c8e5bc7782e8ae12c078615abc3c896059f2 Mon Sep 17 00:00:00

2001

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +3 -0
+From: Julius Hemanth Pitti <[email protected]>
+Date: Tue, 14 Jul 2020 22:34:19 -0700
+Subject: [PATCH] telnetd/utility.c: Fix buffer overflow in

netoprintf

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +52 -0
+
+As per man page of vsnprintf, when formated
+string size is greater than "size"(2nd argument),
+then vsnprintf returns size of formated string,
+not "size"(2nd argument).
+
+netoprintf() was not handling a case where
+return value of vsnprintf is greater than
+"size"(2nd argument), results in buffer overflow
+while adjusting "nfrontp" pointer to point
+beyond "netobuf" buffer.
+
+Here is one such case where "nfrontp"
+crossed boundaries of "netobuf", and
+pointing to another global variable.
+
+(gdb) p &netobuf[8255]
+$5 = 0x55c93afe8b1f <netobuf+8255> ""
+(gdb) p nfrontp
+$6 = 0x55c93afe8c20 <terminaltype> "\377"
+(gdb) p &terminaltype
+$7 = (char **) 0x55c93afe8c20 <terminaltype>
+(gdb)
+
+This resulted in crash of telnetd service
+with segmentation fault.
+
+Though this is DoS security bug, I couldn't
+find any CVE ID for this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Julius Hemanth Pitti <[email protected]>
+---
+ telnetd/utility.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index b9a46a6..4811f14 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -66,7 +66,7 @@ netoprintf(const char *fmt, ...)
+       len = vsnprintf(nfrontp, maxsize, fmt, ap);
+       va_end(ap);
+
+-      if (len<0 || len==maxsize) {
++      if (len<0 || len>=maxsize) {
+        /* didn't fit */
+        netflush();
+       }
+--
+2.19.1
(quoted diff) +0 -0

telnet_0.17.bb b/meta-networking/recipes-netkit/netkit- telnet/netkit-telnet_0.17.bb
index 0e92add63..08dd532b6 100644
--- a/meta-networking/recipes-netkit/netkit-telnet/netkit- telnet_0.17.bb
+++ b/meta-networking/recipes-netkit/netkit-telnet/netkit- telnet_0.17.bb

(quoted diff) +1 -0
@@ -13,6 +13,7 @@ SRC_URI = "
 http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \
            file://0001-telnet-telnetd-Fix-print-format-
 strings.patch \
            file://0001-telnet-telnetd-Fix-deadlock-on-
 cleanup.patch \
            file://CVE-2020-10188.patch \
+           file://0001-telnetd-utility.c-Fix-buffer-overflow-in-
netoprintf.patch \
            "

UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
--
2.19.1

#3 lore raw
Quoted 26 lines · Julius Hemanth Pitti (jpitti)
Quoted 25 lines · Khem Raj
Quoted 22 lines · Julius Hemanth Pitti

netoprintf() was not handling a case where return value of vsnprintf is greater than "size"(2nd argument), results in buffer overflow while adjusting "nfrontp" pointer to point beyond "netobuf" buffer.

Here is one such case where "nfrontp" crossed boundaries of "netobuf", and pointing to another global variable.

(gdb) p &netobuf[8255]
$5 = 0x55c93afe8b1f <netobuf+8255> "" (gdb) p nfrontp
$6 = 0x55c93afe8c20 <terminaltype> "\377" (gdb) p &terminaltype
$7 = (char **) 0x55c93afe8c20 <terminaltype> (gdb)

This resulted in crash of telnetd service with segmentation fault.

Quoted 6 lines
Quoted 3 lines

it seems like one. Can you also reproduce it with something like fedora ?

I looked at latest centos and ubuntu, their refactored code do not have this bug.

I would prefer to share the refactored code which avoids this problem

Quoted 105 lines
Quoted 104 lines
Quoted 104 lines
---
 ....c-Fix-buffer-overflow-in-netoprintf.patch | 56
+++++++++++++++++++
 .../netkit-telnet/netkit-telnet_0.17.bb       |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 meta-networking/recipes-netkit/netkit-

telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch

(quoted diff) +0 -0

telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch b/meta-networking/recipes-netkit/netkit- telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch
new file mode 100644
index 000000000..8f983e40a

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +0 -0

telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +1 -0
@@ -0,0 +1,56 @@
+From 9c81c8e5bc7782e8ae12c078615abc3c896059f2 Mon Sep 17 00:00:00

2001

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +3 -0
+From: Julius Hemanth Pitti <[email protected]>
+Date: Tue, 14 Jul 2020 22:34:19 -0700
+Subject: [PATCH] telnetd/utility.c: Fix buffer overflow in

netoprintf

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +52 -0
+
+As per man page of vsnprintf, when formated
+string size is greater than "size"(2nd argument),
+then vsnprintf returns size of formated string,
+not "size"(2nd argument).
+
+netoprintf() was not handling a case where
+return value of vsnprintf is greater than
+"size"(2nd argument), results in buffer overflow
+while adjusting "nfrontp" pointer to point
+beyond "netobuf" buffer.
+
+Here is one such case where "nfrontp"
+crossed boundaries of "netobuf", and
+pointing to another global variable.
+
+(gdb) p &netobuf[8255]
+$5 = 0x55c93afe8b1f <netobuf+8255> ""
+(gdb) p nfrontp
+$6 = 0x55c93afe8c20 <terminaltype> "\377"
+(gdb) p &terminaltype
+$7 = (char **) 0x55c93afe8c20 <terminaltype>
+(gdb)
+
+This resulted in crash of telnetd service
+with segmentation fault.
+
+Though this is DoS security bug, I couldn't
+find any CVE ID for this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Julius Hemanth Pitti <[email protected]>
+---
+ telnetd/utility.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index b9a46a6..4811f14 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -66,7 +66,7 @@ netoprintf(const char *fmt, ...)
+       len = vsnprintf(nfrontp, maxsize, fmt, ap);
+       va_end(ap);
+
+-      if (len<0 || len==maxsize) {
++      if (len<0 || len>=maxsize) {
+        /* didn't fit */
+        netflush();
+       }
+--
+2.19.1
(quoted diff) +0 -0

telnet_0.17.bb b/meta-networking/recipes-netkit/netkit- telnet/netkit-telnet_0.17.bb
index 0e92add63..08dd532b6 100644
--- a/meta-networking/recipes-netkit/netkit-telnet/netkit- telnet_0.17.bb
+++ b/meta-networking/recipes-netkit/netkit-telnet/netkit- telnet_0.17.bb

(quoted diff) +1 -0
@@ -13,6 +13,7 @@ SRC_URI = "
 http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \
            file://0001-telnet-telnetd-Fix-print-format-
 strings.patch \
            file://0001-telnet-telnetd-Fix-deadlock-on-
 cleanup.patch \
            file://CVE-2020-10188.patch \
+           file://0001-telnetd-utility.c-Fix-buffer-overflow-in-
netoprintf.patch \
            "

UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
--
2.19.1

#4 lore raw
Quoted 34 lines · Khem Raj
Quoted 30 lines · Julius Hemanth Pitti (jpitti)
Quoted 28 lines · Khem Raj
Quoted 19 lines · Julius Hemanth Pitti

netoprintf() was not handling a case where return value of vsnprintf is greater than "size"(2nd argument), results in buffer overflow while adjusting "nfrontp" pointer to point beyond "netobuf" buffer.

Here is one such case where "nfrontp" crossed boundaries of "netobuf", and pointing to another global variable.

(gdb) p &netobuf[8255]
$5 = 0x55c93afe8b1f <netobuf+8255> "" (gdb) p nfrontp
$6 = 0x55c93afe8c20 <terminaltype> "\377" (gdb) p &terminaltype
$7 = (char **) 0x55c93afe8c20 <terminaltype> (gdb)

Quoted 3 lines

This resulted in crash of telnetd service with segmentation fault.

it seems like one. Can you also reproduce it with something like fedora ?

Quoted 6 lines
Quoted 3 lines

I looked at latest centos and ubuntu, their refactored code do not have
this bug.

I would prefer to share the refactored code which avoids this problem

Centos/Fedora and ubuntu have their own refactored code. Their patches do not have much in common. If we decide to share their refactored code to avoid this bug, then I recommend Centos way as it's closer to our source.

centos/fedora refactored their code a long time ago in patch "telnet- 0.17-sa-01-49.patch"
(Ref:
https://source.ipfire.org/source-3.x/4b3195d73b47d94d75630046871fcadd7bce89a9/telnet/patches/telnet-0.17-sa-01-49.patch
)
I looked at their patch, and the way they solve it logically derives to the same results.

There is one particular hunk in this patch, which I do not understand why is it done.
Here is the snippet,

diff -up netkit-telnet-0.17/telnetd/termstat.c.sa-01-49 netkit-telnet- 0.17/telnetd/termstat.c
--- netkit-telnet-0.17/telnetd/termstat.c.sa-01-49 1999-12-12
15:59:45.000000000 +0100
+++ netkit-telnet-0.17/telnetd/termstat.c 2011-01-20
22:39:54.000000000 +0100
@@ -128,7 +128,6 @@ static int _terminit = 0;
void
localstat()
{

-       void netflush();
        int need_will_echo = 0;

        /*

Unfortunately this patch does not have any commit message or comment which explains why we need this.
Maybe it has something to do with previous patches in the series, perhaps some bug fix, which they squashed together in this patch? not sure though.

If we decide to take above hunk as-is, how do we ensure this doesn't have unwanted effects?

With this details, IMO, I think we shouldn't share just the part that avoid this problem,

We should either drop all our current patches(in our recipe) and just pick all the patches from centos/Fedora or ubuntu,
or
we make a point fix of this issue like the patch I submitted.

Please suggest.

Quoted 107 lines
Quoted 107 lines
Quoted 11 lines
Quoted 11 lines
---
 ....c-Fix-buffer-overflow-in-netoprintf.patch | 56
+++++++++++++++++++
 .../netkit-telnet/netkit-telnet_0.17.bb       |  1 +
 2 files changed, 57 insertions(+)
 create mode 100644 meta-networking/recipes-netkit/netkit-

telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch

Quoted 12 lines

meta-networking/recipes-netkit/netkit-telnet/files/0001- line 1

Quoted 12 lines
(quoted diff) +0 -0

telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch b/meta-networking/recipes-netkit/netkit- telnet/files/0001-telnetd-utility.c-Fix-buffer-overflow-in- netoprintf.patch
new file mode 100644
index 000000000..8f983e40a

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +0 -0

telnetd-utility.c-Fix-buffer-overflow-in-netoprintf.patch

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +1 -0
@@ -0,0 +1,56 @@
+From 9c81c8e5bc7782e8ae12c078615abc3c896059f2 Mon Sep 17

00:00:00

Quoted 50 lines
Quoted 50 lines

2001

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +3 -0
+From: Julius Hemanth Pitti <[email protected]>
+Date: Tue, 14 Jul 2020 22:34:19 -0700
+Subject: [PATCH] telnetd/utility.c: Fix buffer overflow in

netoprintf

meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +45 -0
+
+As per man page of vsnprintf, when formated
+string size is greater than "size"(2nd argument),
+then vsnprintf returns size of formated string,
+not "size"(2nd argument).
+
+netoprintf() was not handling a case where
+return value of vsnprintf is greater than
+"size"(2nd argument), results in buffer overflow
+while adjusting "nfrontp" pointer to point
+beyond "netobuf" buffer.
+
+Here is one such case where "nfrontp"
+crossed boundaries of "netobuf", and
+pointing to another global variable.
+
+(gdb) p &netobuf[8255]
+$5 = 0x55c93afe8b1f <netobuf+8255> ""
+(gdb) p nfrontp
+$6 = 0x55c93afe8c20 <terminaltype> "\377"
+(gdb) p &terminaltype
+$7 = (char **) 0x55c93afe8c20 <terminaltype>
+(gdb)
+
+This resulted in crash of telnetd service
+with segmentation fault.
+
+Though this is DoS security bug, I couldn't
+find any CVE ID for this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Julius Hemanth Pitti <[email protected]>
+---
+ telnetd/utility.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index b9a46a6..4811f14 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -66,7 +66,7 @@ netoprintf(const char *fmt, ...)
+       len = vsnprintf(nfrontp, maxsize, fmt, ap);
+       va_end(ap);
+
Quoted 8 lines

Review

Quoted 8 lines
+-      if (len<0 || len==maxsize) {
++      if (len<0 || len>=maxsize) {
meta-networking/recipes-netkit/netkit-telnet/files/0001- new file +5 -0
+        /* didn't fit */
+        netflush();
+       }
+--
+2.19.1
(quoted diff) +0 -0

telnet/netkit-

Quoted 9 lines

Review SRC_URI = " · line 13

Quoted 9 lines

telnet_0.17.bb b/meta-networking/recipes-netkit/netkit- telnet/netkit-telnet_0.17.bb
index 0e92add63..08dd532b6 100644
--- a/meta-networking/recipes-netkit/netkit-telnet/netkit- telnet_0.17.bb
+++ b/meta-networking/recipes-netkit/netkit-telnet/netkit- telnet_0.17.bb

(quoted diff) +0 -0
@@ -13,6 +13,7 @@ SRC_URI = "
 

http://ftp.linux.org.uk/pub/linux/Networking/netkit/${BP}.tar.gz \

Quoted 6 lines

Review SRC_URI = " · line 19

Quoted 6 lines
(quoted diff) +1 -0
            file://0001-telnet-telnetd-Fix-print-format-
 strings.patch \
            file://0001-telnet-telnetd-Fix-deadlock-on-
 cleanup.patch \
            file://CVE-2020-10188.patch \
+           file://0001-telnetd-utility.c-Fix-buffer-overflow-

in-

Quoted 7 lines
Quoted 7 lines
netoprintf.patch \
            "

UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/netkit-telnet/"
--
2.19.1