[PATCH] networking: Fixed crash in ip neigh show.

Balaji Punnuru balaji.punnuru at gmail.com
Wed Feb 7 23:21:47 UTC 2018


Some times when running ip neigh show, and ip route show
The corruption of buffer which happens randomly, since the the RTAttribute
array is not intialized.

Signed-off-by: Balaji Punnuru <balaji_punnuru at cable.comcast.com>
---
 networking/libiproute/libnetlink.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/networking/libiproute/libnetlink.c
b/networking/libiproute/libnetlink.c
index 3f0f703..44e28ff 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
@@ -401,6 +401,11 @@ int FAST_FUNC rta_addattr_l(struct rtattr *rta, int
maxlen, int type, void *data

 void FAST_FUNC parse_rtattr(struct rtattr *tb[], int max, struct rtattr
*rta, int len)
 {
+        int index = 0;
+        for (index =0; index <= max; ++index) {
+               tb[index] = NULL;
+        }
+
        while (RTA_OK(rta, len)) {
                if (rta->rta_type <= max) {
                        tb[rta->rta_type] = rta;
-- 
2.1.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20180207/845aa56d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-networking-Fixed-crash-in-ip-neigh-show.patch
Type: text/x-patch
Size: 1319 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20180207/845aa56d/attachment.bin>


More information about the busybox mailing list