netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Qiujun Huang <hqjagain@gmail.com>,
	syzbot+4496e82090657320efc6@syzkaller.appspotmail.com,
	Hillf Danton <hdanton@sina.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Sasha Levin <sashal@kernel.org>,
	linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 066/108] Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
Date: Sat, 11 Apr 2020 19:09:01 -0400	[thread overview]
Message-ID: <20200411230943.24951-66-sashal@kernel.org> (raw)
In-Reply-To: <20200411230943.24951-1-sashal@kernel.org>

From: Qiujun Huang <hqjagain@gmail.com>

[ Upstream commit 71811cac8532b2387b3414f7cd8fe9e497482864 ]

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 <hqjagain@gmail.com>
Suggested-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/bluetooth/rfcomm/tty.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 0c7d31c6c18cc..a58584949a955 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -413,10 +413,8 @@ static int __rfcomm_create_dev(struct sock *sk, void __user *arg)
 		dlc = rfcomm_dlc_exists(&req.src, &req.dst, req.channel);
 		if (IS_ERR(dlc))
 			return PTR_ERR(dlc);
-		else if (dlc) {
-			rfcomm_dlc_put(dlc);
+		if (dlc)
 			return -EBUSY;
-		}
 		dlc = rfcomm_dlc_alloc(GFP_KERNEL);
 		if (!dlc)
 			return -ENOMEM;
-- 
2.20.1


  parent reply	other threads:[~2020-04-11 23:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11 23:07 [PATCH AUTOSEL 5.4 001/108] net: wan: wanxl: use allow to pass CROSS_COMPILE_M68k for rebuilding firmware Sasha Levin
2020-04-11 23:07 ` [PATCH AUTOSEL 5.4 002/108] netfilter: ctnetlink: be more strict when NF_CONNTRACK_MARK is not set Sasha Levin
2020-04-11 23:07 ` [PATCH AUTOSEL 5.4 003/108] net: axienet: Convert DMA error handler to a work queue Sasha Levin
2020-04-11 23:07 ` [PATCH AUTOSEL 5.4 004/108] net: phy: probe PHY drivers synchronously Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 009/108] ionic: check for NULL structs on teardown Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 010/108] net: phy: mscc: accept all RGMII species in vsc85xx_mac_if_set Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 015/108] selftests/bpf: Fix test_progs's parsing of test numbers Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 016/108] libbpf: Ignore incompatible types with matching name during CO-RE relocation Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 019/108] ath10k: use kzalloc to read for ath10k_sdio_hif_diag_read Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 020/108] mwifiex: set needed_headroom, not hard_header_len Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 021/108] Bluetooth: L2CAP: handle l2cap config request during open state Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 023/108] ath10k: fix not registering airtime of 11a station with WMM disable Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 025/108] net/mlx5e: Init ethtool steering for representors Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 027/108] Bluetooth: Fix calculation of SCO handle for packet processing Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 028/108] net: rmnet: add missing module alias Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 031/108] Bluetooth: guard against controllers sending zero'd events Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 034/108] net: hns3: modify an unsuitable print when setting unknown duplex to fibre Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 036/108] net: intel: e1000e: fix possible sleep-in-atomic-context bugs in e1000e_get_hw_semaphore() Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 037/108] net: dsa: bcm_sf2: Also configure Port 5 for 2Gb/sec on 7278 Sasha Levin
2020-04-12  1:16   ` Florian Fainelli
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 038/108] sh_eth: check sh_eth_cpu_data::no_tx_cntrs when dumping registers Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 039/108] sh_eth: check sh_eth_cpu_data::cexcr " Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 040/108] sh_eth: check sh_eth_cpu_data::no_xdfar " Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 041/108] ice: Fix implicit queue mapping mode in ice_vsi_get_qs Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 043/108] mt76: fix handling full tx queues in mt76_dma_tx_queue_skb_raw Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 047/108] rtw88: 8822c: update power sequence to v16 Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 057/108] rsi: fix null pointer dereference during rsi_shutdown() Sasha Levin
2020-04-11 23:08 ` [PATCH AUTOSEL 5.4 060/108] mt76: mt7603: fix input validation issues for powersave-filtered frames Sasha Levin
2020-04-11 23:09 ` Sasha Levin [this message]
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 068/108] ath10k: start recovery process when read int status fail for sdio Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 076/108] net: axienet: Propagate failure of DMA descriptor setup Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 077/108] brcmfmac: Fix driver crash on USB control transfer timeout Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 078/108] brcmfmac: Fix double freeing in the fmac usb data path Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 079/108] brcmfmac: fix the incorrect return value in brcmf_inform_single_bss() Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 080/108] xfrm: add prep for esp beet mode offload Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 083/108] netfilter: nf_tables: silence a RCU-list warning in nft_table_lookup() Sasha Levin
2020-04-11 23:09 ` [PATCH AUTOSEL 5.4 106/108] svcrdma: Fix leak of transport addresses Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200411230943.24951-66-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=hdanton@sina.com \
    --cc=hqjagain@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+4496e82090657320efc6@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).