Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6: (27 commits)
  [INET]: Fix inet_diag dead-lock regression
  [NETNS]: Fix /proc/net breakage
  [TEXTSEARCH]: Do not allow zero length patterns in the textsearch infrastructure
  [NETFILTER]: fix forgotten module release in xt_CONNMARK and xt_CONNSECMARK
  [NETFILTER]: xt_TCPMSS: remove network triggerable WARN_ON
  [DECNET]: dn_nl_deladdr() almost always returns no error
  [IPV6]: Restore IPv6 when MTU is big enough
  [RXRPC]: Add missing select on CRYPTO
  mac80211: rate limit wep decrypt failed messages
  rfkill: fix double-mutex-locking
  mac80211: drop unencrypted frames if encryption is expected
  mac80211: Fix behavior of ieee80211_open and ieee80211_close
  ieee80211: fix unaligned access in ieee80211_copy_snap
  mac80211: free ifsta->extra_ie and clear IEEE80211_STA_PRIVACY_INVOKED
  SCTP: Fix build issues with SCTP AUTH.
  SCTP: Fix chunk acceptance when no authenticated chunks were listed.
  SCTP: Fix the supported extensions paramter
  SCTP: Fix SCTP-AUTH to correctly add HMACS paramter.
  SCTP: Fix the number of HB transmissions.
  [TCP] illinois: Incorrect beta usage
  ...
  • Loading branch information
Linus Torvalds committed Dec 3, 2007
2 parents e87cb5d + d523a32 commit 8002ced
Show file tree
Hide file tree
Showing 29 changed files with 160 additions and 177 deletions.
11 changes: 5 additions & 6 deletions drivers/net/sungem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2281,14 +2281,12 @@ static void gem_reset_task(struct work_struct *work)

mutex_lock(&gp->pm_mutex);

napi_disable(&gp->napi);
if (gp->opened)
napi_disable(&gp->napi);

spin_lock_irq(&gp->lock);
spin_lock(&gp->tx_lock);

if (gp->running == 0)
goto not_running;

if (gp->running) {
netif_stop_queue(gp->dev);

Expand All @@ -2298,13 +2296,14 @@ static void gem_reset_task(struct work_struct *work)
gem_set_link_modes(gp);
netif_wake_queue(gp->dev);
}
not_running:

gp->reset_task_pending = 0;

spin_unlock(&gp->tx_lock);
spin_unlock_irq(&gp->lock);

napi_enable(&gp->napi);
if (gp->opened)
napi_enable(&gp->napi);

mutex_unlock(&gp->pm_mutex);
}
Expand Down
12 changes: 11 additions & 1 deletion fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,16 @@ static int proc_delete_dentry(struct dentry * dentry)
return 1;
}

static int proc_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
{
d_drop(dentry);
return 0;
}

static struct dentry_operations proc_dentry_operations =
{
.d_delete = proc_delete_dentry,
.d_revalidate = proc_revalidate_dentry,
};

/*
Expand All @@ -397,8 +404,11 @@ struct dentry *proc_lookup(struct inode * dir, struct dentry *dentry, struct nam
if (de->namelen != dentry->d_name.len)
continue;
if (!memcmp(dentry->d_name.name, de->name, de->namelen)) {
unsigned int ino = de->low_ino;
unsigned int ino;

if (de->shadow_proc)
de = de->shadow_proc(current, de);
ino = de->low_ino;
de_get(de);
spin_unlock(&proc_subdir_lock);
error = -EINVAL;
Expand Down
86 changes: 5 additions & 81 deletions fs/proc/proc_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,89 +50,14 @@ struct net *get_proc_net(const struct inode *inode)
}
EXPORT_SYMBOL_GPL(get_proc_net);

static struct proc_dir_entry *proc_net_shadow;
static struct proc_dir_entry *shadow_pde;

static struct dentry *proc_net_shadow_dentry(struct dentry *parent,
static struct proc_dir_entry *proc_net_shadow(struct task_struct *task,
struct proc_dir_entry *de)
{
struct dentry *shadow = NULL;
struct inode *inode;
if (!de)
goto out;
de_get(de);
inode = proc_get_inode(parent->d_inode->i_sb, de->low_ino, de);
if (!inode)
goto out_de_put;
shadow = d_alloc_name(parent, de->name);
if (!shadow)
goto out_iput;
shadow->d_op = parent->d_op; /* proc_dentry_operations */
d_instantiate(shadow, inode);
out:
return shadow;
out_iput:
iput(inode);
out_de_put:
de_put(de);
goto out;
}

static void *proc_net_follow_link(struct dentry *parent, struct nameidata *nd)
{
struct net *net = current->nsproxy->net_ns;
struct dentry *shadow;
shadow = proc_net_shadow_dentry(parent, net->proc_net);
if (!shadow)
return ERR_PTR(-ENOENT);

dput(nd->dentry);
/* My dentry count is 1 and that should be enough as the
* shadow dentry is thrown away immediately.
*/
nd->dentry = shadow;
return NULL;
return task->nsproxy->net_ns->proc_net;
}

static struct dentry *proc_net_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *nd)
{
struct net *net = current->nsproxy->net_ns;
struct dentry *shadow;

shadow = proc_net_shadow_dentry(nd->dentry, net->proc_net);
if (!shadow)
return ERR_PTR(-ENOENT);

dput(nd->dentry);
nd->dentry = shadow;

return shadow->d_inode->i_op->lookup(shadow->d_inode, dentry, nd);
}

static int proc_net_setattr(struct dentry *dentry, struct iattr *iattr)
{
struct net *net = current->nsproxy->net_ns;
struct dentry *shadow;
int ret;

shadow = proc_net_shadow_dentry(dentry->d_parent, net->proc_net);
if (!shadow)
return -ENOENT;
ret = shadow->d_inode->i_op->setattr(shadow, iattr);
dput(shadow);
return ret;
}

static const struct file_operations proc_net_dir_operations = {
.read = generic_read_dir,
};

static struct inode_operations proc_net_dir_inode_operations = {
.follow_link = proc_net_follow_link,
.lookup = proc_net_lookup,
.setattr = proc_net_setattr,
};

static __net_init int proc_net_ns_init(struct net *net)
{
struct proc_dir_entry *root, *netd, *net_statd;
Expand Down Expand Up @@ -185,9 +110,8 @@ static struct pernet_operations __net_initdata proc_net_ns_ops = {

int __init proc_net_init(void)
{
proc_net_shadow = proc_mkdir("net", NULL);
proc_net_shadow->proc_iops = &proc_net_dir_inode_operations;
proc_net_shadow->proc_fops = &proc_net_dir_operations;
shadow_pde = proc_mkdir("net", NULL);
shadow_pde->shadow_proc = proc_net_shadow;

return register_pernet_subsys(&proc_net_ns_ops);
}
3 changes: 3 additions & 0 deletions include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ typedef int (read_proc_t)(char *page, char **start, off_t off,
typedef int (write_proc_t)(struct file *file, const char __user *buffer,
unsigned long count, void *data);
typedef int (get_info_t)(char *, char **, off_t, int);
typedef struct proc_dir_entry *(shadow_proc_t)(struct task_struct *task,
struct proc_dir_entry *pde);

struct proc_dir_entry {
unsigned int low_ino;
Expand Down Expand Up @@ -79,6 +81,7 @@ struct proc_dir_entry {
int pde_users; /* number of callers into module in progress */
spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
struct completion *pde_unload_completion;
shadow_proc_t *shadow_proc;
};

struct kcore_list {
Expand Down
9 changes: 6 additions & 3 deletions include/net/sctp/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,14 @@ enum {
SCTP_AUTH_HMAC_ID_RESERVED_0,
SCTP_AUTH_HMAC_ID_SHA1,
SCTP_AUTH_HMAC_ID_RESERVED_2,
SCTP_AUTH_HMAC_ID_SHA256
#if defined (CONFIG_CRYPTO_SHA256) || defined (CONFIG_CRYPTO_SHA256_MODULE)
SCTP_AUTH_HMAC_ID_SHA256,
#endif
__SCTP_AUTH_HMAC_MAX
};

#define SCTP_AUTH_HMAC_ID_MAX SCTP_AUTH_HMAC_ID_SHA256
#define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1)
#define SCTP_AUTH_HMAC_ID_MAX __SCTP_AUTH_HMAC_MAX - 1
#define SCTP_AUTH_NUM_HMACS __SCTP_AUTH_HMAC_MAX
#define SCTP_SHA1_SIG_SIZE 20
#define SCTP_SHA256_SIG_SIZE 32

Expand Down
8 changes: 6 additions & 2 deletions lib/textsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* 2 of the License, or (at your option) any later version.
*
* Authors: Thomas Graf <[email protected]>
* Pablo Neira Ayuso <pablo@eurodev.net>
* Pablo Neira Ayuso <pablo@netfilter.org>
*
* ==========================================================================
*
Expand Down Expand Up @@ -250,7 +250,8 @@ unsigned int textsearch_find_continuous(struct ts_config *conf,
* the various search algorithms.
*
* Returns a new textsearch configuration according to the specified
* parameters or a ERR_PTR().
* parameters or a ERR_PTR(). If a zero length pattern is passed, this
* function returns EINVAL.
*/
struct ts_config *textsearch_prepare(const char *algo, const void *pattern,
unsigned int len, gfp_t gfp_mask, int flags)
Expand All @@ -259,6 +260,9 @@ struct ts_config *textsearch_prepare(const char *algo, const void *pattern,
struct ts_config *conf;
struct ts_ops *ops;

if (len == 0)
return ERR_PTR(-EINVAL);

ops = lookup_ts_algo(algo);
#ifdef CONFIG_KMOD
/*
Expand Down
3 changes: 2 additions & 1 deletion net/8021q/vlan_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
* OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
*/

if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
VLAN_DEV_INFO(dev)->flags & VLAN_FLAG_REORDER_HDR) {
int orig_headroom = skb_headroom(skb);
unsigned short veth_TCI;

Expand Down
4 changes: 3 additions & 1 deletion net/bridge/br.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int __init br_init(void)

err = br_fdb_init();
if (err)
goto err_out1;
goto err_out;

err = br_netfilter_init();
if (err)
Expand All @@ -65,6 +65,8 @@ static int __init br_init(void)
err_out2:
br_netfilter_fini();
err_out1:
br_fdb_fini();
err_out:
llc_sap_put(br_stp_sap);
return err;
}
Expand Down
7 changes: 4 additions & 3 deletions net/bridge/br_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ static inline int is_link_local(const unsigned char *dest)
struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)
{
const unsigned char *dest = eth_hdr(skb)->h_dest;
int (*rhook)(struct sk_buff *skb);

if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
goto drop;
Expand All @@ -147,9 +148,9 @@ struct sk_buff *br_handle_frame(struct net_bridge_port *p, struct sk_buff *skb)

switch (p->state) {
case BR_STATE_FORWARDING:

if (br_should_route_hook) {
if (br_should_route_hook(skb))
rhook = rcu_dereference(br_should_route_hook);
if (rhook != NULL) {
if (rhook(skb))
return skb;
dest = eth_hdr(skb)->h_dest;
}
Expand Down
4 changes: 2 additions & 2 deletions net/bridge/netfilter/ebtable_broute.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ static int __init ebtable_broute_init(void)
if (ret < 0)
return ret;
/* see br_input.c */
br_should_route_hook = ebt_broute;
rcu_assign_pointer(br_should_route_hook, ebt_broute);
return ret;
}

static void __exit ebtable_broute_fini(void)
{
br_should_route_hook = NULL;
rcu_assign_pointer(br_should_route_hook, NULL);
synchronize_net();
ebt_unregister_table(&broute_table);
}
Expand Down
4 changes: 3 additions & 1 deletion net/decnet/dn_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,16 +651,18 @@ static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
struct dn_dev *dn_db;
struct ifaddrmsg *ifm;
struct dn_ifaddr *ifa, **ifap;
int err = -EADDRNOTAVAIL;
int err;

err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy);
if (err < 0)
goto errout;

err = -ENODEV;
ifm = nlmsg_data(nlh);
if ((dn_db = dn_dev_by_index(ifm->ifa_index)) == NULL)
goto errout;

err = -EADDRNOTAVAIL;
for (ifap = &dn_db->ifa_list; (ifa = *ifap); ifap = &ifa->ifa_next) {
if (tb[IFA_LOCAL] &&
nla_memcmp(tb[IFA_LOCAL], &ifa->ifa_local, 2))
Expand Down
3 changes: 2 additions & 1 deletion net/ieee80211/ieee80211_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ static int ieee80211_copy_snap(u8 * data, u16 h_proto)
snap->oui[1] = oui[1];
snap->oui[2] = oui[2];

*(u16 *) (data + SNAP_SIZE) = htons(h_proto);
h_proto = htons(h_proto);
memcpy(data + SNAP_SIZE, &h_proto, sizeof(u16));

return SNAP_SIZE + sizeof(u16);
}
Expand Down
Loading

0 comments on commit 8002ced

Please sign in to comment.