Message ID | 1532536620-3407-2-git-send-email-paolo.pisati@canonical.com |
---|---|
State | New |
Headers | show |
Series | [media] xc2028: avoid use after free | expand |
This fix has been identified that it will introduce another lock issue, please consider to backport these patches along with it: 210bd104c6acd31c3c6b8b075b3f12d4a9f6b60d 22a1e7783e173ab3d86018eb590107d68df46c11
Good catch! It looks like 22a1e7783e173ab3d86018eb590107d68df46c11 is the one that's really needed to fix the use-after-free and it basically undoes the 2 other patches. I'm curious how you were able to know that this fix is introduces problems? On 2018-07-26 10:49:21 , Po-Hsu Lin wrote: > This fix has been identified that it will introduce another lock issue, > > please consider to backport these patches along with it: > 210bd104c6acd31c3c6b8b075b3f12d4a9f6b60d > 22a1e7783e173ab3d86018eb590107d68df46c11 > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team
I cheated here, hehe Kudos goes to Kai-Heng, who rejected my patched before: https://lists.ubuntu.com/archives/kernel-team/2017-June/084918.html And I totally forgot this, sorry for letting this hanging around. On Fri, Jul 27, 2018 at 2:48 PM, Khaled Elmously <khalid.elmously@canonical.com> wrote: > Good catch! It looks like 22a1e7783e173ab3d86018eb590107d68df46c11 is the one that's really needed to fix the use-after-free and it basically undoes the 2 other patches. > > I'm curious how you were able to know that this fix is introduces problems? > > > > On 2018-07-26 10:49:21 , Po-Hsu Lin wrote: >> This fix has been identified that it will introduce another lock issue, >> >> please consider to backport these patches along with it: >> 210bd104c6acd31c3c6b8b075b3f12d4a9f6b60d >> 22a1e7783e173ab3d86018eb590107d68df46c11 >> >> -- >> kernel-team mailing list >> kernel-team@lists.ubuntu.com >> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index 4be5cf8..47af975 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c @@ -1385,11 +1385,12 @@ static int xc2028_set_config(struct dvb_frontend *fe, void *priv_cfg) * in order to avoid troubles during device release. */ kfree(priv->ctrl.fname); + priv->ctrl.fname = NULL; memcpy(&priv->ctrl, p, sizeof(priv->ctrl)); if (p->fname) { priv->ctrl.fname = kstrdup(p->fname, GFP_KERNEL); if (priv->ctrl.fname == NULL) - rc = -ENOMEM; + return -ENOMEM; } /*