Blob Blame History Raw
From: David Ahern <dsahern@gmail.com>
Date: Sun, 21 May 2017 10:12:03 -0600
Subject: [PATCH] net: ipv4: Add extack messages for route add failures
Patch-mainline: v4.13-rc1
Git-commit: c3ab2b4ec8f7c0700bf10957171c479bf3dbca52 (partial)
References: bsc#1152107 CVE-2019-16746

Add messages for non-obvious errors (e.g, no need to add text for malloc
failures or ENODEV failures). This mostly covers the annoying EINVAL errors
Some message strings violate the 80-columns but searchable strings need to
trump that rule.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Cho, Yu-Chen <acho@suse.com>
---
 include/linux/netlink.h |    5 +++++
 1 file changed, 5 insertions(+)

--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -97,6 +97,11 @@ struct netlink_ext_ack {
 #define NL_SET_ERR_MSG_MOD(extack, msg)			\
 	NL_SET_ERR_MSG((extack), KBUILD_MODNAME ": " msg)
 
+#define NL_SET_BAD_ATTR(extack, attr) do {		\
+	if ((extack))					\
+		(extack)->bad_attr = (attr);		\
+} while (0)
+
 extern void netlink_kernel_release(struct sock *sk);
 extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
 extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);