Merge "backport drbd main ipv6: Fix interface indices larger than 255"

This commit is contained in:
Zuul 2020-06-29 21:38:02 +00:00 committed by Gerrit Code Review
commit cd5367780a
2 changed files with 41 additions and 0 deletions

View File

@ -44,6 +44,7 @@ Patch0006: 0006-avoid-kernel-userspace-version-check.patch
Patch0007: 0007-Update-OCF-to-attempt-connect-in-certain-states.patch
Patch0008: 0008-Increase-short-cmd-timeout-to-15-secs.patch
Patch0009: 0009-Check-for-mounted-device-before-demoting-Primary-DRB.patch
Patch0010: 0010-backport-drbd-main-ipv6-Fix-interface-indices-larger.patch
License: GPLv2+
ExclusiveOS: linux
@ -273,6 +274,7 @@ management utility.
%patch0007 -p1
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%build
%configure \

View File

@ -0,0 +1,39 @@
From 393137563853cde5561845aeb8498d831d6368aa Mon Sep 17 00:00:00 2001
From: paul <paul@starlingx.com>
Date: Mon, 29 Jun 2020 16:48:39 +0000
Subject: [PATCH] backport: drbd main ipv6: Fix interface indices larger than
255
fscanf line probably copied from kernel printf, but printf specifies the
minimal field width and scanf the maximal field width.
The bug was triggered on Xen servers that create and assign new,
incremented interface IDs for new machines.
ifindex is of type int anyways: struct net_device as defined in
include/linux/netdevice.h. We should not rely on the assumption that
the values are small enough to fit in one byte.
Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
Signed-off-by: paul <paul@starlingx.com>
---
user/drbdadm_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/user/drbdadm_main.c b/user/drbdadm_main.c
index 19c5a44..d516d6f 100644
--- a/user/drbdadm_main.c
+++ b/user/drbdadm_main.c
@@ -3091,7 +3091,7 @@ int have_ip_ipv6(const char *ip)
while (fscanf
(if_inet6,
- X32(08) X32(08) X32(08) X32(08) " %*02x %*02x %*02x %*02x %s",
+ X32(08) X32(08) X32(08) X32(08) " %*x %*x %*x %*x %s",
b, b + 1, b + 2, b + 3, name) > 0) {
for (i = 0; i < 4; i++)
addr6.s6_addr32[i] = cpu_to_be32(b[i]);
--
1.8.3.1