mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: mchehab@kernel.org, max.kellermann@gmail.com, shuah@kernel.org,
	yamada.masahiro@socionext.com, sakari.ailus@linux.intel.com,
	colin.king@canonical.com, andreyknvl@google.com,
	dvyukov@google.com, kcc@google.com
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	syzkaller@googlegroups.com
Subject: [RFT] media: dvb_frontend: Fix use-after-free in __dvb_frontend_free
Date: Tue, 24 Oct 2017 17:06:48 +0530	[thread overview]
Message-ID: <0ade6e417fbf2cd119aa1f2345f88a3810c03e11.1508844352.git.arvind.yadav.cs@gmail.com> (raw)

Here, dvb_free_device will free dvb_device. dvb_frontend_invoke_release
is using  dvb_device after free.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
This bug report by Andrey Konovalov (usb/media/dtt200u: use-after-free
in __dvb_frontend_free).

 drivers/media/dvb-core/dvb_frontend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 2fcba16..7f1ef12 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -147,10 +147,10 @@ static void dvb_frontend_free(struct kref *ref)
 		container_of(ref, struct dvb_frontend, refcount);
 	struct dvb_frontend_private *fepriv = fe->frontend_priv;
 
-	dvb_free_device(fepriv->dvbdev);
-
 	dvb_frontend_invoke_release(fe, fe->ops.release);
 
+	dvb_free_device(fepriv->dvbdev);
+
 	kfree(fepriv);
 }
 
-- 
1.9.1

             reply	other threads:[~2017-10-24 11:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 11:36 Arvind Yadav [this message]
2017-10-24 11:42 ` Andrey Konovalov

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=0ade6e417fbf2cd119aa1f2345f88a3810c03e11.1508844352.git.arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=andreyknvl@google.com \
    --cc=colin.king@canonical.com \
    --cc=dvyukov@google.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=max.kellermann@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shuah@kernel.org \
    --cc=syzkaller@googlegroups.com \
    --cc=yamada.masahiro@socionext.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

all inboxes | Powered by JetHome®