lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110708072812.GX18655@shale.localdomain>
Date:	Fri, 8 Jul 2011 10:28:12 +0300
From:	Dan Carpenter <error27@...il.com>
To:	"David S. Miller" <davem@...emloft.net>
Cc:	Eric Dumazet <eric.dumazet@...il.com>,
	Changli Gao <xiaosuo@...il.com>,
	Ben Greear <greearb@...delatech.com>,
	Neil Horman <nhorman@...driver.com>,
	"open list:NETWORKING [GENERAL]" <netdev@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: [patch] packet: add an unlock on error in fanout_add()

We need to release the "fanout_mutex" here.

Signed-off-by: Dan Carpenter <error27@...il.com>

diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index aec50a1..3cbe950 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -589,8 +589,10 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 			break;
 		}
 	}
-	if (match && match->defrag != defrag)
-		return -EINVAL;
+	if (match && match->defrag != defrag) {
+		err = -EINVAL;
+		goto out_unlock;
+	}
 	if (!match) {
 		match = kzalloc(sizeof(*match), GFP_KERNEL);
 		if (match) {
@@ -626,6 +628,8 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)
 			}
 		}
 	}
+
+out_unlock:
 	mutex_unlock(&fanout_mutex);
 	return err;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ