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  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 29 Apr 2020 11:05:24 +0100
From:   Jules Irenge <>
Cc:     "David S. Miller" <>,
        Alexey Kuznetsov <>,
        Hideaki YOSHIFUJI <>,
        Jakub Kicinski <>, (open list:NETWORKING [IPv4/IPv6])
Subject: [PATCH 2/6] udp: Add missing annotations for busylock_acquire() and busylock_release()

Sparse reports warnings

warning: context imbalance in busylock_acquire() - wrong count at exit
warning: context imbalance in busylock_release() - unexpected unlock

The root cause is the missing annotations at
busylock_acquire() and busylock_release()

The __release(busy) annotation inside busylock_release()
tells Sparse and not GCC to shutdown the warning
in case the condition is not satisfied.

Add the missing __acquires(busy) annotation
Add the missing __releases(busy) annotation
Add the __release(busy) annotation

Signed-off-by: Jules Irenge <>
 net/ipv4/udp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index db76b9609299..5ca12a945ac3 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1430,6 +1430,7 @@ static int udp_busylocks_log __read_mostly;
 static spinlock_t *udp_busylocks __read_mostly;
 static spinlock_t *busylock_acquire(void *ptr)
+	__acquires(busy)
 	spinlock_t *busy;
@@ -1439,9 +1440,13 @@ static spinlock_t *busylock_acquire(void *ptr)
 static void busylock_release(spinlock_t *busy)
+	__releases(busy)
 	if (busy)
+	else
+		/* annotation for sparse */
+		__release(busy);
 int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb)

Powered by blists - more mailing lists