[PATCH v8 6/8] elf: Add support to memory sealing

Andrei Vagin avagin@google.com
Thu Feb 6 19:46:39 GMT 2025


On Wed, Jan 29, 2025 at 02:22:40PM -0300, Adhemerval Zanella wrote:
> diff --git a/sysdeps/generic/dl-prop-mseal.h b/sysdeps/generic/dl-prop-mseal.h
> new file mode 100644
> index 0000000000..94ce72b4d2
> --- /dev/null
> +++ b/sysdeps/generic/dl-prop-mseal.h
> @@ -0,0 +1,34 @@
> +/* Support for GNU properties.  Generic version.
> +   Copyright (C) 2025 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#ifndef _DL_PROP_MSEAL_H
> +#define _LD_PROP_MSEAL_H

nit: s/_LD_PROP_MSEAL_H/_DL_PROP_MSEAL_H/

> +
> +static __always_inline bool
> +_dl_process_gnu_property_seal (struct link_map *l, int fd, uint32_t type,
> +			       uint32_t datasz, void *data)
> +{
> +  if (type == GNU_PROPERTY_MEMORY_SEAL && datasz == 0)
> +    {
> +      l->l_seal = lt_seal_toseal;
> +      return true;
> +    }
> +  return false;
> +}
> +
> +#endif


More information about the Libc-alpha mailing list