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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1427749998-28464-9-git-send-email-fabf@skynet.be>
Date:	Mon, 30 Mar 2015 23:13:17 +0200
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel@...r.kernel.org
Cc:	Fabian Frederick <fabf@...net.be>,
	Pablo Neira Ayuso <pablo@...filter.org>,
	Patrick McHardy <kaber@...sh.net>,
	Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
	"David S. Miller" <davem@...emloft.net>,
	netfilter-devel@...r.kernel.org, coreteam@...filter.org,
	netdev@...r.kernel.org
Subject: [PATCH 9/9 net-next] netfilter: replace if/BUG by BUG_ON

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 net/netfilter/nfnetlink_log.c | 3 +--
 net/netfilter/xt_u32.c        | 8 +++-----
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 957b83a..409f5fb 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -577,8 +577,7 @@ __build_packet_message(struct nfnl_log_net *log,
 		nla->nla_type = NFULA_PAYLOAD;
 		nla->nla_len = size;
 
-		if (skb_copy_bits(skb, 0, nla_data(nla), data_len))
-			BUG();
+		BUG_ON(skb_copy_bits(skb, 0, nla_data(nla), data_len));
 	}
 
 	nlh->nlmsg_len = inst->skb->tail - old_tail;
diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c
index a95b5034..5ff937d 100644
--- a/net/netfilter/xt_u32.c
+++ b/net/netfilter/xt_u32.c
@@ -38,8 +38,7 @@ static bool u32_match_it(const struct xt_u32 *data,
 		if (skb->len < 4 || pos > skb->len - 4)
 			return false;
 
-		if (skb_copy_bits(skb, pos, &n, sizeof(n)) < 0)
-			BUG();
+		BUG_ON(skb_copy_bits(skb, pos, &n, sizeof(n)) < 0);
 		val   = ntohl(n);
 		nnums = ct->nnums;
 
@@ -65,9 +64,8 @@ static bool u32_match_it(const struct xt_u32 *data,
 				    pos > skb->len - at - 4)
 					return false;
 
-				if (skb_copy_bits(skb, at + pos, &n,
-						    sizeof(n)) < 0)
-					BUG();
+				BUG_ON(skb_copy_bits(skb, at + pos, &n,
+						     sizeof(n)) < 0);
 				val = ntohl(n);
 				break;
 			}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ