diff options
Diffstat (limited to 'net/can/raw.c')
-rw-r--r-- | net/can/raw.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/can/raw.c b/net/can/raw.c index 69877b8e7e9c..6e0663faaf9f 100644 --- a/net/can/raw.c +++ b/net/can/raw.c | |||
@@ -210,7 +210,7 @@ static int raw_notifier(struct notifier_block *nb, | |||
210 | struct raw_sock *ro = container_of(nb, struct raw_sock, notifier); | 210 | struct raw_sock *ro = container_of(nb, struct raw_sock, notifier); |
211 | struct sock *sk = &ro->sk; | 211 | struct sock *sk = &ro->sk; |
212 | 212 | ||
213 | if (dev_net(dev) != &init_net) | 213 | if (!net_eq(dev_net(dev), &init_net)) |
214 | return NOTIFY_DONE; | 214 | return NOTIFY_DONE; |
215 | 215 | ||
216 | if (dev->type != ARPHRD_CAN) | 216 | if (dev->type != ARPHRD_CAN) |
@@ -632,6 +632,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
632 | } else | 632 | } else |
633 | ifindex = ro->ifindex; | 633 | ifindex = ro->ifindex; |
634 | 634 | ||
635 | if (size != sizeof(struct can_frame)) | ||
636 | return -EINVAL; | ||
637 | |||
635 | dev = dev_get_by_index(&init_net, ifindex); | 638 | dev = dev_get_by_index(&init_net, ifindex); |
636 | if (!dev) | 639 | if (!dev) |
637 | return -ENXIO; | 640 | return -ENXIO; |