CFT: Fix crashing in security/seahorse port

Coleman Kane cokane at FreeBSD.org
Sat Apr 12 17:11:21 UTC 2008


Hello ports people,

I'm attaching a patch that I've been working on to solve the problem of
the latest GNOME 2.22.x seahorse crashing (seahorse-agent,
seahorse-daemon, etc...) when the user is trying to use the keyring. The
problem arises because gnome-keyring attempts to use mlock() to
lock-down some secure memory for password storage, but this requires
superuser privileges on FreeBSD. Because of this, gnome-keyring returns
a NULL pointer when the alloc returns, but seahorse doesn't check this
value. It proceeds, instead, to attempt to use this pointer.

The patch will correct this behavior by checking the return value of a
small memory allocation to gnome_keyring_memory_try_alloc, during
process initialization. If the result is no a NULL pointer, then it
performs the desired remapping of the g_malloc, g_free, and other
functions so that they may use secure memory. If the return value is
NULL, then the remappings aren't performed and a warning is issued with
g_warning that informs the user that their seahorse system is using
unsecured memory for password storage.

I'd like to have some testers to ensure that it works fine in a more
general case, so send me your reports (and maybe copy gnome@ as well).
Unless it breaks something more, I'll commit it in the next couple days.

--
Coleman Kane

-------------- next part --------------
A non-text attachment was scrubbed...
Name: security_seahorse-no-mlock.patch
Type: text/x-patch
Size: 2620 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20080412/81897ab6/security_seahorse-no-mlock.bin


More information about the freebsd-ports mailing list