Debian Codegraph @

m4/acx_non_paged_memory.m4

raw
1 AC_DEFUN([ACX_NON_PAGED_MEMORY],[
2
3 AC_ARG_ENABLE(non-paged-memory,
4 AC_HELP_STRING([--disable-non-paged-memory],
5 [Disable non-paged memory for secure storage (default enabled)]
6 ),
7 [enable_non_paged_memory="${enableval}"],
8 [enable_non_paged_memory="yes"]
9 )
10
11 AC_MSG_CHECKING(for non-paged memory for secure storage)
12
13 if test "x${enable_non_paged_memory}" = "xyes"; then
14 AC_MSG_RESULT(enabled)
15 AC_DEFINE_UNQUOTED(
16 [SENSITIVE_NON_PAGE],
17 [],
18 [Non-paged memory for secure storage]
19 )
20 AC_CHECK_HEADERS([sys/mman.h])
21
22 AC_MSG_CHECKING(the maximum size that may be locked into memory)
23 MLOCK_SIZE="`ulimit -l`"
24 AC_MSG_RESULT($MLOCK_SIZE)
25
26 if test "x${MLOCK_SIZE}" != "xunlimited"; then
27 AC_MSG_WARN([
28 ======================================================================
29 SoftHSM has been configured to store sensitive data in non-page RAM
30 (i.e. memory that is not swapped out to disk). This is the default and
31 most secure configuration. Your system, however, is not configured to
32 support this model in non-privileged accounts (i.e. user accounts).
33
34 You can check the setting on your system by running the following
35 command in a shell:
36
37 ulimit -l
38
39 If this does not return "unlimited" and you plan to run SoftHSM from
40 non-privileged accounts then you should edit the configuration file
41 /etc/security/limits.conf (on most systems).
42
43 You will need to add the following lines to this file:
44
45 #<domain> <type> <item> <value>
46 * - memlock unlimited
47
48 Alternatively, you can elect to disable this feature of SoftHSM by
49 re-running configure with the option "--disable-non-paged-memory".
50 Please be advised that this may seriously degrade the security of
51 SoftHSM.
52 ======================================================================])
53 fi
54 else
55 AC_MSG_RESULT(disabled)
56 fi
57 ])