aboutsummaryrefslogtreecommitdiffstats
path: root/net/lapb/lapb_subr.c
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2013-04-12 14:04:19 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-04-17 11:54:07 -0400
commitcb2d8b342aa084d1f3ac29966245dec9163677fb (patch)
tree0604b13530fba679379275a8af38a68c0ec3ac1c /net/lapb/lapb_subr.c
parent50acff3c1f9ee9753684e676929b82926f15966c (diff)
ARM: 7698/1: perf: fix group validation when using enable_on_exec
Events may be created with attr->disabled == 1 and attr->enable_on_exec == 1, which confuses the group validation code because events with the PERF_EVENT_STATE_OFF are not considered candidates for scheduling, which may lead to failure at group scheduling time. This patch fixes the validation check for ARM, so that events in the OFF state are still considered when enable_on_exec is true. Cc: stable@vger.kernel.org Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: Jiri Olsa <jolsa@redhat.com> Reported-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions
h, hdrlen); if (unlikely(optlen)) { struct ip_beet_phdr *ph; BUG_ON(optlen < 0); ph = (struct ip_beet_phdr *)skb->h.raw; ph->padlen = 4 - (optlen & 4); ph->hdrlen = (optlen + ph->padlen + sizeof(*ph)) / 8; ph->nexthdr = top_iph->protocol; top_iph->protocol = IPPROTO_BEETPH; top_iph->ihl = sizeof(struct iphdr) / 4; } top_iph->saddr = x->props.saddr.a4; top_iph->daddr = x->id.daddr.a4; return 0; } static int xfrm4_beet_input(struct xfrm_state *x, struct sk_buff *skb) { struct iphdr *iph = skb->nh.iph; int phlen = 0; int optlen = 0; __u8 ph_nexthdr = 0, protocol = 0; int err = -EINVAL; protocol = iph->protocol; if (unlikely(iph->protocol == IPPROTO_BEETPH)) { struct ip_beet_phdr *ph = (struct ip_beet_phdr*)(iph + 1); if (!pskb_may_pull(skb, sizeof(*ph))) goto out; phlen = ph->hdrlen * 8; optlen = phlen - ph->padlen - sizeof(*ph); if (optlen < 0 || optlen & 3 || optlen > 250) goto out; if (!pskb_may_pull(skb, phlen)) goto out; ph_nexthdr = ph->nexthdr; } skb_push(skb, sizeof(*iph) - phlen + optlen); memmove(skb->data, skb->nh.raw, sizeof(*iph)); skb->nh.raw = skb->data; iph = skb->nh.iph; iph->ihl = (sizeof(*iph) + optlen) / 4; iph->tot_len = htons(skb->len); iph->daddr = x->sel.daddr.a4; iph->saddr = x->sel.saddr.a4; if (ph_nexthdr) iph->protocol = ph_nexthdr; else iph->protocol = protocol; iph->check = 0; iph->check = ip_fast_csum(skb->nh.raw, iph->ihl); err = 0; out: return err; } static struct xfrm_mode xfrm4_beet_mode = { .input = xfrm4_beet_input, .output = xfrm4_beet_output, .owner = THIS_MODULE, .encap = XFRM_MODE_BEET, }; static int __init xfrm4_beet_init(void) { return xfrm_register_mode(&xfrm4_beet_mode, AF_INET); } static void __exit xfrm4_beet_exit(void) { int err; err = xfrm_unregister_mode(&xfrm4_beet_mode, AF_INET); BUG_ON(err); } module_init(xfrm4_beet_init); module_exit(xfrm4_beet_exit); MODULE_LICENSE("GPL"); MODULE_ALIAS_XFRM_MODE(AF_INET, XFRM_MODE_BEET);