From: Nazarov Sergey <s-nazarov@yandex.ru>
To: David Miller <davem@davemloft.net>
Cc: "paul@paul-moore.com" <paul@paul-moore.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-security-module@vger.kernel.org"
<linux-security-module@vger.kernel.org>,
"kuznet@ms2.inr.ac.ru" <kuznet@ms2.inr.ac.ru>,
"yoshfuji@linux-ipv6.org" <yoshfuji@linux-ipv6.org>
Subject: [PATCH v2 1/2] NETWORKING: avoid use IPCB in cipso_v4_error
Date: Mon, 25 Feb 2019 19:24:15 +0300 [thread overview]
Message-ID: <52295911551111855@myt5-f1576e7b5bad.qloud-c.yandex.net> (raw)
In-Reply-To: <20190224.173328.1032826011262803545.davem@davemloft.net>
Add __icmp_send function having ip_options struct parameter
Signed-off-by: Sergey Nazarov <s-nazarov@yandex.ru>
---
include/net/icmp.h | 9 ++++++++-
net/ipv4/icmp.c | 7 ++++---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 6ac3a5b..e0f709d 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -22,6 +22,7 @@
#include <net/inet_sock.h>
#include <net/snmp.h>
+#include <net/ip.h>
struct icmp_err {
int errno;
@@ -39,7 +40,13 @@ struct icmp_err {
struct sk_buff;
struct net;
-void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
+void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
+ const struct ip_options *opt);
+static inline void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
+{
+ __icmp_send(skb_in, type, code, info, &IPCB(skb_in)->opt);
+}
+
int icmp_rcv(struct sk_buff *skb);
int icmp_err(struct sk_buff *skb, u32 info);
int icmp_init(void);
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 065997f..3f24414 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -570,7 +570,8 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
* MUST reply to only the first fragment.
*/
-void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
+void __icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info,
+ const struct ip_options *opt)
{
struct iphdr *iph;
int room;
@@ -691,7 +692,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
iph->tos;
mark = IP4_REPLY_MARK(net, skb_in->mark);
- if (ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in))
+ if (__ip_options_echo(net, &icmp_param.replyopts.opt.opt, skb_in, opt))
goto out_unlock;
@@ -742,7 +743,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
local_bh_enable();
out:;
}
-EXPORT_SYMBOL(icmp_send);
+EXPORT_SYMBOL(__icmp_send);
static void icmp_socket_deliver(struct sk_buff *skb, u32 info)
---
next prev parent reply other threads:[~2019-02-25 16:24 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-15 17:06 Kernel memory corruption in CIPSO labeled TCP packets processing Nazarov Sergey
2019-01-15 17:55 ` Casey Schaufler
2019-01-15 19:52 ` Paul Moore
2019-01-18 14:53 ` Paul Moore
2019-01-18 16:34 ` Nazarov Sergey
2019-01-18 17:17 ` Paul Moore
2019-01-21 17:11 ` Nazarov Sergey
2019-01-22 16:49 ` Paul Moore
2019-01-22 17:35 ` Nazarov Sergey
2019-01-22 17:48 ` Paul Moore
2019-01-24 14:46 ` Nazarov Sergey
2019-01-25 16:45 ` Paul Moore
2019-01-28 13:10 ` Nazarov Sergey
2019-01-28 22:18 ` Paul Moore
2019-01-29 7:23 ` Nazarov Sergey
2019-01-29 22:42 ` Paul Moore
2019-01-30 13:11 ` Nazarov Sergey
2019-01-31 2:10 ` Paul Moore
2019-01-31 13:20 ` Nazarov Sergey
2019-02-11 20:37 ` Paul Moore
2019-02-11 21:21 ` Nazarov Sergey
2019-02-11 23:43 ` Paul Moore
2019-02-12 15:10 ` [PATCH] NETWORKING: avoid use IPCB in cipso_v4_error Nazarov Sergey
2019-02-13 21:41 ` Paul Moore
2019-02-14 18:00 ` Nazarov Sergey
2019-02-14 18:59 ` Stephen Smalley
2019-02-14 16:43 ` David Miller
2019-02-14 18:14 ` Nazarov Sergey
2019-02-15 19:02 ` Paul Moore
2019-02-15 20:00 ` David Miller
2019-02-15 20:04 ` Paul Moore
2019-02-18 13:39 ` Nazarov Sergey
2019-02-19 1:25 ` David Miller
2019-02-22 16:35 ` Nazarov Sergey
2019-02-22 17:39 ` [PATCH v2 0/2] " Nazarov Sergey
2019-02-25 1:33 ` David Miller
2019-02-25 16:24 ` Nazarov Sergey [this message]
2019-02-25 22:07 ` [PATCH v2 1/2] " Paul Moore
2019-02-25 22:33 ` David Miller
2019-02-25 23:30 ` Paul Moore
2019-02-25 16:27 ` [PATCH v2 2/2] " Nazarov Sergey
2019-02-25 22:06 ` Paul Moore
2019-02-25 22:34 ` David Miller
2019-02-22 17:43 ` [PATCH v2 1/2] " Nazarov Sergey
2019-02-22 17:50 ` [PATCH v2 2/2] " Nazarov Sergey
2019-02-25 1:33 ` [PATCH] " David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52295911551111855@myt5-f1576e7b5bad.qloud-c.yandex.net \
--to=s-nazarov@yandex.ru \
--cc=davem@davemloft.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-security-module@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).