All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4] syscalls/prctl02: add more error tests
Date: Tue, 12 Nov 2019 11:15:12 +0100	[thread overview]
Message-ID: <20191112101512.GB9373@rei.lan> (raw)
In-Reply-To: <ac6040e3-d561-cd53-e538-e3e6c8953ecc@cn.fujitsu.com>

Hi!
> > 1) Can undefined error be triggered on old kernel if you use ifdef?  It seems unnecessary for ifdef method to include lapi header.
> 
> Yes. It can be triggered and it should use #if HAVE_DECL_PR_GET_SPECULATION_CTRL instead of #ifdef.
> Yes. And we should add more check( such as PR_SET_SECCOMP undefined 2.6.18-398.el5) in m4/ltp-prctl.m4 so that we cannot include lapi header.
> 
> > 2) Undfined option in glibc doesn't mean that kernel doesn't support it as well.
> 
> options definitions is in linux/prctl.h. For most distributions, I think if it is in supported in kernel-header, it should also been
> supported on kernel.

That is usually the case, but there are cons that I explained in the
previous email.

> >> IMO, we only test options that kernel supports.
> >> If we test an unsupported option, our case reports EINVAL that will give user a false impression(kernel
> >> supports it, but argument or environment is bad). I think we should check they whether supported before run
> >> (ifdef is a way).
> >>
> >> ps: If we test EPERM error(cap is not in PI or PP) of PR_CAP_AMBIENT on old kernel,  they will report EINVAL.
> >> So, I think ifdef is needed.
> > Why don't we check if the specified option is supported by calling it 
> > with correct args?(i.e. don't mix unsupported option up with wrong args).
> >
> It sounds reasonable.  I will try it in verify_prctl function if you and cyril have strong opposition to #if.

Okay, that will work. Calling it with correct parameters in test setup
is 100% correct way how to find out if kernel implements the
functionality.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2019-11-12 10:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 12:39 [LTP] [PATCH] syscalls/prctl02: add more error tests Yang Xu
2019-10-31  8:59 ` [LTP] [PATCH v2] " Yang Xu
2019-11-01  8:49   ` Petr Vorel
2019-11-01 11:24     ` Yang Xu
2019-11-01 12:59     ` [LTP] [PATCH v3] " Yang Xu
2019-11-07 14:54       ` Cyril Hrubis
2019-11-08 12:12         ` Yang Xu
2019-11-08 13:20           ` Yang Xu
2019-11-08 14:24             ` Cyril Hrubis
2019-11-11  8:59               ` [LTP] [PATCH v4] " Yang Xu
2019-11-11 16:31                 ` Cyril Hrubis
2019-11-12  3:02                   ` Yang Xu
     [not found]                     ` <5DCA5206.3040508@cn.fujitsu.com>
2019-11-12  7:27                       ` Yang Xu
2019-11-12 10:15                         ` Cyril Hrubis [this message]
2019-11-12 10:31                           ` Yang Xu
2019-11-13  5:23                           ` [LTP] [PATCH v5] " Yang Xu
2019-11-13 10:33                             ` Cyril Hrubis
2019-11-12 10:10                     ` [LTP] [PATCH v4] " Cyril Hrubis
2019-11-12 10:25                       ` Yang Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191112101512.GB9373@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.