summarylogtreecommitdiffstats
path: root/gcc-10-drop_monitor-work-around-stringop-overflow-wa.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-10-drop_monitor-work-around-stringop-overflow-wa.patch')
-rw-r--r--gcc-10-drop_monitor-work-around-stringop-overflow-wa.patch73
1 files changed, 0 insertions, 73 deletions
diff --git a/gcc-10-drop_monitor-work-around-stringop-overflow-wa.patch b/gcc-10-drop_monitor-work-around-stringop-overflow-wa.patch
deleted file mode 100644
index 8aaeaf34bf69..000000000000
--- a/gcc-10-drop_monitor-work-around-stringop-overflow-wa.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 440d43ac6705396c96694a30847a6728da79a76d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Thu, 30 Apr 2020 23:30:49 +0200
-Subject: drop_monitor: work around gcc-10 stringop-overflow warning
-
-From: Arnd Bergmann <arnd@arndb.de>
-
-[ Upstream commit dc30b4059f6e2abf3712ab537c8718562b21c45d ]
-
-The current gcc-10 snapshot produces a false-positive warning:
-
-net/core/drop_monitor.c: In function 'trace_drop_common.constprop':
-cc1: error: writing 8 bytes into a region of size 0 [-Werror=stringop-overflow=]
-In file included from net/core/drop_monitor.c:23:
-include/uapi/linux/net_dropmon.h:36:8: note: at offset 0 to object 'entries' with size 4 declared here
- 36 | __u32 entries;
- | ^~~~~~~
-
-I reported this in the gcc bugzilla, but in case it does not get
-fixed in the release, work around it by using a temporary variable.
-
-Fixes: 9a8afc8d3962 ("Network Drop Monitor: Adding drop monitor implementation & Netlink protocol")
-Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94881
-Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-Acked-by: Neil Horman <nhorman@tuxdriver.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- net/core/drop_monitor.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
-
-diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
-index c7785efeea577..3978a5e8d261c 100644
---- a/net/core/drop_monitor.c
-+++ b/net/core/drop_monitor.c
-@@ -154,6 +154,7 @@ static void sched_send_work(struct timer_list *t)
- static void trace_drop_common(struct sk_buff *skb, void *location)
- {
- struct net_dm_alert_msg *msg;
-+ struct net_dm_drop_point *point;
- struct nlmsghdr *nlh;
- struct nlattr *nla;
- int i;
-@@ -172,11 +173,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
- nlh = (struct nlmsghdr *)dskb->data;
- nla = genlmsg_data(nlmsg_data(nlh));
- msg = nla_data(nla);
-+ point = msg->points;
- for (i = 0; i < msg->entries; i++) {
-- if (!memcmp(&location, msg->points[i].pc, sizeof(void *))) {
-- msg->points[i].count++;
-+ if (!memcmp(&location, &point->pc, sizeof(void *))) {
-+ point->count++;
- goto out;
- }
-+ point++;
- }
- if (msg->entries == dm_hit_limit)
- goto out;
-@@ -185,8 +188,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
- */
- __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
- nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
-- memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
-- msg->points[msg->entries].count = 1;
-+ memcpy(point->pc, &location, sizeof(void *));
-+ point->count = 1;
- msg->entries++;
-
- if (!timer_pending(&data->send_timer)) {
---
-2.20.1
-