Skip to contentSkip to conversation

checkpolicy: fix use-after-free

PATCH In review [email protected] 2 participants 2 messages Aug 18, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpolicy: fix use-after-free

The following fixes a use after free bug found by Coverity in module_compiler.c. The dest_id is freed by get_local_type() itself.

I'm doing this one before the libsepol patches because this was the only error found in checkpolicy :)

thanks,
-serge

module_compiler.c renamed from module_compiler.c.orig +0 -1
@@ -288,7 +288,6 @@ type_datum_t *declare_type(unsigned char
                 }
                 if ((dest_typdatum = get_local_type(dest_id, value)) == NULL) {
                         yyerror("Out of memory!");
-			free(dest_id);
                         return NULL;
                 }       
         }

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 6 lines · On Thu, 2005-08-18 at 11:58 -0500, [email protected] wrote:

The following fixes a use after free bug found by Coverity in module_compiler.c. The dest_id is freed by get_local_type() itself.

I'm doing this one before the libsepol patches because this was the only error found in checkpolicy :)

Thanks, merged.

Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.