From 066fc51275cef94d1624fd58bb3065d050a6f17e Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Tue, 15 Sep 2009 17:54:43 +0400 Subject: af_ieee802154: setsockopt optlen arg isn't __user Remove __user annotation from optlen arg as it's bogus. Signed-off-by: Dmitry Eremin-Solenikov --- net/ieee802154/dgram.c | 2 +- net/ieee802154/raw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'net') diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index 77ae6852b93d..51593a48f2dd 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c @@ -414,7 +414,7 @@ static int dgram_getsockopt(struct sock *sk, int level, int optname, } static int dgram_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, int __user optlen) + char __user *optval, int optlen) { struct dgram_sock *ro = dgram_sk(sk); int val; diff --git a/net/ieee802154/raw.c b/net/ieee802154/raw.c index 4681501aae93..13198859982e 100644 --- a/net/ieee802154/raw.c +++ b/net/ieee802154/raw.c @@ -244,7 +244,7 @@ static int raw_getsockopt(struct sock *sk, int level, int optname, } static int raw_setsockopt(struct sock *sk, int level, int optname, - char __user *optval, int __user optlen) + char __user *optval, int optlen) { return -EOPNOTSUPP; } -- cgit v1.2.3 From c4835d81efb1795eb8bbeb40b73d74e5c04b1257 Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Thu, 10 Sep 2009 18:02:30 +0400 Subject: ieee802154: add locking for seq numbers Signed-off-by: Dmitry Eremin-Solenikov --- net/ieee802154/netlink.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net') diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c index 2106ecbf0308..ca767bde17a4 100644 --- a/net/ieee802154/netlink.c +++ b/net/ieee802154/netlink.c @@ -35,6 +35,7 @@ #include static unsigned int ieee802154_seq_num; +static DEFINE_SPINLOCK(ieee802154_seq_lock); static struct genl_family ieee802154_coordinator_family = { .id = GENL_ID_GENERATE, @@ -57,12 +58,15 @@ static struct sk_buff *ieee802154_nl_create(int flags, u8 req) { void *hdr; struct sk_buff *msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); + unsigned long f; if (!msg) return NULL; + spin_lock_irqsave(&ieee802154_seq_lock, f); hdr = genlmsg_put(msg, 0, ieee802154_seq_num++, &ieee802154_coordinator_family, flags, req); + spin_unlock_irqrestore(&ieee802154_seq_lock, f); if (!hdr) { nlmsg_free(msg); return NULL; -- cgit v1.2.3