Thread (21 messages) 21 messages, 5 authors, 2023-12-21

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

From: Mark Brown <broonie@kernel.org>
Date: 2023-12-21 13:01:39
Also in: selinux

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.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help