[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180517154139.GB8586@redhat.com>
Date: Thu, 17 May 2018 17:41:39 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Tycho Andersen <tycho@...ho.ws>
Cc: linux-kernel@...r.kernel.org,
containers@...ts.linux-foundation.org,
Kees Cook <keescook@...omium.org>,
Andy Lutomirski <luto@...capital.net>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
"Serge E . Hallyn" <serge@...lyn.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Tyler Hicks <tyhicks@...onical.com>,
Akihiro Suda <suda.akihiro@....ntt.co.jp>,
"Tobin C . Harding" <me@...in.cc>
Subject: Re: [PATCH v2 3/4] seccomp: add a way to get a listener fd from
ptrace
again, I don't understand this code yet, but
On 05/17, Tycho Andersen wrote:
>
> +long seccomp_get_listener(struct task_struct *task,
> + unsigned long filter_off)
> +{
> + struct seccomp_filter *filter;
> + struct file *listener;
> + int fd;
> +
> + filter = get_nth_filter(task, filter_off);
> + if (IS_ERR(filter))
> + return PTR_ERR(filter);
> +
> + fd = get_unused_fd_flags(O_RDWR);
> + if (fd < 0) {
> + __put_seccomp_filter(filter);
> + return fd;
> + }
> +
> + listener = init_listener(task, task->seccomp.filter);
> + if (IS_ERR(listener)) {
> + put_unused_fd(fd);
> + return PTR_ERR(listener);
__put_seccomp_filter() ?
and since init_listener() does __get_seccomp_filter() on sucess, it is needed
uncondtitionally?
Oleg.
Powered by blists - more mailing lists