<div dir="ltr">Great! Will send a revised patch over the next couple of days.<div><br></div><div>--Saied</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 3, 2016 at 2:10 AM, Adrian Reber <span dir="ltr"><<a href="mailto:adrian@lisas.de" target="_blank">adrian@lisas.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 02, 2016 at 10:33:08AM +0300, Pavel Emelyanov wrote:<br>
> On 03/01/2016 06:48 PM, Saied Kazemi wrote:<br>
> > Thank you both for your feedback. I agree that testing the minimal requirements (category 1) would be a better default action. I was trying to maintain some sort of compatibility with how it worked before. But if that's not an issue, how about the following?<br>
> ><br>
> > 1. criu check  // category 1 only<br>
> > 2. criu check --extra  // category 2 only<br>
> > 3. criu check --experimental  // category 3 only<br>
> > 4. criu check --all  // all categories<br>
> > 5. criu check --feature FEATÂ Â // specific feature<br>
><br>
> As for me, it looks great :) Thanks!<br>
<br>
</span>Exactly what I would expect. Sounds great.<br>
<span class="HOEnZb"><font color="#888888"><br>
        Adrian<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> > On Tue, Mar 1, 2016 at 2:58 AM, Adrian Reber <<a href="mailto:adrian@lisas.de">adrian@lisas.de</a> <mailto:<a href="mailto:adrian@lisas.de">adrian@lisas.de</a>>> wrote:<br>
> ><br>
> >Â Â Â On Tue, Mar 01, 2016 at 12:59:03PM +0300, Pavel Emelyanov wrote:<br>
> >Â Â Â > On 03/01/2016 01:58 AM, Saied Kazemi wrote:<br>
> >Â Â Â > > Pavel and Adrian,<br>
> >Â Â Â > ><br>
> >   > > Had some time this morning and did a quick rework of criu check hopefully without having broken anything. Haven't had time for thorough testing but in the interest of time wanted to send the patch for everyone's comments.<br>
> >Â Â Â > ><br>
> >Â Â Â > > With this patch, "criu check --abs" passes on 3.19 but fails on 3.13 due to PR_SET_MM_MAP.<br>
> >Â Â Â ><br>
> >Â Â Â > I like the patch and have only two suggestions:<br>
> >Â Â Â ><br>
> >Â Â Â > 1. Isn't it better to make 'criu check' w/o any option to check for minimally<br>
> >Â Â Â >Â Â required set of features? And, the --full (or smth like this) to check for<br>
> >Â Â Â >Â Â all the possible functionality.<br>
> ><br>
> >Â Â Â This is also what I would expect. For a new criu user the check command<br>
> >Â Â Â is a good start to see if criu is usable on his platform. Only checking<br>
> >Â Â Â for the minimum which is required to run criu would make sense and if<br>
> >Â Â Â advanced features are needed/desired a more detailed or better check can<br>
> >Â Â Â be run.<br>
> ><br>
> >Â Â Â > 2. The PR_SET_MM_MAP is really optional. The criu/pie/restorer.c has proper<br>
> >Â Â Â >Â Â fall-back in case this API is not supported and there are cases when restore<br>
> >Â Â Â >Â Â w/o this kernel API work. So I suggest to fix the check_prctl to be optional.<br>
> >Â Â Â ><br>
> >Â Â Â > What do you think?<br>
> >Â Â Â ><br>
> >Â Â Â > -- Pavel<br>
> >Â Â Â ><br>
> >Â Â Â > > Look forward to your review and feedback.<br>
> >Â Â Â > ><br>
> >Â Â Â > > --Saied<br>
> >Â Â Â > ><br>
> >Â Â Â > ><br>
> >Â Â Â > > On Mon, Feb 29, 2016 at 2:52 PM, Saied Kazemi <<a href="mailto:saied@google.com">saied@google.com</a> <mailto:<a href="mailto:saied@google.com">saied@google.com</a>> <mailto:<a href="mailto:saied@google.com">saied@google.com</a> <mailto:<a href="mailto:saied@google.com">saied@google.com</a>>>> wrote:<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â The "criu check" command to check if the kernel is properly configured<br>
> >Â Â Â > >Â Â Â to run criu is broken.<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â The "criu check --ms" command used to be the way to tell criu to check<br>
> >   > >   only for features that have been merged upstream. But recent kernels<br>
> >Â Â Â > >Â Â Â have a set of features whose presence doesn't necessarily mean dump will<br>
> >Â Â Â > >Â Â Â fail but rather *may* fail to dump or restore (e.g., soft dirty tracker,<br>
> >Â Â Â > >Â Â Â tun support, seccomp).<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â This patch deprecates --ms and introduces --abs for absolutely needed<br>
> >Â Â Â > >Â Â Â features.<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Typical use cases are:<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â $ sudo criu check --abs<br>
> >Â Â Â > >Â Â Â Â Â Â Â Looks good.<br>
> >Â Â Â > >Â Â Â Â Â Â Â $ sudo criu check<br>
> >Â Â Â > >Â Â Â Â Â Â Â <zero or more errors...><br>
> >Â Â Â > >Â Â Â Â Â Â Â Looks good but some kernel features are missing.<br>
> >Â Â Â > >Â Â Â Â Â Â Â $ sudo criu check --feature mnt_id<br>
> >Â Â Â > >Â Â Â Â Â Â Â Looks good.<br>
> >Â Â Â > >Â Â Â Â Â Â Â $ sudo criu check --feature seccomp_suspend<br>
> >Â Â Â > >Â Â Â Â Â Â Â Error (cr-check.c:604): Kernel doesn't support PTRACE_O_SUSPEND_SECCOMP<br>
> >Â Â Â > >Â Â Â Â Â Â Â $ sudo criu check --feature list<br>
> >Â Â Â > >Â Â Â Â Â Â Â mnt_id aio_remap timerfd tun userns fdinfo_lock seccomp_suspend \<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â seccomp_filters loginuid cgroupns<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Signed-off-by: Saied Kazemi <<a href="mailto:saied@google.com">saied@google.com</a> <mailto:<a href="mailto:saied@google.com">saied@google.com</a>> <mailto:<a href="mailto:saied@google.com">saied@google.com</a> <mailto:<a href="mailto:saied@google.com">saied@google.com</a>>>><br>
> >Â Â Â > >Â Â Â ---<br>
> >   > >   criu/cr-check.c      | 178 +++++++++++++++++++++++-----------------------<br>
> >   > >   criu/cr-service.c     |  4 +-<br>
> >   > >   criu/crtools.c      | 28 ++++++--<br>
> >Â Â Â > >Â Â Â criu/include/cr_options.h |Â Â 2 +-<br>
> >Â Â Â > >Â Â Â 4 files changed, 112 insertions(+), 100 deletions(-)<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â diff --git a/criu/cr-check.c b/criu/cr-check.c<br>
> >Â Â Â > >Â Â Â index a67ee2d..d08e085 100644<br>
> >Â Â Â > >Â Â Â --- a/criu/cr-check.c<br>
> >Â Â Â > >Â Â Â +++ b/criu/cr-check.c<br>
> >Â Â Â > >Â Â Â @@ -171,7 +171,6 @@ static int check_kcmp(void)<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â static int check_prctl(void)<br>
> >Â Â Â > >Â Â Â {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â unsigned long user_auxv = 0;<br>
> >Â Â Â > >Â Â Â Â Â Â Â unsigned int *tid_addr;<br>
> >Â Â Â > >Â Â Â Â Â Â Â unsigned int size = 0;<br>
> >Â Â Â > >Â Â Â Â Â Â Â int ret;<br>
> >Â Â Â > >Â Â Â @@ -183,37 +182,13 @@ static int check_prctl(void)<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â /*<br>
> >Â Â Â > >Â Â Â -Â Â Â Â * Either new or old interface must be supported in the kernel.<br>
> >Â Â Â > >Â Â Â +Â Â Â Â * The new interface must be supported in the kernel.<br>
> >Â Â Â > >Â Â Â Â Â Â Â */<br>
> >Â Â Â > >Â Â Â Â Â Â Â ret = prctl(PR_SET_MM, PR_SET_MM_MAP_SIZE, (unsigned long)&size, 0, 0);<br>
> >Â Â Â > >Â Â Â Â Â Â Â if (ret) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â if (!opts.check_ms_kernel) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("prctl: PR_SET_MM_MAP is not supported, which "<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "is required for restoring user namespaces\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â } else<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_warn("Skipping unssuported PR_SET_MM_MAP\n");<br>
> >Â Â Â > >Â Â Â -<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â ret = prctl(PR_SET_MM, PR_SET_MM_BRK, brk(0), 0, 0);<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â if (ret) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â if (ret == -EPERM)<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("prctl: One needs CAP_SYS_RESOURCE capability to perform testing\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â else<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("prctl: PR_SET_MM is not supported\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â }<br>
> >Â Â Â > >Â Â Â -<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â ret = prctl(PR_SET_MM, PR_SET_MM_EXE_FILE, -1, 0, 0);<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â if (ret != -EBADF) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("prctl: PR_SET_MM_EXE_FILE is not supported (%d)\n", ret);<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â }<br>
> >Â Â Â > >Â Â Â -<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â ret = prctl(PR_SET_MM, PR_SET_MM_AUXV, (long)&user_auxv, sizeof(user_auxv), 0);<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â if (ret) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("prctl: PR_SET_MM_AUXV is not supported\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â }<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â pr_msg("prctl: PR_SET_MM_MAP is not supported, which "<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â "is required for restoring user namespaces\n");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â @@ -766,11 +741,8 @@ static int check_aio_remap(void)<br>
> >Â Â Â > >Â Â Â Â Â Â Â ctx = (aio_context_t)naddr;<br>
> >Â Â Â > >Â Â Â Â Â Â Â r = syscall(SYS_io_getevents, ctx, 0, 1, NULL, NULL);<br>
> >Â Â Â > >Â Â Â Â Â Â Â if (r < 0) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â if (!opts.check_ms_kernel) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_err("AIO remap doesn't work properly\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â } else<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_warn("Skipping unsupported AIO remap\n");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â pr_err("AIO remap doesn't work properly\n");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â @@ -782,12 +754,8 @@ static int check_fdinfo_lock(void)<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â if (!kdat.has_fdinfo_lock) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â if (!opts.check_ms_kernel) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_err("fdinfo doesn't contain the lock field\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â } else {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â pr_warn("fdinfo doesn't contain the lock field\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â }<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â pr_err("fdinfo doesn't contain the lock field\n");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â @@ -823,14 +791,10 @@ static int check_clone_parent_vs_pid()<br>
> >Â Â Â > >Â Â Â static int check_cgroupns(void)<br>
> >Â Â Â > >Â Â Â {<br>
> >Â Â Â > >Â Â Â Â Â Â Â int ret;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â if (opts.check_ms_kernel) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â pr_warn("Skipping cgroup namespaces check\n");<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â ret = access("/proc/self/ns/cgroup", F_OK);<br>
> >Â Â Â > >Â Â Â Â Â Â Â if (ret < 0) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â pr_err("cgroupns not supported. This is not fatal.");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â pr_err("cgroupns not supported. This is not fatal.\n");<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â @@ -839,9 +803,22 @@ static int check_cgroupns(void)<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â static int (*chk_feature)(void);<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â +/*<br>
> >Â Â Â > >Â Â Â + * There are three categories of kernel features:<br>
> >Â Â Â > >Â Â Â + *<br>
> >Â Â Â > >Â Â Â + *Â Â Â 1. Absolutely required (/proc/pid/map_files, ptrace PEEKSIGINFO, etc.)<br>
> >Â Â Â > >Â Â Â + *Â Â Â 2. Required only for specific cases (aio remap, tun, etc.)<br>
> >Â Â Â > >Â Â Â + *Â Â Â 3. Experimental (task-diag)<br>
> >Â Â Â > >Â Â Â + *<br>
> >Â Â Â > >Â Â Â + * We fail if any feature in category 1 is missing but tolerate failures<br>
> >   > >   + * in the other categories. Currently, there is nothing in category 3.<br>
> >Â Â Â > >Â Â Â + */<br>
> >Â Â Â > >Â Â Â +#define GOODÂ Â Â Â Â Â "Looks good."<br>
> >Â Â Â > >Â Â Â +#define GOOD_BUTÂ Â Â Â "Looks good but some kernel features are missing."<br>
> >Â Â Â > >Â Â Â int cr_check(void)<br>
> >Â Â Â > >Â Â Â {<br>
> >Â Â Â > >Â Â Â Â Â Â Â struct ns_id ns = { .type = NS_CRIU, .ns_pid = PROC_SELF, .nd = &mnt_ns_desc };<br>
> >Â Â Â > >Â Â Â +Â Â Â Â int absret = 0;<br>
> >Â Â Â > >Â Â Â Â Â Â Â int ret = 0;<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â if (!is_root_user())<br>
> >Â Â Â > >Â Â Â @@ -863,26 +840,39 @@ int cr_check(void)<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â if (chk_feature) {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â ret = chk_feature();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â if (chk_feature())<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â goto out;<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_map_files();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_sock_diag();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_ns_last_pid();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_sock_peek_off();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_kcmp();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_prctl();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_fcntl();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_proc_stat();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_tcp();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_fdinfo_ext();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_unaligned_vmsplice();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_tty();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_so_gets();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_ipc();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_sigqueuinfo();<br>
> >Â Â Â > >Â Â Â -Â Â Â Â ret |= check_ptrace_peeksiginfo();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â /*<br>
> >Â Â Â > >Â Â Â +Â Â Â Â * Category 1 - absolutely required.<br>
> >Â Â Â > >Â Â Â +Â Â Â Â */<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_map_files();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_sock_diag();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_ns_last_pid();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_sock_peek_off();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_kcmp();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_prctl();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_fcntl();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_proc_stat();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_tcp();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_fdinfo_ext();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_unaligned_vmsplice();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_tty();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_so_gets();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_ipc();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_sigqueuinfo();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â absret |= check_ptrace_peeksiginfo();<br>
> >Â Â Â > >Â Â Â +Â Â Â Â if (absret || opts.check_abs_features) {<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â if (!absret)<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â print_on_level(DEFAULT_LOGLEVEL, "%s\n", GOOD);<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â return absret;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â }<br>
> >Â Â Â > >Â Â Â +<br>
> >Â Â Â > >Â Â Â +Â Â Â Â /*<br>
> >Â Â Â > >Â Â Â +Â Â Â Â * Category 2 - required for specific cases.<br>
> >Â Â Â > >Â Â Â +Â Â Â Â */<br>
> >Â Â Â > >Â Â Â Â Â Â Â ret |= check_ptrace_suspend_seccomp();<br>
> >Â Â Â > >Â Â Â Â Â Â Â ret |= check_ptrace_dump_seccomp_filters();<br>
> >Â Â Â > >Â Â Â Â Â Â Â ret |= check_mem_dirty_track();<br>
> >Â Â Â > >Â Â Â @@ -896,10 +886,8 @@ int cr_check(void)<br>
> >Â Â Â > >Â Â Â Â Â Â Â ret |= check_cgroupns();<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â out:<br>
> >Â Â Â > >Â Â Â -Â Â Â Â if (!ret)<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â print_on_level(DEFAULT_LOGLEVEL, "Looks good.\n");<br>
> >Â Â Â > >Â Â Â -<br>
> >Â Â Â > >Â Â Â -Â Â Â Â return ret;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â print_on_level(DEFAULT_LOGLEVEL, "%s\n", ret ? GOOD_BUT : GOOD);<br>
> >Â Â Â > >Â Â Â +Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â static int check_tun(void)<br>
> >Â Â Â > >Â Â Â @@ -947,32 +935,42 @@ static int check_loginuid(void)<br>
> >Â Â Â > >Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â +struct feature_list {<br>
> >Â Â Â > >Â Â Â +Â Â Â Â char *name;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â int (*func)();<br>
> >Â Â Â > >Â Â Â +};<br>
> >Â Â Â > >Â Â Â +<br>
> >Â Â Â > >Â Â Â +static struct feature_list feature_list[] = {<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "mnt_id", check_mnt_id },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "aio_remap", check_aio_remap },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "timerfd", check_timerfd },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "tun", check_tun },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "userns", check_userns },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "fdinfo_lock", check_fdinfo_lock },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "seccomp_suspend", check_ptrace_suspend_seccomp },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "seccomp_filters", check_ptrace_dump_seccomp_filters },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "loginuid", check_loginuid },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { "cgroupns", check_cgroupns },<br>
> >Â Â Â > >Â Â Â +Â Â Â Â { NULL, NULL },<br>
> >Â Â Â > >Â Â Â +};<br>
> >Â Â Â > >Â Â Â +<br>
> >Â Â Â > >Â Â Â int check_add_feature(char *feat)<br>
> >Â Â Â > >Â Â Â {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â if (!strcmp(feat, "mnt_id"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_mnt_id;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "aio_remap"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_aio_remap;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "timerfd"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_timerfd;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "tun"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_tun;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "userns"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_userns;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "fdinfo_lock"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_fdinfo_lock;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "seccomp_suspend"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_ptrace_suspend_seccomp;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "seccomp_filters"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_ptrace_dump_seccomp_filters;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "loginuid"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_loginuid;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else if (!strcmp(feat, "cgroupns"))<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â chk_feature = check_cgroupns;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â else {<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â pr_err("Unknown feature %s\n", feat);<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â struct feature_list *fl;<br>
> >Â Â Â > >Â Â Â +<br>
> >Â Â Â > >Â Â Â +Â Â Â Â if (!strcmp(feat, "list")) {<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â for (fl = feature_list; fl->name; fl++)<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("%s ", fl->name);<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â pr_msg("\n");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â return 1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â }<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â -Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â for (fl = feature_list; fl->name; fl++) {<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â if (!strcmp(feat, fl->name)) {<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â chk_feature = fl->func;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â }<br>
> >Â Â Â > >Â Â Â +Â Â Â Â }<br>
> >Â Â Â > >Â Â Â +Â Â Â Â pr_err("Unknown feature %s\n", feat);<br>
> >Â Â Â > >Â Â Â +Â Â Â Â return -1;<br>
> >Â Â Â > >Â Â Â }<br>
> >Â Â Â > >Â Â Â diff --git a/criu/cr-service.c b/criu/cr-service.c<br>
> >Â Â Â > >Â Â Â index 88d4af7..a1d843d 100644<br>
> >Â Â Â > >Â Â Â --- a/criu/cr-service.c<br>
> >Â Â Â > >Â Â Â +++ b/criu/cr-service.c<br>
> >Â Â Â > >Â Â Â @@ -567,8 +567,8 @@ static int check(int sk)<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â setproctitle("check --rpc");<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â -Â Â Â Â /* Check only minimal kernel support */<br>
> >Â Â Â > >Â Â Â -Â Â Â Â opts.check_ms_kernel = true;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â /* Check only abolutely needed kernel features */<br>
> >Â Â Â > >Â Â Â +Â Â Â Â opts.check_abs_features = true;<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â if (!cr_check())<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â resp.success = true;<br>
> >Â Â Â > >Â Â Â diff --git a/criu/crtools.c b/criu/crtools.c<br>
> >Â Â Â > >Â Â Â index a8ddb82..2120082 100644<br>
> >Â Â Â > >Â Â Â --- a/criu/crtools.c<br>
> >Â Â Â > >Â Â Â +++ b/criu/crtools.c<br>
> >Â Â Â > >Â Â Â @@ -275,6 +275,7 @@ int main(int argc, char *argv[], char *envp[])<br>
> >   > >           { "timeout",          required_argument,   0, 1072 },<br>
> >   > >           { "external",          required_argument,   0, 1073 },<br>
> >   > >           { "empty-ns",          required_argument,   0, 1074 },<br>
> >   > >   +        { "abs",            no_argument,      0, 1075 },<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â { },<br>
> >Â Â Â > >Â Â Â Â Â Â Â };<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â @@ -455,8 +456,8 @@ int main(int argc, char *argv[], char *envp[])<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opts.force_irmap = true;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â case 1054:<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â opts.check_ms_kernel = true;<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â pr_err("--ms is deprecated, use --abs instead\n");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â return 1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â case 'L':<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â opts.libdir = optarg;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â @@ -490,8 +491,11 @@ int main(int argc, char *argv[], char *envp[])<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â case 1063:<br>
> >Â Â Â > >Â Â Â -Â Â Â Â Â Â Â Â Â Â Â Â if (check_add_feature(optarg) < 0)<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â ret = check_add_feature(optarg);<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â if (ret < 0)Â Â /* invalid kernel feature name */<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 1;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â if (ret > 0)Â Â /* list kernel features and exit */<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â case 1064:<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (!add_skip_mount(optarg))<br>
> >Â Â Â > >Â Â Â @@ -554,6 +558,9 @@ int main(int argc, char *argv[], char *envp[])<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 1;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â case 1075:<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â opts.check_abs_features = true;<br>
> >Â Â Â > >Â Â Â +Â Â Â Â Â Â Â Â Â Â Â Â break;<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â case 'V':<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â pr_msg("Version: %s\n", CRIU_VERSION);<br>
> >Â Â Â > >Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â if (strcmp(CRIU_GITID, "0"))<br>
> >Â Â Â > >Â Â Â @@ -714,7 +721,7 @@ usage:<br>
> >Â Â Â > >Â Â Â "Usage:\n"<br>
> >Â Â Â > >Â Â Â "Â criu dump|pre-dump -t PID [<options>]\n"<br>
> >Â Â Â > >Â Â Â "Â criu restore [<options>]\n"<br>
> >Â Â Â > >Â Â Â -"Â criu check [--ms]\n"<br>
> >Â Â Â > >Â Â Â +"Â criu check [--feature FEAT]\n"<br>
> >Â Â Â > >Â Â Â "Â criu exec -p PID <syscall-string>\n"<br>
> >Â Â Â > >Â Â Â "Â criu page-server\n"<br>
> >Â Â Â > >Â Â Â "Â criu service [<options>]\n"<br>
> >Â Â Â > >Â Â Â @@ -807,8 +814,16 @@ usage:<br>
> >Â Â Â > >Â Â Â "Â Â Â Â Â Â Â Â Â Â Â Â Â Â socket[inode]\n"<br>
> >Â Â Â > >Â Â Â "Â Â Â Â Â Â Â Â Â Â Â Â Â Â file[mnt_id:inode]\n"<br>
> >Â Â Â > >Â Â Â "Â --empty-ns {net}\n"<br>
> >Â Â Â > >Â Â Â -"Â Â Â Â Â Â Â Â Â Â Â Create a namespace, but don't restore its properies.\n"<br>
> >Â Â Â > >Â Â Â -"Â Â Â Â Â Â Â Â Â Â Â An user will retore them from action scripts.\n"<br>
> >Â Â Â > >Â Â Â +"Â Â Â Â Â Â Â Â Â Â Â Â Create a namespace, but don't restore its properies.\n"<br>
> >Â Â Â > >Â Â Â +"Â Â Â Â Â Â Â Â Â Â Â Â An user will retore them from action scripts.\n"<br>
> >Â Â Â > >Â Â Â +"Check options:\n"<br>
> >   > >   +" --abs         check availability of absolutely needed kernel features\n"<br>
> >   > >   +" --ms         deprecated, use --abs (don't check not yet merged kernel features)\n"<br>
> >Â Â Â > >Â Â Â +"Â --feature FEATÂ Â Â Â check availability of one of the following kernel features\n"<br>
> >Â Â Â > >Â Â Â +"Â Â Â Â Â Â Â Â Â Â Â Â "<br>
> >Â Â Â > >Â Â Â +Â Â Â Â );<br>
> >Â Â Â > >Â Â Â +Â Â Â Â check_add_feature("list");<br>
> >Â Â Â > >Â Â Â +Â Â Â Â pr_msg(<br>
> >Â Â Â > >Â Â Â "\n"<br>
> >Â Â Â > >Â Â Â "* Logging:\n"<br>
> >Â Â Â > >Â Â Â "Â -o|--log-file FILEÂ Â log file name\n"<br>
> >Â Â Â > >Â Â Â @@ -836,7 +851,6 @@ usage:<br>
> >Â Â Â > >Â Â Â "Other options:\n"<br>
> >   > >   " -h|--help       show this text\n"<br>
> >   > >   " -V|--version     show version\n"<br>
> >   > >   -"   --ms        don't check not yet merged kernel features\n"<br>
> >Â Â Â > >Â Â Â Â Â Â Â );<br>
> >Â Â Â > ><br>
> >Â Â Â > >Â Â Â Â Â Â Â return 0;<br>
> >Â Â Â > >Â Â Â diff --git a/criu/include/cr_options.h b/criu/include/cr_options.h<br>
> >Â Â Â > >Â Â Â index a6f0b3e..ba2633a 100644<br>
> >Â Â Â > >Â Â Â --- a/criu/include/cr_options.h<br>
> >Â Â Â > >Â Â Â +++ b/criu/include/cr_options.h<br>
> >Â Â Â > >Â Â Â @@ -56,7 +56,7 @@ struct cr_options {<br>
> >   > >       int           final_state;<br>
> >   > >       char          *show_dump_file;<br>
> >   > >       char          *show_fmt;<br>
> >   > >   -    bool          check_ms_kernel;<br>
> >   > >   +    bool          check_abs_features;<br>
> >   > >       bool          show_pages_content;<br>
> >Â Â Â > >Â Â Â Â Â Â Â union {<br>
> >   > >           bool      restore_detach;<br>
> >Â Â Â > >Â Â Â --<br>
> >Â Â Â > >Â Â Â 2.7.0.rc3.207.g0ac5344<br>
> >Â Â Â > ><br>
> >Â Â Â > ><br>
</div></div></blockquote></div><br></div>