[apparmor] [PATCH] apparmor: use zstd compression for profile data
Jon Tourville
jon.tourville at canonical.com
Mon Jun 6 11:56:07 UTC 2022
zstd_compress_bound returns the worst case scenario so that the buffer will
be guaranteed to be large enough. I will look into reallocating the buffer
since the worst case could very well be larger than the original size.
Thanks,
Jon
On Fri, Jun 3, 2022 at 4:59 PM Georgia Garcia <georgia.garcia at canonical.com>
wrote:
> On Thu, 2022-05-12 at 12:35 -0500, Jon Tourville wrote:
> > + out_len = zstd_compress_cctx(ctx, out, out_len, src, slen,
> ¶ms);
> > + if (zstd_is_error(out_len)) {
> > + ret = -EINVAL;
> > + goto cleanup;
> > }
> >
> > - *dst = dstbuf;
> > - *dlen = strm.total_out;
> > + *dst = out;
> > + *dlen = out_len;
>
> Hi Jon,
>
> Should the dst/out buffer be realloced to match the out_len returned by
> zstd_compress_cctx? Or is the estimation made by zstd_compress_bound
> accurate?
>
> Regards,
> Georgia
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20220606/c769007a/attachment.html>
More information about the AppArmor
mailing list