mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
![]() When passing an include directory on the command line to apparmor_parser, valgrind emits a warning: Invalid read of size 4 at 0x404DA6: add_search_dir(char const*) (parser_include.c:152) by 0x40BB37: process_arg(int, char*) (parser_main.c:457) by 0x403D43: main (parser_main.c:590) Address 0x572207c is 28 bytes inside a block of size 29 alloc'd at 0x4C2A420: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x53E31C9: strdup (strdup.c:42) by 0x404D94: add_search_dir(char const*) (parser_include.c:145) by 0x40BB37: process_arg(int, char*) (parser_main.c:457) by 0x403D43: main (parser_main.c:590) This patch quiets the warning by removing strlen() calls on the t char array. Instead, it only calls strlen() on the dir char array. t is a dupe of dir and strlen(dir) does not trigger the valgrind warning. Additionally, this patch adds a bit of defensive programming to the while loop to ensure that index into the t array is never negative. Finally, the valgrind suppression is removed from valgrind_simple.py. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: Steve Beattie <steve@nxnw.org> |
||
---|---|---|
.. | ||
libapparmor_re | ||
po | ||
tst | ||
apparmor-parser.spec.in | ||
apparmor.d.pod | ||
apparmor.pod | ||
apparmor_parser.pod | ||
COPYING.GPL | ||
dbus.c | ||
dbus.h | ||
frob_slack_rc | ||
immunix.h | ||
lib.c | ||
lib.h | ||
Makefile | ||
mount.c | ||
mount.h | ||
parser.conf | ||
parser.h | ||
parser_alias.c | ||
parser_common.c | ||
parser_include.c | ||
parser_include.h | ||
parser_interface.c | ||
parser_lex.l | ||
parser_main.c | ||
parser_merge.c | ||
parser_misc.c | ||
parser_policy.c | ||
parser_regex.c | ||
parser_symtab.c | ||
parser_variable.c | ||
parser_yacc.y | ||
policydb.h | ||
profile.cc | ||
profile.h | ||
rc.aaeventd.redhat | ||
rc.aaeventd.suse | ||
rc.apparmor.debian | ||
rc.apparmor.functions | ||
rc.apparmor.redhat | ||
rc.apparmor.slackware | ||
rc.apparmor.suse | ||
README | ||
README.devel | ||
subdomain.conf | ||
subdomain.conf.pod | ||
techdoc.tex | ||
unit_test.h |
The apparmor_parser allows you to add, replace, and remove AppArmor policy through the use of command line options. The default is to add. `apparmor_parser --help` shows what the command line options are. You can also find more information at http://wiki.apparmor.net Please send all complaints, feature requests, rants about the software, and questions to the apparmor@lists.ubuntu.com mailing list. Bug reports can be filed against the AppArmor project on launchpad.net at https://launchpad.net/apparmor or reported to the mailing list directly for those who wish not to register for an account on launchpad. Security issues can be filed as security bugs on launchpad or directed to security@ubuntu.com. We will attempt to conform to the RFP vulnerability disclosure protocol: http://www.wiretrip.net/rfp/policy.html Thanks. -- The AppArmor development team