From: Florian Westphal <fw@strlen.de>
To: netdev@vger.kernel.org
Cc: johannes@sipsolutions.net, Florian Westphal <fw@strlen.de>
Subject: [PATCH 2/4] netlink: store MSG_CMSG_COMPAT flag in netlink_skb_parms
Date: Tue, 6 Apr 2010 00:27:09 +0200 [thread overview]
Message-ID: <1270506431-25578-3-git-send-email-fw@strlen.de> (raw)
In-Reply-To: <1270506431-25578-1-git-send-email-fw@strlen.de>
This allows the netlink processing context to determine if the data
needs any 32 bit fixups.
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
include/linux/netlink.h | 1 +
net/netlink/af_netlink.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 6eaca5e..031e528 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -164,6 +164,7 @@ struct netlink_skb_parms {
__u32 loginuid; /* Login (audit) uid */
__u32 sessionid; /* Session id (audit) */
__u32 sid; /* SELinux security id */
+ bool msg_compat; /* Message needs 32bit fixups */
};
#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index beaada0..47c8314 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1339,6 +1339,9 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
NETLINK_CB(skb).dst_group = dst_group;
NETLINK_CB(skb).loginuid = audit_get_loginuid(current);
NETLINK_CB(skb).sessionid = audit_get_sessionid(current);
+#ifdef CONFIG_COMPAT_NETLINK_MESSAGES
+ NETLINK_CB(skb).msg_compat = !!(msg->msg_flags & MSG_CMSG_COMPAT);
+#endif
security_task_getsecid(current, &(NETLINK_CB(skb).sid));
memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
--
1.6.4.4
next prev parent reply other threads:[~2010-04-05 22:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-05 22:27 [PATCH v3 0/4] xfrm: add x86 CONFIG_COMPAT support Florian Westphal
2010-04-05 22:27 ` [PATCH 1/4] netlink: append NLMSG_DONE to compatskb, too Florian Westphal
2010-04-05 22:27 ` Florian Westphal [this message]
2010-04-05 22:27 ` [PATCH 3/4] xfrm: split nlmsg allocation and data copying Florian Westphal
2010-04-05 22:27 ` [PATCH 4/4] xfrm: CONFIG_COMPAT support for x86 architecture Florian Westphal
2010-04-07 10:08 ` [PATCH v3 0/4] xfrm: add x86 CONFIG_COMPAT support David Miller
2010-04-07 13:35 ` Florian Westphal
2010-04-07 13:45 ` Patrick McHardy
2010-04-07 23:48 ` David Miller
2010-04-08 9:44 ` Patrick McHardy
2010-04-08 9:54 ` David Miller
2010-04-08 11:24 ` Patrick McHardy
2010-04-08 5:00 ` David Miller
2010-05-13 6:41 ` 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=1270506431-25578-3-git-send-email-fw@strlen.de \
--to=fw@strlen.de \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.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).