[apparmor] [PATCH] Fix: segfault when processing directories
Seth Arnold
seth.arnold at canonical.com
Fri Jan 15 00:55:03 UTC 2016
On Thu, Jan 14, 2016 at 04:46:36PM -0800, John Johansen wrote:
> Patch -r 2952 switched over to using the library kernel interface, and
> added a kernel_interface parameter to the dir_cb struct, that is
> used to process directories.
>
> Unfortunately kernel_interface parameter of the dir_cb struct is not being
> properly initialized resulting in odd failures and sefaults when the parser
> is processing directories.
>
> Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Seth Arnold <seth.arnold at canonical.com>
It might also be nice to add;
memset(&cb_data, 0, sizeof(cb_data));
If you agree, please consider it pre-acked ;)
Thanks
> diff --git a/parser/parser_main.c b/parser/parser_main.c
> index f671876..93ead14 100644
> --- a/parser/parser_main.c
> +++ b/parser/parser_main.c
> @@ -1143,6 +1143,7 @@ int main(int argc, char *argv[])
>
> cb_data.dirname = profilename;
> cb_data.cachedir = cacheloc;
> + cb_data.kernel_interface = kernel_interface;
> cb = binary_input ? binary_dir_cb : profile_dir_cb;
> if ((retval = dirat_for_each(AT_FDCWD, profilename,
> &cb_data, cb))) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20160114/0e1e4b12/attachment.pgp>
More information about the AppArmor
mailing list