[libvirt] [PATCH 2/2] security: SELinux: fix the transaction model's list append
Erik Skultety
eskultet at redhat.com
Tue Jan 17 14:54:25 UTC 2017
> > @@ -111,21 +111,31 @@ virSecuritySELinuxContextListAppend(virSecuritySELinuxContextListPtr list,
> > const char *tcon,
> > bool optional)
> > {
> > - virSecuritySELinuxContextItemPtr item;
> > + int ret = -1;
> > + char *tmp = NULL;
> > + virSecuritySELinuxContextItemPtr item = NULL;
> >
> > if (VIR_ALLOC(item) < 0)
> > return -1;
> >
> > - item->path = path;
> > + if (VIR_STRDUP(tmp, path) < 0)
> > + goto cleanup;
> > +
> > + item->path = tmp;
> > item->tcon = tcon;
>
> Unfortunately, while this was enough in the DAC driver, it is not enough
> here. @tcon may be dynamically allocated just for this call:
>
> virSecuritySELinuxRestoreFileLabel ->
> virSecuritySELinuxSetFilecon ->
> virSecuritySELinuxSetFileconHelper ->
> virSecuritySELinuxTransactionAppend ->
> virSecuritySELinuxContextListAppend
>
> However, I guess fixing that is trivial. ACK if you do so and safe for
> the freeze.
Adjusted both patches according to your suggestions and pushed, thanks.
Erik
>
> Michal
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
More information about the libvir-list
mailing list