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 Thu, Dec 21, 2023 at 8:01 AM Mark Brown <broonie@xxxxxxxxxx> wrote:
> 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.

Can you verify and submit a patch for that?  I'm asking because my
build/toolchain configuration never produced these warnings/errors
during my testing.

-- 
paul-moore.com





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

  Powered by Linux