diff --git a/filesystem/drbd/drbd-tools/centos/drbd.spec b/filesystem/drbd/drbd-tools/centos/drbd.spec index a021b11d0..f712a25e0 100644 --- a/filesystem/drbd/drbd-tools/centos/drbd.spec +++ b/filesystem/drbd/drbd-tools/centos/drbd.spec @@ -46,6 +46,8 @@ 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 Patch0011: 0011-Unmount-all-targets-during-drbd-stop.patch +Patch0012: 0012-netlink-prepare-for-kernel-v5.2.patch +Patch0013: 0013-netlink-Add-NLA_F_NESTED-flag-to-nested-attribute.patch License: GPLv2+ ExclusiveOS: linux @@ -277,6 +279,8 @@ management utility. %patch0009 -p1 %patch0010 -p1 %patch0011 -p1 +%patch0012 -p1 +%patch0013 -p1 %build %configure \ diff --git a/filesystem/drbd/drbd-tools/centos/patches/0012-netlink-prepare-for-kernel-v5.2.patch b/filesystem/drbd/drbd-tools/centos/patches/0012-netlink-prepare-for-kernel-v5.2.patch new file mode 100644 index 000000000..1787d458f --- /dev/null +++ b/filesystem/drbd/drbd-tools/centos/patches/0012-netlink-prepare-for-kernel-v5.2.patch @@ -0,0 +1,29 @@ +From 536eac16f1b6636ce4153fa58c74c417c4f69753 Mon Sep 17 00:00:00 2001 +From: Roland Kammerer +Date: Fri, 12 Jul 2019 13:36:50 +0200 +Subject: [PATCH] netlink: prepare for kernel v5.2 + +[mvb: Adapted to drbd-utils 8.4.3.] +Signed-off-by: M. Vefa Bicakci +--- + user/libgenl.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/user/libgenl.h b/user/libgenl.h +index a37493a6e528..b1c3eab345ec 100644 +--- a/user/libgenl.h ++++ b/user/libgenl.h +@@ -23,6 +23,10 @@ + #define SOL_NETLINK 270 + #endif + ++#ifndef NLA_F_NESTED ++#define NLA_F_NESTED 0 ++#endif ++ + #define DEBUG_LEVEL 1 + + #define dbg(lvl, fmt, arg...) \ +-- +2.29.2 + diff --git a/filesystem/drbd/drbd-tools/centos/patches/0013-netlink-Add-NLA_F_NESTED-flag-to-nested-attribute.patch b/filesystem/drbd/drbd-tools/centos/patches/0013-netlink-Add-NLA_F_NESTED-flag-to-nested-attribute.patch new file mode 100644 index 000000000..32e995ca4 --- /dev/null +++ b/filesystem/drbd/drbd-tools/centos/patches/0013-netlink-Add-NLA_F_NESTED-flag-to-nested-attribute.patch @@ -0,0 +1,49 @@ +From 062ec873e733d278c9024be3783f59c532333b75 Mon Sep 17 00:00:00 2001 +From: He Zhe +Date: Fri, 12 Jul 2019 15:07:27 +0800 +Subject: [PATCH] netlink: Add NLA_F_NESTED flag to nested attribute + +The mainline kernel v5.2 commit b424e432e770 +("netlink: add validation of NLA_F_NESTED flag") imposes strict validation +against nested attribute as follow. + +" +Add new validation flag NL_VALIDATE_NESTED which adds three consistency +checks of NLA_F_NESTED_FLAG: + + - the flag is set on attributes with NLA_NESTED{,_ARRAY} policy + - the flag is not set on attributes with other policies except NLA_UNSPEC + - the flag is set on attribute passed to nla_parse_nested() +" + +Sending messages with nested attribute without NLA_F_NESTED would cause failed +validation. For example, + +$ drbdsetup new-resource r0 +Invalid argument + +This patch adds NLA_F_NESTED flag to all nested attributes. + +Signed-off-by: He Zhe +[mvb: Adapted to drbd-utils 8.4.3.] +Signed-off-by: M. Vefa Bicakci +--- + user/libgenl.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/user/libgenl.h b/user/libgenl.h +index b1c3eab345ec..3b1146109772 100644 +--- a/user/libgenl.h ++++ b/user/libgenl.h +@@ -851,7 +851,7 @@ static inline struct nlattr *nla_nest_start(struct msg_buff *msg, int attrtype) + { + struct nlattr *start = (struct nlattr *)msg->tail; + +- if (nla_put(msg, attrtype, 0, NULL) < 0) ++ if (nla_put(msg, attrtype | NLA_F_NESTED, 0, NULL) < 0) + return NULL; + + return start; +-- +2.29.2 +