HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)
c
chatr_pa(1)
PA-RISC Systems Only
chatr_pa(1)
+mi Set the modification bit for the file’s text segment(s).
OPTIONS FOR PA-RISC 64-bit ELF chatr (FORMAT 2)
With common options: -s, -B mode,
+k flag, +r flag, +s flag, +z flag.
+c Set the code bit for a specified segment.
+dz Enable or disable lazy swap allocation for dynamically allocated segments (such as the stack
or heap).
+m Set the modification bit for a specified segment.
+p Set the page size for a specified segment.
+sa Specify a segment using an address for a set of attribute modifications.
+sall Use all segments in the file for a set of attribute modifications.
+si Specify a segment using a segment index number for a set of attribute modifications.
chatr and MAGIC Numbers
The term shared applies to the magic number SHARE_MAGIC while the term demand-loaded applies to
the magic number
DEMAND_MAGIC . See magic(4) and the HP-UX Linker and Libraries Online User
Guide for more information.
chatr labels the following type of executables in output.
SHARE_MAGIC : shared executable
DEMAND_MAGIC : demand load executable
EXEC_MAGIC : normal executable
SHMEM_MAGIC :normalSHMEM_MAGIC executable
The linker produces SHARE_MAGIC executables by default.
Using SHMEM_MAGIC
SHMEM_MAGIC is an interim solution until 64-bit addressability is available with a true 64-bit kernel.
SHMEM_MAGIC will not be supported on future HP implementations of 64-bit architectures (beyond PA-
RISC 2.0). Programs that need larger than 1.75 GB of shared memory on those architectures will have to
be recompiled (as 64-bit executables) for those architectures.
Programs that are compiled as 64-bit executables on any 64-bit HP implementation (including PA-RISC 2.0)
cannot be marked as SHMEM_MAGIC nor do they need to be as they will already have access to more than
1.75 GB of shared memory.
The additional 1 GB of shared memory that is available over other types of executables can be availed of
only for system V shared memory and not other forms of shared memory (like memory mapped files).
Restricting Execute Permission on Stacks
A frequent or common method of breaking into systems is by maliciously overflowing buffers on a program’s
stack, such as passing unusually long, carefully chosen command line arguments to a privileged program
that does not expect them. Malicious unprivileged users can use this technique to trick a privileged pro-
gram into starting a superuser shell for them, or to perform similar unauthorized actions.
One simple yet highly effective way to reduce the risk from this type of attack is to remove the execute per-
mission from a program’s stack pages. This improves system security without sacrificing performance and
has no negative effects on the vast majority of legitimate applications. The changes described in this sec-
tion only affect the very small number of programs that try to execute (or are tricked into executing)
instructions located on the program’s stack(s).
If the stack protection feature described in this section is enabled for a program and that program attempts
to execute code from its stack(s), the HP-UX kernel will terminate the program with a SIGKILL signal,
display a message referring to this manual page section, and log an error message to the system message
log (use dmesg to view the error message). The message logged by the kernel is:
WARNING: UID # may have attempted a buffer overflow attack. PID #
(program_name) has been terminated. See the ’+es enable’ option of
chatr(1).
120 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: February 2007