netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] bluetooth/rfcomm: fix ODEBUG bug in rfcomm_dev_ioctl
@ 2020-03-08  9:45 Qiujun Huang
  2020-03-08 13:45 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Qiujun Huang @ 2020-03-08  9:45 UTC (permalink / raw)
  To: marcel
  Cc: johan.hedberg, davem, kuba, linux-bluetooth, netdev, linux-kernel,
	hdanton, Qiujun Huang

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>
---
 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 0c7d31c..a585849 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;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] bluetooth/rfcomm: fix ODEBUG bug in rfcomm_dev_ioctl
  2020-03-08  9:45 [PATCH v2] bluetooth/rfcomm: fix ODEBUG bug in rfcomm_dev_ioctl Qiujun Huang
@ 2020-03-08 13:45 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2020-03-08 13:45 UTC (permalink / raw)
  To: Qiujun Huang
  Cc: Johan Hedberg, David S. Miller, Jakub Kicinski, linux-bluetooth,
	netdev, linux-kernel, hdanton

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 <hqjagain@gmail.com>
> Suggested-by: Hillf Danton <hdanton@sina.com>
> ---
> net/bluetooth/rfcomm/tty.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-08 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-08  9:45 [PATCH v2] bluetooth/rfcomm: fix ODEBUG bug in rfcomm_dev_ioctl Qiujun Huang
2020-03-08 13:45 ` Marcel Holtmann

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).