Opened 14 years ago

Closed 13 years ago

#7705 closed defect (fixed)

Memory leak in sf_lookup (vboxsf.ko module) => Fixed in SVN

Reported by: Eugene Owned by:
Component: guest additions Version: VirtualBox 3.2.10
Keywords: Cc:
Guest type: Linux Host type: Windows


A small memory leak seems to happen in the kernel module from VirtualBox Guest Additions (Linux) responsible for shared folder support (vboxsf.ko).

Consider sf_lookup() function from dirops.c (SVN: trunk/src/VBox/Additions/linux/sharedfolders/dirops.c, revision 33540).

The call to sf_path_from_dentry() allocates memory for 'path' structure and fills it appropriately. But if the call to sf_stat() located just below in sf_lookup() returns -ENOENT, that memory will probably never be freed.

This happens if some process tries to access a non-existent entry in the shared folders: a file that is about to be created or is simply missing, etc.

To make it clearer, here are two (of possibly many) ways of how the problem could be reproduced (assume 'vbshare' is the device for a shared folder and that folder contains neither 'aaa' subfolder nor 'ccc.txt' file).

Variant 1:

# mount -t vboxsf vbshare /mnt/shared
# ls /mnt/shared/aaa
# umount vbshare

8 bytes are leaked.

Variant 2:

# mount -t vboxsf vbshare /mnt/shared
# echo 123 > /mnt/shared/ccc.txt
# umount vbshare

12 bytes are leaked.

Host OS: Windows XP SP3 Pro x86

Guest OS: OpenSuSE Linux 11.3 x86

Attachments (1)

VBox.log (78.0 KB ) - added by Eugene 14 years ago.
VirtualBox log file

Download all attachments as: .zip

Change History (3)

by Eugene, 14 years ago

Attachment: VBox.log added

VirtualBox log file

comment:1 by Frank Mehnert, 14 years ago

Summary: Memory leak in sf_lookup (vboxsf.ko module)Memory leak in sf_lookup (vboxsf.ko module) => Fixed in SVN

Thanks for the report, the fix will be included in the next maintenance release.

comment:2 by Frank Mehnert, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use