Commit 804c64ea authored by Linus Torvalds's avatar Linus Torvalds
parents 49a43876 aa1c6a6f
This diff is collapsed.
...@@ -876,10 +876,12 @@ ...@@ -876,10 +876,12 @@
#define HOSTCC_STATUS_ERROR_ATTN 0x00000004 #define HOSTCC_STATUS_ERROR_ATTN 0x00000004
#define HOSTCC_RXCOL_TICKS 0x00003c08 #define HOSTCC_RXCOL_TICKS 0x00003c08
#define LOW_RXCOL_TICKS 0x00000032 #define LOW_RXCOL_TICKS 0x00000032
#define LOW_RXCOL_TICKS_CLRTCKS 0x00000014
#define DEFAULT_RXCOL_TICKS 0x00000048 #define DEFAULT_RXCOL_TICKS 0x00000048
#define HIGH_RXCOL_TICKS 0x00000096 #define HIGH_RXCOL_TICKS 0x00000096
#define HOSTCC_TXCOL_TICKS 0x00003c0c #define HOSTCC_TXCOL_TICKS 0x00003c0c
#define LOW_TXCOL_TICKS 0x00000096 #define LOW_TXCOL_TICKS 0x00000096
#define LOW_TXCOL_TICKS_CLRTCKS 0x00000048
#define DEFAULT_TXCOL_TICKS 0x0000012c #define DEFAULT_TXCOL_TICKS 0x0000012c
#define HIGH_TXCOL_TICKS 0x00000145 #define HIGH_TXCOL_TICKS 0x00000145
#define HOSTCC_RXMAX_FRAMES 0x00003c10 #define HOSTCC_RXMAX_FRAMES 0x00003c10
...@@ -892,8 +894,10 @@ ...@@ -892,8 +894,10 @@
#define HIGH_TXMAX_FRAMES 0x00000052 #define HIGH_TXMAX_FRAMES 0x00000052
#define HOSTCC_RXCOAL_TICK_INT 0x00003c18 #define HOSTCC_RXCOAL_TICK_INT 0x00003c18
#define DEFAULT_RXCOAL_TICK_INT 0x00000019 #define DEFAULT_RXCOAL_TICK_INT 0x00000019
#define DEFAULT_RXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_TXCOAL_TICK_INT 0x00003c1c #define HOSTCC_TXCOAL_TICK_INT 0x00003c1c
#define DEFAULT_TXCOAL_TICK_INT 0x00000019 #define DEFAULT_TXCOAL_TICK_INT 0x00000019
#define DEFAULT_TXCOAL_TICK_INT_CLRTCKS 0x00000014
#define HOSTCC_RXCOAL_MAXF_INT 0x00003c20 #define HOSTCC_RXCOAL_MAXF_INT 0x00003c20
#define DEFAULT_RXCOAL_MAXF_INT 0x00000005 #define DEFAULT_RXCOAL_MAXF_INT 0x00000005
#define HOSTCC_TXCOAL_MAXF_INT 0x00003c24 #define HOSTCC_TXCOAL_MAXF_INT 0x00003c24
...@@ -2023,6 +2027,7 @@ struct tg3 { ...@@ -2023,6 +2027,7 @@ struct tg3 {
struct tg3_hw_status *hw_status; struct tg3_hw_status *hw_status;
dma_addr_t status_mapping; dma_addr_t status_mapping;
u32 last_tag;
u32 msg_enable; u32 msg_enable;
...@@ -2068,6 +2073,7 @@ struct tg3 { ...@@ -2068,6 +2073,7 @@ struct tg3 {
u32 rx_offset; u32 rx_offset;
u32 tg3_flags; u32 tg3_flags;
#define TG3_FLAG_TAGGED_STATUS 0x00000001
#define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002 #define TG3_FLAG_TXD_MBOX_HWBUG 0x00000002
#define TG3_FLAG_RX_CHECKSUMS 0x00000004 #define TG3_FLAG_RX_CHECKSUMS 0x00000004
#define TG3_FLAG_USE_LINKCHG_REG 0x00000008 #define TG3_FLAG_USE_LINKCHG_REG 0x00000008
...@@ -2225,7 +2231,7 @@ struct tg3 { ...@@ -2225,7 +2231,7 @@ struct tg3 {
#define SST_25VF0X0_PAGE_SIZE 4098 #define SST_25VF0X0_PAGE_SIZE 4098
struct ethtool_coalesce coal;
}; };
#endif /* !(_T3_H) */ #endif /* !(_T3_H) */
...@@ -1580,6 +1580,7 @@ enoent: ...@@ -1580,6 +1580,7 @@ enoent:
fail: fail:
return dentry; return dentry;
} }
EXPORT_SYMBOL_GPL(lookup_create);
int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
{ {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* include/net/act_generic.h * include/net/act_generic.h
* *
*/ */
#ifndef ACT_GENERIC_H #ifndef _NET_ACT_GENERIC_H
#define ACT_GENERIC_H #define _NET_ACT_GENERIC_H
static inline int tcf_defact_release(struct tcf_defact *p, int bind) static inline int tcf_defact_release(struct tcf_defact *p, int bind)
{ {
int ret = 0; int ret = 0;
......
...@@ -490,6 +490,14 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) ...@@ -490,6 +490,14 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
/* Partially cloned skb? */ /* Partially cloned skb? */
if (skb_shared(frag)) if (skb_shared(frag))
goto slow_path; goto slow_path;
BUG_ON(frag->sk);
if (skb->sk) {
sock_hold(skb->sk);
frag->sk = skb->sk;
frag->destructor = sock_wfree;
skb->truesize -= frag->truesize;
}
} }
/* Everything is OK. Generate! */ /* Everything is OK. Generate! */
......
...@@ -508,7 +508,6 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, ...@@ -508,7 +508,6 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
rc = NF_ACCEPT; rc = NF_ACCEPT;
/* do not touch skb anymore */ /* do not touch skb anymore */
atomic_inc(&cp->in_pkts); atomic_inc(&cp->in_pkts);
__ip_vs_conn_put(cp);
goto out; goto out;
} }
......
...@@ -940,37 +940,25 @@ void ip_ct_refresh_acct(struct ip_conntrack *ct, ...@@ -940,37 +940,25 @@ void ip_ct_refresh_acct(struct ip_conntrack *ct,
struct sk_buff * struct sk_buff *
ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user) ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user)
{ {
struct sock *sk = skb->sk;
#ifdef CONFIG_NETFILTER_DEBUG #ifdef CONFIG_NETFILTER_DEBUG
unsigned int olddebug = skb->nf_debug; unsigned int olddebug = skb->nf_debug;
#endif #endif
if (sk) {
sock_hold(sk);
skb_orphan(skb); skb_orphan(skb);
}
local_bh_disable(); local_bh_disable();
skb = ip_defrag(skb, user); skb = ip_defrag(skb, user);
local_bh_enable(); local_bh_enable();
if (!skb) { if (skb) {
if (sk)
sock_put(sk);
return skb;
}
if (sk) {
skb_set_owner_w(skb, sk);
sock_put(sk);
}
ip_send_check(skb->nh.iph); ip_send_check(skb->nh.iph);
skb->nfcache |= NFC_ALTERED; skb->nfcache |= NFC_ALTERED;
#ifdef CONFIG_NETFILTER_DEBUG #ifdef CONFIG_NETFILTER_DEBUG
/* Packet path as if nothing had happened. */ /* Packet path as if nothing had happened. */
skb->nf_debug = olddebug; skb->nf_debug = olddebug;
#endif #endif
}
return skb; return skb;
} }
......
...@@ -552,13 +552,17 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) ...@@ -552,13 +552,17 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
skb_headroom(frag) < hlen) skb_headroom(frag) < hlen)
goto slow_path; goto slow_path;
/* Correct socket ownership. */
if (frag->sk == NULL)
goto slow_path;
/* Partially cloned skb? */ /* Partially cloned skb? */
if (skb_shared(frag)) if (skb_shared(frag))
goto slow_path; goto slow_path;
BUG_ON(frag->sk);
if (skb->sk) {
sock_hold(skb->sk);
frag->sk = skb->sk;
frag->destructor = sock_wfree;
skb->truesize -= frag->truesize;
}
} }
err = 0; err = 0;
...@@ -1116,12 +1120,10 @@ int ip6_push_pending_frames(struct sock *sk) ...@@ -1116,12 +1120,10 @@ int ip6_push_pending_frames(struct sock *sk)
tail_skb = &(tmp_skb->next); tail_skb = &(tmp_skb->next);
skb->len += tmp_skb->len; skb->len += tmp_skb->len;
skb->data_len += tmp_skb->len; skb->data_len += tmp_skb->len;
#if 0 /* Logically correct, but useless work, ip_fragment() will have to undo */
skb->truesize += tmp_skb->truesize; skb->truesize += tmp_skb->truesize;
__sock_put(tmp_skb->sk); __sock_put(tmp_skb->sk);
tmp_skb->destructor = NULL; tmp_skb->destructor = NULL;
tmp_skb->sk = NULL; tmp_skb->sk = NULL;
#endif
} }
ipv6_addr_copy(final_dst, &fl->fl6_dst); ipv6_addr_copy(final_dst, &fl->fl6_dst);
......
...@@ -735,11 +735,15 @@ static inline int do_one_broadcast(struct sock *sk, ...@@ -735,11 +735,15 @@ static inline int do_one_broadcast(struct sock *sk,
sock_hold(sk); sock_hold(sk);
if (p->skb2 == NULL) { if (p->skb2 == NULL) {
if (atomic_read(&p->skb->users) != 1) { if (skb_shared(p->skb)) {
p->skb2 = skb_clone(p->skb, p->allocation); p->skb2 = skb_clone(p->skb, p->allocation);
} else { } else {
p->skb2 = p->skb; p->skb2 = skb_get(p->skb);
atomic_inc(&p->skb->users); /*
* skb ownership may have been set when
* delivered to a previous socket.
*/
skb_orphan(p->skb2);
} }
} }
if (p->skb2 == NULL) { if (p->skb2 == NULL) {
...@@ -785,11 +789,12 @@ int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid, ...@@ -785,11 +789,12 @@ int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid,
sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
do_one_broadcast(sk, &info); do_one_broadcast(sk, &info);
kfree_skb(skb);
netlink_unlock_table(); netlink_unlock_table();
if (info.skb2) if (info.skb2)
kfree_skb(info.skb2); kfree_skb(info.skb2);
kfree_skb(skb);
if (info.delivered) { if (info.delivered) {
if (info.congested && (allocation & __GFP_WAIT)) if (info.congested && (allocation & __GFP_WAIT))
......
...@@ -770,33 +770,12 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) ...@@ -770,33 +770,12 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
err = path_lookup(sunaddr->sun_path, LOOKUP_PARENT, &nd); err = path_lookup(sunaddr->sun_path, LOOKUP_PARENT, &nd);
if (err) if (err)
goto out_mknod_parent; goto out_mknod_parent;
/*
* Yucky last component or no last component at all? dentry = lookup_create(&nd, 0);
* (foo/., foo/.., /////)
*/
err = -EEXIST;
if (nd.last_type != LAST_NORM)
goto out_mknod;
/*
* Lock the directory.
*/
down(&nd.dentry->d_inode->i_sem);
/*
* Do the final lookup.
*/
dentry = lookup_hash(&nd.last, nd.dentry);
err = PTR_ERR(dentry); err = PTR_ERR(dentry);
if (IS_ERR(dentry)) if (IS_ERR(dentry))
goto out_mknod_unlock; goto out_mknod_unlock;
err = -ENOENT;
/*
* Special case - lookup gave negative, but... we had foo/bar/
* From the vfs_mknod() POV we just have a negative dentry -
* all is fine. Let's be bastards - you had / on the end, you've
* been asking for (non-existent) directory. -ENOENT for you.
*/
if (nd.last.name[nd.last.len] && !dentry->d_inode)
goto out_mknod_dput;
/* /*
* All right, let's create it. * All right, let's create it.
*/ */
...@@ -845,7 +824,6 @@ out_mknod_dput: ...@@ -845,7 +824,6 @@ out_mknod_dput:
dput(dentry); dput(dentry);
out_mknod_unlock: out_mknod_unlock:
up(&nd.dentry->d_inode->i_sem); up(&nd.dentry->d_inode->i_sem);
out_mknod:
path_release(&nd); path_release(&nd);
out_mknod_parent: out_mknod_parent:
if (err==-EEXIST) if (err==-EEXIST)
......
...@@ -698,7 +698,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer) ...@@ -698,7 +698,7 @@ int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer)
return -ENOMEM; return -ENOMEM;
if (skb1->sk) if (skb1->sk)
skb_set_owner_w(skb, skb1->sk); skb_set_owner_w(skb2, skb1->sk);
/* Looking around. Are we still alive? /* Looking around. Are we still alive?
* OK, link new skb, drop old one */ * OK, link new skb, drop old one */
......
...@@ -34,14 +34,21 @@ static int verify_one_alg(struct rtattr **xfrma, enum xfrm_attr_type_t type) ...@@ -34,14 +34,21 @@ static int verify_one_alg(struct rtattr **xfrma, enum xfrm_attr_type_t type)
{ {
struct rtattr *rt = xfrma[type - 1]; struct rtattr *rt = xfrma[type - 1];
struct xfrm_algo *algp; struct xfrm_algo *algp;
int len;
if (!rt) if (!rt)
return 0; return 0;
if ((rt->rta_len - sizeof(*rt)) < sizeof(*algp)) len = (rt->rta_len - sizeof(*rt)) - sizeof(*algp);
if (len < 0)
return -EINVAL; return -EINVAL;
algp = RTA_DATA(rt); algp = RTA_DATA(rt);
len -= (algp->alg_key_len + 7U) / 8;
if (len < 0)
return -EINVAL;
switch (type) { switch (type) {
case XFRMA_ALG_AUTH: case XFRMA_ALG_AUTH:
if (!algp->alg_key_len && if (!algp->alg_key_len &&
...@@ -162,6 +169,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, ...@@ -162,6 +169,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
struct rtattr *rta = u_arg; struct rtattr *rta = u_arg;
struct xfrm_algo *p, *ualg; struct xfrm_algo *p, *ualg;
struct xfrm_algo_desc *algo; struct xfrm_algo_desc *algo;
int len;
if (!rta) if (!rta)
return 0; return 0;
...@@ -173,11 +181,12 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, ...@@ -173,11 +181,12 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
return -ENOSYS; return -ENOSYS;
*props = algo->desc.sadb_alg_id; *props = algo->desc.sadb_alg_id;
p = kmalloc(sizeof(*ualg) + ualg->alg_key_len, GFP_KERNEL); len = sizeof(*ualg) + (ualg->alg_key_len + 7U) / 8;
p = kmalloc(len, GFP_KERNEL);
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
memcpy(p, ualg, sizeof(*ualg) + ualg->alg_key_len); memcpy(p, ualg, len);
*algpp = p; *algpp = p;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment