aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2014-07-31 14:38:46 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2014-08-08 10:47:23 -0400
commit7926dbfa4bc14e27f4e18a6184a031a1c1e077dc (patch)
tree2a92a55987f95c1cda659732c3792b72bb60e942 /net/bridge
parentb88825de8545ad252c31543fef13cadf4de7a2bc (diff)
netfilter: don't use mutex_lock_interruptible()
Eric Dumazet reports that getsockopt() or setsockopt() sometimes returns -EINTR instead of -ENOPROTOOPT, causing headaches to application developers. This patch replaces all the mutex_lock_interruptible() by mutex_lock() in the netfilter tree, as there is no reason we should sleep for a long time there. Reported-by: Eric Dumazet <edumazet@google.com> Suggested-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Acked-by: Julian Anastasov <ja@ssi.bg>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/netfilter/ebtables.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 1059ed3bc255..6d69631b9f4d 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -327,10 +327,7 @@ find_inlist_lock_noload(struct list_head *head, const char *name, int *error,
327 char name[EBT_FUNCTION_MAXNAMELEN]; 327 char name[EBT_FUNCTION_MAXNAMELEN];
328 } *e; 328 } *e;
329 329
330 *error = mutex_lock_interruptible(mutex); 330 mutex_lock(mutex);
331 if (*error != 0)
332 return NULL;
333
334 list_for_each_entry(e, head, list) { 331 list_for_each_entry(e, head, list) {
335 if (strcmp(e->name, name) == 0) 332 if (strcmp(e->name, name) == 0)
336 return e; 333 return e;
@@ -1203,10 +1200,7 @@ ebt_register_table(struct net *net, const struct ebt_table *input_table)
1203 1200
1204 table->private = newinfo; 1201 table->private = newinfo;
1205 rwlock_init(&table->lock); 1202 rwlock_init(&table->lock);
1206 ret = mutex_lock_interruptible(&ebt_mutex); 1203 mutex_lock(&ebt_mutex);
1207 if (ret != 0)
1208 goto free_chainstack;
1209
1210 list_for_each_entry(t, &net->xt.tables[NFPROTO_BRIDGE], list) { 1204 list_for_each_entry(t, &net->xt.tables[NFPROTO_BRIDGE], list) {
1211 if (strcmp(t->name, table->name) == 0) { 1205 if (strcmp(t->name, table->name) == 0) {
1212 ret = -EEXIST; 1206 ret = -EEXIST;