All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: John Johansen <john.johansen@canonical.com>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E . Hallyn" <serge@hallyn.com>,
	apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Brendan Higgins <brendanhiggins@google.com>
Subject: Re: [PATCH] apparmor: fix policy_unpack_test on big endian systems
Date: Thu, 8 Aug 2024 11:04:54 -0700	[thread overview]
Message-ID: <202408081104.8805C0BC7@keescook> (raw)
In-Reply-To: <20240808155931.1290349-1-linux@roeck-us.net>

On Thu, Aug 08, 2024 at 08:59:31AM -0700, Guenter Roeck wrote:
> policy_unpack_test fails on big endian systems because data byte order
> is expected to be little endian but is generated in host byte order.
> This results in test failures such as:
> 
>  # policy_unpack_test_unpack_array_with_null_name: EXPECTATION FAILED at security/apparmor/policy_unpack_test.c:150
>     Expected array_size == (u16)16, but
>         array_size == 4096 (0x1000)
>         (u16)16 == 16 (0x10)
>     # policy_unpack_test_unpack_array_with_null_name: pass:0 fail:1 skip:0 total:1
>     not ok 3 policy_unpack_test_unpack_array_with_null_name
>     # policy_unpack_test_unpack_array_with_name: EXPECTATION FAILED at security/apparmor/policy_unpack_test.c:164
>     Expected array_size == (u16)16, but
>         array_size == 4096 (0x1000)
>         (u16)16 == 16 (0x10)
>     # policy_unpack_test_unpack_array_with_name: pass:0 fail:1 skip:0 total:1
> 
> Add the missing endianness conversions when generating test data.
> 
> Fixes: 4d944bcd4e73 ("apparmor: add AppArmor KUnit tests for policy unpack")
> Cc: Brendan Higgins <brendanhiggins@google.com>
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook

  reply	other threads:[~2024-08-08 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 15:59 [PATCH] apparmor: fix policy_unpack_test on big endian systems Guenter Roeck
2024-08-08 18:04 ` Kees Cook [this message]
2024-08-12 16:55 ` John Johansen
2024-08-12 17:07   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202408081104.8805C0BC7@keescook \
    --to=kees@kernel.org \
    --cc=apparmor@lists.ubuntu.com \
    --cc=brendanhiggins@google.com \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.