All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: SELinux List <SELinux@tycho.nsa.gov>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Subject: Abort early on merge() errors
Date: Wed, 08 Mar 2006 18:22:45 -0500	[thread overview]
Message-ID: <440F6745.2060309@cornell.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 3241 bytes --]

This patch fixes a harmless bug where errors in sorting and clearing 
obsolete booleans would abort late, and also not print an error message 
as appropriate. The original intention was immediate abort.

======

Passes tests, I wanted to run it through valgrind, but that never seems 
to work anymore - valgrind spirals out of control, and eats 70% of my 
memory whenever I run it. It also still floods the screen with 
strcpy_chk python warnings, and dlopen ones (translation related). One 
of these days I'll investigate what those warnings are all about:

--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18
--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18
--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18
--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18
--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18
--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18
--19922-- DWARF2 CFI reader: unhandled CFI instruction 0:18

==20645== Conditional jump or move depends on uninitialised value(s)
==20645==    at 0x509FFDC: __strcpy_chk (in /lib64/libc-2.4.so)
==20645==    by 0x3883EA8DC5: (within /usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883EAB6F7: (within /usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883EABBAB: (within /usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883EABDB6: PyImport_ImportModuleEx (in 
/usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883E8CA62: (within /usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883E364FF: PyObject_Call (in 
/usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883E8FA00: PyEval_CallObjectWithKeywords (in 
/usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883E91713: PyEval_EvalFrame (in 
/usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883E95DD4: PyEval_EvalCodeEx (in 
/usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883E95E21: PyEval_EvalCode (in 
/usr/lib64/libpython2.4.so.1.0)
==20645==    by 0x3883EAA239: PyImport_ExecCodeModuleEx (in 
/usr/lib64/libpython2.4.so.1.0)

==19922== Conditional jump or move depends on uninitialised value(s)
==19922==    at 0x4009F1B: _dl_relocate_object (in /lib64/ld-2.4.so)
==19922==    by 0x4003782: dl_main (in /lib64/ld-2.4.so)
==19922==    by 0x4012A3A: _dl_sysdep_start (in /lib64/ld-2.4.so)
==19922==    by 0x4001384: _dl_start (in /lib64/ld-2.4.so)
==19922==    by 0x4000A77: (within /lib64/ld-2.4.so)

==19922== Conditional jump or move depends on uninitialised value(s)
==19922==    at 0x400A1A6: _dl_relocate_object (in /lib64/ld-2.4.so)
==19922==    by 0x401078D: dl_open_worker (in /lib64/ld-2.4.so)
==19922==    by 0x400C875: _dl_catch_error (in /lib64/ld-2.4.so)
==19922==    by 0x400FFBB: _dl_open (in /lib64/ld-2.4.so)
==19922==    by 0x4FEB1A9: dlopen_doit (in /lib64/libdl-2.4.so)
==19922==    by 0x400C875: _dl_catch_error (in /lib64/ld-2.4.so)
==19922==    by 0x4FEB71C: _dlerror_run (in /lib64/libdl-2.4.so)
==19922==    by 0x4FEB120: dlopen@@GLIBC_2.2.5 (in /lib64/libdl-2.4.so)
==19922==    by 0x388050D0A7: init_translations (in /lib64/libselinux.so.1)
==19922==    by 0x388050D1B8: init_lib (in /lib64/libselinux.so.1)
==19922==    by 0x38805122F1: (within /lib64/libselinux.so.1)
==19922==    by 0x3880503B22: (within /lib64/libselinux.so.1)


[-- Attachment #2: libsemanage.merge_abort_early.diff --]
[-- Type: text/x-patch, Size: 490 bytes --]

diff -Naurp --exclude-from excludes old/libsemanage/src/policy_components.c new/libsemanage/src/policy_components.c
--- old/libsemanage/src/policy_components.c	2006-02-16 13:49:35.000000000 -0500
+++ new/libsemanage/src/policy_components.c	2006-03-08 17:34:53.000000000 -0500
@@ -194,6 +194,10 @@ int semanage_base_merge_components(
 		for (j = 0; j < nrecords; j++)
 			rtable->free(records[j]);
 		free(records);
+
+		/* Abort on error */
+		if (rc < 0)
+			goto err;
 	}	
 
 	return rc;

                 reply	other threads:[~2006-03-08 23:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=440F6745.2060309@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=SELinux@tycho.nsa.gov \
    --cc=sds@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.