Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1310460ybh; Sun, 8 Mar 2020 00:27:30 -0800 (PST) X-Google-Smtp-Source: ADFU+vvqu9IDyjGDSj+c/JeMf9Lev/vxTdtnD9DsjZENSk0ZUIZtZ9m9UgDek4f3gCk5e+Na8OGv X-Received: by 2002:aca:5ad5:: with SMTP id o204mr7637245oib.2.1583656050166; Sun, 08 Mar 2020 00:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583656050; cv=none; d=google.com; s=arc-20160816; b=akP/6kYDbeyK9WNfgUlsNyNZUuDwyuxreUrMbWPyqCt8cx44Ap6wVbepuXWYX2XvVO K1nqQuyVSaRfnps76348huxsezAWHl+k4qD/yaChZjSJyuCc/9fT38RrU+OPgrMM9awo f9jQq/6jJs7o8TMsl3KphtPYEG4fn3TPdJnoufD0rA1OgQSXOXIj+iKm6/SAkIXZWl2k KRYx+1nxnUerxLsx9Duq9mKN5hmOkJ7sTslDriZzAWq7NInU3RR2hT+OvHkpohJMI6Zn sgSqFBX3A/vy78YuD+xNC7uDmUHCJ+xAfP3Ct7mPU8L9Q8giaRaskUehHFNKiXTMUdlA LdDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+Zc4eg+i4Rn0BmSiaMPh/B06AVe20VTWrfl7CK2y5A8=; b=xXP/BGaYPsOZtMJq5FPqNNADs1pXZ79E/kCYxSsA3+qMokxVmB955YfwZBmUErV1Hu jEvzzMP96/8HTEHVG9UQI1JjSolM3DaPWfeiSo+CAQflz/5FhSrNYP59HfuUdMO/vyGz A6F96trLevMPret61KQG1XSRFPGZ7kOfxHNxlRG4hfXmt3g9s7E2BAkZYYSsX6jCNX4x VAxNvKwpV2A/Gz8jbrHRzQXF9+0mno6atnYhMe6908MAGN3NW5wrDqmGEMl/iQzmNTdG To80A2Iv1M990ICMaJDbu+v9ZpcnKu934LRWfx2lHQjApAUGs4hQgKefwHiOuwngD3hZ bZqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SpN/KlXR"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u15si2306068oic.269.2020.03.08.00.27.17; Sun, 08 Mar 2020 00:27:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SpN/KlXR"; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725904AbgCHI1N (ORCPT + 99 others); Sun, 8 Mar 2020 04:27:13 -0400 Received: from mail-il1-f196.google.com ([209.85.166.196]:38329 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725854AbgCHI1N (ORCPT ); Sun, 8 Mar 2020 04:27:13 -0400 Received: by mail-il1-f196.google.com with SMTP id f5so5947278ilq.5; Sun, 08 Mar 2020 00:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Zc4eg+i4Rn0BmSiaMPh/B06AVe20VTWrfl7CK2y5A8=; b=SpN/KlXRW5crN4+r1Wg3L5olTJbIjnHQLCcHU2IxCNFv1rWpDlcZjtVvmFBSQ5+U8c 3ts9vikCy9bXi6vP+Bue/G3iTgX5+ftOE+BXxZ7iVxco8MPIOFifegIRUT0Ym+aFCvqj S7BaaFdxPtolag+rhciw4tF/mcH2VEF2EDaZVSKnNBtTJW3mIoXmqx/xP05xUEv4R7wD zryN5oeuf1Wkiu0BGVzNEXzncT5EqeFOZ9uxgY3OHeHSf6OFQxnzZ1ApUOoh6m7yJp6a NMav87SpkRCnzf/AlwqgO+S/yT7HlTBda9c8UzmwO3j0hNthtTgrbnlTs48FcgldpSYC PDzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+Zc4eg+i4Rn0BmSiaMPh/B06AVe20VTWrfl7CK2y5A8=; b=JyfIOjgcMlcJy4xkwtm3y+jX3CDPQzWFMbDC+ML8zEJQ3Zp8xegepINRSc7dTnEXjW fnWHWxfDwRgRy6QZNvNczNB90c1QmWHnuWKKs/gZSs7t761KT3dSfrpEAzrEvbIBYQnu FOlYjSM0sZLAQEU4pJWFzGR1oMc1rv3e+SuW8XPxGnN5kwsMfziMxpxMmHTJYO5jrTiW kbCo7snUJW7TTkYr+V3qwzkTpigOt2oQG8l3fzlxwzHcYrbMshvbu8HfsPbi4WSXzv+E zAeZOgj71hWXOIGVALOMa3AY/8WhZVn7S6M6gPHFQHS+rYagjN5Gg5RrcbntGwatH/t0 +8IQ== X-Gm-Message-State: ANhLgQ26h6aNRZOI/T1aXFt5gjpmYQ2+2u4+ZGISl2IUZigZ6GynHBHt HXYsR/e8S23yVdPEpytRv4/bylBCYRI5MnnCE98= X-Received: by 2002:a05:6e02:ea8:: with SMTP id u8mr11277713ilj.0.1583656032881; Sun, 08 Mar 2020 00:27:12 -0800 (PST) MIME-Version: 1.0 References: <1583589488-22450-1-git-send-email-hqjagain@gmail.com> <449B4F83-8BCD-413C-823B-C7A5554801FB@holtmann.org> In-Reply-To: <449B4F83-8BCD-413C-823B-C7A5554801FB@holtmann.org> From: Qiujun Huang Date: Sun, 8 Mar 2020 16:27:02 +0800 Message-ID: Subject: Re: [PATCH] bluetooth/rfcomm: fix ODEBUG bug in rfcomm_dev_ioctl To: Marcel Holtmann Cc: Johan Hedberg , "David S. Miller" , Jakub Kicinski , Bluez mailing list , netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Sun, Mar 8, 2020 at 4:18 PM Marcel Holtmann wrote: > > Hi Qiujun, > > > Needn't call 'rfcomm_dlc_put' here, because 'rfcomm_dlc_exists' didn't > > increase dlc->refcnt. > > > > Reported-by: syzbot+4496e82090657320efc6@syzkaller.appspotmail.com > > Signed-off-by: Qiujun Huang > > --- > > net/bluetooth/rfcomm/tty.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c > > index 0c7d31c..ea2a1df0 100644 > > --- a/net/bluetooth/rfcomm/tty.c > > +++ b/net/bluetooth/rfcomm/tty.c > > @@ -414,7 +414,6 @@ static int __rfcomm_create_dev(struct sock *sk, void __user *arg) > > if (IS_ERR(dlc)) > > return PTR_ERR(dlc); > > else if (dlc) { > > - rfcomm_dlc_put(dlc); > > return -EBUSY; > > } > > dlc = rfcomm_dlc_alloc(GFP_KERNEL); > > Please see the proposed change from Hillf. > > It is better to not bother with the else if here since the if statement will already leave the function. I get that. Thanks. > > if (dlc) > return -EBUSY; > > Regards > > Marcel >