aboutsummaryrefslogtreecommitdiffstats
path: root/main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch
diff options
context:
space:
mode:
authorHenrik Riomar <henrik.riomar@gmail.com>2019-03-21 23:13:18 +0100
committerCarlo Landmeter <clandmeter@alpinelinux.org>2019-04-21 10:00:25 +0000
commitbdaa9eb015d20e4539353d48dc00a624bfb2797c (patch)
tree82e96904ced37c4c6fb29d0dc80932dd64b803c6 /main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch
parent1996bb4083c7a6d0aa36fbc1743fe08d92fa4286 (diff)
downloadaports-bdaa9eb015d20e4539353d48dc00a624bfb2797c.tar.gz
aports-bdaa9eb015d20e4539353d48dc00a624bfb2797c.tar.bz2
aports-bdaa9eb015d20e4539353d48dc00a624bfb2797c.tar.xz
main/rpcbind: upgrade to 1.2.5
Diffstat (limited to 'main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch')
-rw-r--r--main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch b/main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch
new file mode 100644
index 0000000000..77937b73f4
--- /dev/null
+++ b/main/rpcbind/0001-rpcinfo-Fix-stack-buffer-overflow.patch
@@ -0,0 +1,69 @@
+From 0bc1c0ae7ce61a7ac8a8e9a9b2086268f011abf0 Mon Sep 17 00:00:00 2001
+From: Steve Dickson <steved@redhat.com>
+Date: Tue, 9 Oct 2018 09:19:50 -0400
+Subject: [PATCH] rpcinfo: Fix stack buffer overflow
+
+*** buffer overflow detected ***: rpcinfo terminated
+======= Backtrace: =========
+/lib64/libc.so.6(+0x721af)[0x7ff24c4451af]
+/lib64/libc.so.6(__fortify_fail+0x37)[0x7ff24c4ccdc7]
+/lib64/libc.so.6(+0xf8050)[0x7ff24c4cb050]
+rpcinfo(+0x435f)[0xef3be2635f]
+rpcinfo(+0x1c62)[0xef3be23c62]
+/lib64/libc.so.6(__libc_start_main+0xf5)[0x7ff24c3f36e5]
+rpcinfo(+0x2739)[0xef3be24739]
+======= Memory map: ========
+...
+The patch below fixes it.
+
+Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Thomas Blume <thomas.blume@suse.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ src/rpcinfo.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/src/rpcinfo.c b/src/rpcinfo.c
+index 9b46864..cfdba88 100644
+--- a/src/rpcinfo.c
++++ b/src/rpcinfo.c
+@@ -973,6 +973,7 @@ rpcbdump (dumptype, netid, argc, argv)
+ (" program version(s) netid(s) service owner\n");
+ for (rs = rs_head; rs; rs = rs->next)
+ {
++ size_t netidmax = sizeof(buf) - 1;
+ char *p = buf;
+
+ printf ("%10ld ", rs->prog);
+@@ -985,12 +986,22 @@ rpcbdump (dumptype, netid, argc, argv)
+ }
+ printf ("%-10s", buf);
+ buf[0] = '\0';
+- for (nl = rs->nlist; nl; nl = nl->next)
+- {
+- strcat (buf, nl->netid);
+- if (nl->next)
+- strcat (buf, ",");
+- }
++
++ for (nl = rs->nlist; nl; nl = nl->next)
++ {
++ strncat (buf, nl->netid, netidmax);
++ if (strlen (nl->netid) < netidmax)
++ netidmax -= strlen(nl->netid);
++ else
++ break;
++
++ if (nl->next && netidmax > 1)
++ {
++ strncat (buf, ",", netidmax);
++ netidmax --;
++ }
++ }
++
+ printf ("%-32s", buf);
+ rpc = getrpcbynumber (rs->prog);
+ if (rpc)
+--
+2.21.0
+