FS#23098 - [kernel26] TOMOYO Linux memory leak

Attached to Project: Arch Linux
Opened by Jamie Nguyen (jnguyen) - Wednesday, 02 March 2011, 08:11 GMT
Last edited by Tobias Powalowski (tpowa) - Friday, 25 March 2011, 08:02 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Tobias Powalowski (tpowa)
Thomas Bächler (brain0)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

The following is quoted from here (a post by the TOMOYO Linux lead developer):
http://sourceforge.jp/projects/tomoyo/lists/archive/users-en/2011-March/000259.html

TOMOYO was by error recalculating already calculated pathname when checking
allow_rewrite permission.

As a result, memory will leak whenever a file is opened for writing without
O_APPEND flag. Also, performance will degrade because TOMOYO is calculating
pathname regardless of profile configuration.

Additional info:
* kernel26 >= 2.6.36

Patch for Arch kernel attached.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Friday, 25 March 2011, 08:02 GMT
Reason for closing:  Fixed
Comment by Jamie Nguyen (jnguyen) - Wednesday, 02 March 2011, 08:15 GMT
As stated in the mailing list, a temporary fix for this leak before the kernel is patched is:

Append below entries to /etc/tomoyo/profile.conf and /sys/kernel/security/tomoyo/profile (i.e. disable allow_rewrite permission checking) in order to avoid the leak.

0-CONFIG::file::rewrite={ mode=disabled }
1-CONFIG::file::rewrite={ mode=disabled }
2-CONFIG::file::rewrite={ mode=disabled }
3-CONFIG::file::rewrite={ mode=disabled }

I am not sure when this will be fixed upstream.
Comment by Tomas Mudrunka (harvie) - Friday, 11 March 2011, 15:45 GMT
TOMOYO seem to be even more problematic:  FS#23242 
Comment by Tobias Powalowski (tpowa) - Saturday, 19 March 2011, 08:54 GMT
Fix will be in .38.1 it's already in queue for this.
Comment by Jamie Nguyen (jnguyen) - Wednesday, 23 March 2011, 21:36 GMT
Fixed in 2.6.38.1:

https://lwn.net/Articles/435081/

edit: and also in 2.6.37.5

Loading...