/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Landlock - Errata information3*4* Copyright © 2025 Microsoft Corporation5*/67#ifndef _SECURITY_LANDLOCK_ERRATA_H8#define _SECURITY_LANDLOCK_ERRATA_H910#include <linux/init.h>1112struct landlock_erratum {13const int abi;14const u8 number;15};1617/* clang-format off */18#define LANDLOCK_ERRATUM(NUMBER) \19{ \20.abi = LANDLOCK_ERRATA_ABI, \21.number = NUMBER, \22},23/* clang-format on */2425/*26* Some fixes may require user space to check if they are applied on the running27* kernel before using a specific feature. For instance, this applies when a28* restriction was previously too restrictive and is now getting relaxed (for29* compatibility or semantic reasons). However, non-visible changes for30* legitimate use (e.g. security fixes) do not require an erratum.31*/32static const struct landlock_erratum landlock_errata_init[] __initconst = {3334/*35* Only Sparse may not implement __has_include. If a compiler does not36* implement __has_include, a warning will be printed at boot time (see37* setup.c).38*/39#ifdef __has_include4041#define LANDLOCK_ERRATA_ABI 142#if __has_include("errata/abi-1.h")43#include "errata/abi-1.h"44#endif45#undef LANDLOCK_ERRATA_ABI4647#define LANDLOCK_ERRATA_ABI 248#if __has_include("errata/abi-2.h")49#include "errata/abi-2.h"50#endif51#undef LANDLOCK_ERRATA_ABI5253#define LANDLOCK_ERRATA_ABI 354#if __has_include("errata/abi-3.h")55#include "errata/abi-3.h"56#endif57#undef LANDLOCK_ERRATA_ABI5859#define LANDLOCK_ERRATA_ABI 460#if __has_include("errata/abi-4.h")61#include "errata/abi-4.h"62#endif63#undef LANDLOCK_ERRATA_ABI6465#define LANDLOCK_ERRATA_ABI 566#if __has_include("errata/abi-5.h")67#include "errata/abi-5.h"68#endif69#undef LANDLOCK_ERRATA_ABI7071#define LANDLOCK_ERRATA_ABI 672#if __has_include("errata/abi-6.h")73#include "errata/abi-6.h"74#endif75#undef LANDLOCK_ERRATA_ABI7677/*78* For each new erratum, we need to include all the ABI files up to the impacted79* ABI to make all potential future intermediate errata easy to backport.80*81* If such change involves more than one ABI addition, then it must be in a82* dedicated commit with the same Fixes tag as used for the actual fix.83*84* Each commit creating a new security/landlock/errata/abi-*.h file must have a85* Depends-on tag to reference the commit that previously added the line to86* include this new file, except if the original Fixes tag is enough.87*88* Each erratum must be documented in its related ABI file, and a dedicated89* commit must update Documentation/userspace-api/landlock.rst to include this90* erratum. This commit will not be backported.91*/9293#endif9495{}96};9798#endif /* _SECURITY_LANDLOCK_ERRATA_H */99100101