Ticket #7705 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

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

Reported by: spectre 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


VBox.log Download (78.0 KB) - added by spectre 13 years ago.
VirtualBox log file

Change History

Changed 13 years ago by spectre

VirtualBox log file

comment:1 Changed 13 years ago by frank

  • Summary changed from Memory leak in sf_lookup (vboxsf.ko module) to 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 Changed 12 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use