Matthias Schwarzott
unread,Oct 23, 2017, 2:57:59 PM10/23/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Andrey Konovalov, Mauro Carvalho Chehab, Max Kellermann, linux...@vger.kernel.org, LKML, Dmitry Vyukov, Kostya Serebryany, syzkaller
It looks like this is caused by commit
ead666000a5fe34bdc82d61838e4df2d416ea15e ("media: dvb_frontend: only use
kref after initialized").
The writing to "fe->frontend_priv" in dvb_frontend.c:156 is a
use-after-free in case the object dvb_frontend *fe is already freed by
the release callback called in line 153.
Only if the demod driver is based on new style i2c_client the memory is
still accessible.
There are two possible solutions:
1. Clear fe->frontend_priv earlier (before line 153).
2. Do not clear fe->frontend_priv
Can you try if the following patch (solution 1) fixes the issue?
Regards
Matthias
diff --git a/drivers/media/dvb-core/dvb_frontend.c
b/drivers/media/dvb-core/dvb_frontend.c
index daaf969719e4..f552acdb7d8c 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -150,10 +150,11 @@ static void __dvb_frontend_free(struct
dvb_frontend *fe)
dvb_free_device(fepriv->dvbdev);
+ fe->frontend_priv = NULL;
+
dvb_frontend_invoke_release(fe, fe->ops.release);
kfree(fepriv);
- fe->frontend_priv = NULL;
}
static void dvb_frontend_free(struct kref *ref)