Skip to content

Commit

Permalink
Merge tag 'char-misc-5.5-rc6' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/gregkh/char-misc

Pull char/misc fix from Greg KH:
 "Here is a single fix, for the chrdev core, for 5.5-rc6

  There's been a long-standing race condition triggered by syzbot, and
  occasionally real people, in the chrdev open() path. Will finally took
  the time to track it down and fix it for real before the holidays.

  Here's that one patch, it's been in linux-next for a while with no
  reported issues and it does fix the reported problem"

* tag 'char-misc-5.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  chardev: Avoid potential use-after-free in 'chrdev_open()'
  • Loading branch information
torvalds committed Jan 10, 2020
2 parents 7da37cd + 68faa67 commit 9fb7007
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/char_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static struct kobject *cdev_get(struct cdev *p)

if (owner && !try_module_get(owner))
return NULL;
kobj = kobject_get(&p->kobj);
kobj = kobject_get_unless_zero(&p->kobj);
if (!kobj)
module_put(owner);
return kobj;
Expand Down

0 comments on commit 9fb7007

Please sign in to comment.