[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160929062510.GB21794@gmail.com>
Date: Thu, 29 Sep 2016 08:25:10 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Jann Horn <jann@...jh.net>
Cc: security@...nel.org, Alexander Viro <viro@...iv.linux.org.uk>,
Paul Moore <paul@...l-moore.com>,
Stephen Smalley <sds@...ho.nsa.gov>,
Eric Paris <eparis@...isplace.org>,
James Morris <james.l.morris@...cle.com>,
"Serge E. Hallyn" <serge@...lyn.com>,
Nick Kralevich <nnk@...gle.com>,
Janis Danisevskis <jdanis@...gle.com>,
linux-security-module@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] mm: add LSM hook for writes to readonly memory
* Jann Horn <jann@...jh.net> wrote:
> +/*
> + * subject_cred must be the subjective credentials using which access is
> + * requested.
> + * object_cred must be the objective credentials of the target task at the time
> + * the mm_struct was acquired.
> + * Both of these may be NULL if FOLL_FORCE is unset or FOLL_WRITE is unset.
Hm, I have trouble parsing the first sentence.
> - return __get_user_pages_locked(current, current->mm, start, nr_pages,
> - write, force, pages, vmas, NULL, false,
> - FOLL_TOUCH);
> + return __get_user_pages_locked(current, current->mm, current_cred(),
> + current_real_cred(), start,
> + nr_pages, write, force, pages, vmas,
> + NULL, false, FOLL_TOUCH);
So the parameter passing was disgustig before, and now it became super disgusing!
Would it improve the code if we added a friendly helper structure (or two if
that's better) to clean up all the interactions within these various functions?
Thanks,
Ingo
Powered by blists - more mailing lists