VirtualBox

Opened 8 years ago

Closed 8 years ago

#16837 closed defect (invalid)

sf_path_from_dentry: null pointer deference on failed kmalloc allocation

Reported by: ColinIanKing Owned by:
Component: other Version: VirtualBox 5.1.22
Keywords: kmalloc null check failure Cc:
Guest type: Linux Host type: Linux

Description (last modified by Frank Mehnert)

Function sf_path_from_dentry in src/VBox/Additions/linux/sharedfolders/utils.c is allocating a buffer using kmalloc but it does not check if the allocation failed:

        out_bound_len = PATH_MAX;
        out = kmalloc(out_bound_len, GFP_KERNEL);
        name = out;

..and later it is dereferenced leading to a potential NULL pointer dereference crash.

        LogFunc(("result(%d) = %.*s\n", len, len, name));
        *out = 0;

I suggest that the kmalloc failure case needs to be handled correctly.

Change History (1)

comment:1 by Frank Mehnert, 8 years ago

Description: modified (diff)
Resolution: invalid
Status: newclosed

That case is handled here:

    if (name != d_name)
        kfree(name);
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette