[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201117061816.z446lhcdjkuswtmg@kafai-mbp.dhcp.thefacebook.com>
Date: Mon, 16 Nov 2020 22:18:16 -0800
From: Martin KaFai Lau <kafai@...com>
To: KP Singh <kpsingh@...omium.org>
CC: <linux-kernel@...r.kernel.org>, <bpf@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Florent Revest <revest@...omium.org>,
Brendan Jackman <jackmanb@...omium.org>,
Pauline Middelink <middelin@...gle.com>
Subject: Re: [PATCH bpf-next v3 2/2] bpf: Add tests for bpf_lsm_set_bprm_opts
On Tue, Nov 17, 2020 at 02:13:07AM +0000, KP Singh wrote:
> From: KP Singh <kpsingh@...gle.com>
>
> The test forks a child process, updates the local storage to set/unset
> the securexec bit.
>
> The BPF program in the test attaches to bprm_creds_for_exec which checks
> the local storage of the current task to set the secureexec bit on the
> binary parameters (bprm).
>
> The child then execs a bash command with the environment variable
> TMPDIR set in the envp. The bash command returns a different exit code
> based on its observed value of the TMPDIR variable.
>
> Since TMPDIR is one of the variables that is ignored by the dynamic
> loader when the secureexec bit is set, one should expect the
> child execution to not see this value when the secureexec bit is set.
>
> Signed-off-by: KP Singh <kpsingh@...gle.com>
Acked-by: Martin KaFai Lau <kafai@...com>
Powered by blists - more mailing lists