Skip to content

Commit 9fb7007

Browse files
committed
Merge tag 'char-misc-5.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/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()'
2 parents 7da37cd + 68faa67 commit 9fb7007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/char_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static struct kobject *cdev_get(struct cdev *p)
352352

353353
if (owner && !try_module_get(owner))
354354
return NULL;
355-
kobj = kobject_get(&p->kobj);
355+
kobj = kobject_get_unless_zero(&p->kobj);
356356
if (!kobj)
357357
module_put(owner);
358358
return kobj;

0 commit comments

Comments
 (0)