Re: [RFC PATCH 3/3] lsm: consolidate buffer size handling into lsm_fill_user_ctx()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 20, 2023 at 08:40:24PM -0500, Paul Moore wrote:

> Looking at the lsm_ctx definition in include/uapi/linux/lsm.h I see
> the following:

>   struct lsm_ctx {
>     __u64 id;       /* offset:  0 */
>     __u64 flags;    /* offset:  8 */
>     __u64 len;      /* offset: 16 */
>     __u64 ctx_len;  /* offset: 24 */
>     __u8 ctx[];     /* offset: 32 */
>   };

> and given that the offending line of code is trying to do a memcpy
> into the ctx field, an offset of 32 looks correct to me.

> Suggestions on how to annotate the struct, or the code doing the
> memcpy() are welcome.

You're looking for a __counted_by() annotation here I think.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux