Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BCDCC169C4 for ; Wed, 6 Feb 2019 21:05:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6270C218D9 for ; Wed, 6 Feb 2019 21:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbfBFVFl convert rfc822-to-8bit (ORCPT ); Wed, 6 Feb 2019 16:05:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbfBFVFk (ORCPT ); Wed, 6 Feb 2019 16:05:40 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4B70C077535; Wed, 6 Feb 2019 21:05:40 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-121-129.rdu2.redhat.com [10.10.121.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 716BA6248D; Wed, 6 Feb 2019 21:05:39 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20190204163606.236419-1-edumazet@google.com> References: <20190204163606.236419-1-edumazet@google.com> To: Eric Dumazet Cc: dhowells@redhat.com, "David S . Miller" , netdev , Eric Dumazet , syzbot Subject: Re: [PATCH net] rxrpc: bad unlock balance in rxrpc_recvmsg MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6564.1549487138.1@warthog.procyon.org.uk> Content-Transfer-Encoding: 8BIT Date: Wed, 06 Feb 2019 21:05:38 +0000 Message-ID: <6565.1549487138@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 06 Feb 2019 21:05:40 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Eric Dumazet wrote: > When either "goto wait_interrupted;" or "goto wait_error;" > paths are taken, socket lock has already been released. > > This patch fixes following syzbot splat : > > WARNING: bad unlock balance detected! > 5.0.0-rc4+ #59 Not tainted > ------------------------------------- > syz-executor223/8256 is trying to release lock (sk_lock-AF_RXRPC) at: > [] rxrpc_recvmsg+0x6d3/0x3099 net/rxrpc/recvmsg.c:598 > but there are no more locks to release! > > other info that might help us debug this: > 1 lock held by syz-executor223/8256: > #0: 00000000fa9ed0f4 (slock-AF_RXRPC){+...}, at: spin_lock_bh include/linux/spinlock.h:334 [inline] > #0: 00000000fa9ed0f4 (slock-AF_RXRPC){+...}, at: release_sock+0x20/0x1c0 net/core/sock.c:2798 > > stack backtrace: > CPU: 1 PID: 8256 Comm: syz-executor223 Not tainted 5.0.0-rc4+ #59 > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 > Call Trace: > __dump_stack lib/dump_stack.c:77 [inline] > dump_stack+0x172/0x1f0 lib/dump_stack.c:113 > print_unlock_imbalance_bug kernel/locking/lockdep.c:3391 [inline] > print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3368 > __lock_release kernel/locking/lockdep.c:3601 [inline] > lock_release+0x67e/0xa00 kernel/locking/lockdep.c:3860 > sock_release_ownership include/net/sock.h:1471 [inline] > release_sock+0x183/0x1c0 net/core/sock.c:2808 > rxrpc_recvmsg+0x6d3/0x3099 net/rxrpc/recvmsg.c:598 > sock_recvmsg_nosec net/socket.c:794 [inline] > sock_recvmsg net/socket.c:801 [inline] > sock_recvmsg+0xd0/0x110 net/socket.c:797 > __sys_recvfrom+0x1ff/0x350 net/socket.c:1845 > __do_sys_recvfrom net/socket.c:1863 [inline] > __se_sys_recvfrom net/socket.c:1859 [inline] > __x64_sys_recvfrom+0xe1/0x1a0 net/socket.c:1859 > do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 > entry_SYSCALL_64_after_hwframe+0x49/0xbe > RIP: 0033:0x446379 > Code: e8 2c b3 02 00 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 2b 09 fc ff c3 66 2e 0f 1f 84 00 00 00 00 > RSP: 002b:00007fe5da89fd98 EFLAGS: 00000246 ORIG_RAX: 000000000000002d > RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446379 > RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 > RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000 > R10: 0000000000000000 R11: 0000000000000246 R12: 00000000006dbc2c > R13: 0000000000000000 R14: 0000000000000000 R15: 20c49ba5e353f7cf > > Fixes: 248f219cb8bc ("rxrpc: Rewrite the data and ack handling code") > Signed-off-by: Eric Dumazet > Cc: David Howells > Reported-by: syzbot Acked-by: David Howells