From: Laurent Vivier <laurent@vivier.eu>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
James Bottomley <James.Bottomley@hansenpartnership.com>,
YunQiang Su <ysu@wavecomp.com>
Subject: Re: [RFC v2] binfmt_misc: pass binfmt_misc flags to the interpreter
Date: Wed, 15 Jan 2020 15:07:05 +0100 [thread overview]
Message-ID: <20e6c345-b984-7b28-4d3f-c8f3799b8579@vivier.eu> (raw)
In-Reply-To: <20200115135527.GG8904@ZenIV.linux.org.uk>
Le 15/01/2020 à 14:55, Al Viro a écrit :
> On Wed, Jan 15, 2020 at 01:19:16PM +0100, Laurent Vivier wrote:
>> Le 07/01/2020 à 15:50, Laurent Vivier a écrit :
>>> Hi,
>>>
>>> this change is simple, easy to read and understand but it is really
>>> needed by user space application interpreter to know the status of the
>>> system configuration.
>>>
>>> Could we have a comment saying if there is a problem or if it is good to
>>> be merged?
>>
>> Anyone?
>
> FWIW, one thing that looks worrying here is that these bits become
> userland ABI after this patch - specific values passed in that thing
> can't be changed. And no a single mention of that in fs/binfmt_misc.c,
> leaving a nasty trap. As far as one can tell, their values are fair game
> for reordering, etc. - not even visible outside of fs/binfmt_misc.c;
> purely internal constants. And the effect of such modifications after
> your patch will not be "everything breaks, patch gets caught by somebody's
> tests" - it will be a quiet breakage for some users.
>
>>>> #define MISC_FMT_OPEN_BINARY (1 << 30)
>>>> #define MISC_FMT_CREDENTIALS (1 << 29)
>>>> #define MISC_FMT_OPEN_FILE (1 << 28)
>>>> +#define MISC_FMT_FLAGS_MASK (MISC_FMT_PRESERVE_ARGV0 | MISC_FMT_OPEN_BINARY | \
>>>> + MISC_FMT_CREDENTIALS | MISC_FMT_OPEN_FILE)
>
> IOW, you are making those parts of userland ABI cast in stone forever.
> Whether this bit assignment does make sense or not, such things really
> should not be hidden.
>
Thank you for your answer.
So I think the patch from YunQiang Su is a better approach than mine,
much cleaner, see:
binfmt_misc: pass info about P flag by AT_FLAGS
https://patchwork.kernel.org/patch/10902935/
It does the same thing as my patch but uses a dedicated value for AT_FLAGS.
Perhaps YunQiang can send a new version (without the kdebug() part)?
Thanks,
Laurent
prev parent reply other threads:[~2020-01-15 14:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-22 15:08 [RFC v2] binfmt_misc: pass binfmt_misc flags to the interpreter Laurent Vivier
2019-12-03 9:40 ` Laurent Vivier
2019-12-16 9:22 ` Laurent Vivier
2019-12-26 14:08 ` [EXTERNAL]Re: " Yunqiang Su
2020-01-07 14:50 ` Laurent Vivier
2020-01-15 12:19 ` Laurent Vivier
2020-01-15 13:55 ` Al Viro
2020-01-15 14:07 ` Laurent Vivier [this message]
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=20e6c345-b984-7b28-4d3f-c8f3799b8579@vivier.eu \
--to=laurent@vivier.eu \
--cc=James.Bottomley@hansenpartnership.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=ysu@wavecomp.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).