mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Paris <eparis@parisplace.org>
To: wzt.wzt@gmail.com
Cc: linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, jmorris@namei.org
Subject: Re: Security: Replace dac_mmap_min_addr to mmap_min_addr in  cap_file_mmap()
Date: Tue, 13 Apr 2010 23:02:02 -0400	[thread overview]
Message-ID: <j2z7e0fb38c1004132002sba54d278xc0337bed6e09dec5@mail.gmail.com> (raw)
In-Reply-To: <20100414024842.GB3718@localhost.localdomain>

NAK NAK NAK

go back and reread the whole purpose for the separation.

-Eric

On Tue, Apr 13, 2010 at 10:48 PM,  <wzt.wzt@gmail.com> wrote:
> cap_file_mmap() comments said "If the process is attempting to map
> memory below mmap_min_addr", if CONFIG_LSM_MMAP_MIN_ADDR is set,
> dac_mmap_min_addr is not equal mmap_min_addr, so replace dac_mmap_min_addr
> to mmap_min_addr seems to be better.
>
> Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
>
> ---
>  include/linux/security.h |    1 +
>  security/commoncap.c     |    2 +-
>  2 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/security.h b/include/linux/security.h
> index 233d20b..61fd9e7 100644
> --- a/include/linux/security.h
> +++ b/include/linux/security.h
> @@ -101,6 +101,7 @@ void reset_security_ops(void);
>  extern unsigned long mmap_min_addr;
>  extern unsigned long dac_mmap_min_addr;
>  #else
> +#define mmap_min_addr          0UL
>  #define dac_mmap_min_addr      0UL
>  #endif
>
> diff --git a/security/commoncap.c b/security/commoncap.c
> index 6166973..878cf89 100644
> --- a/security/commoncap.c
> +++ b/security/commoncap.c
> @@ -942,7 +942,7 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
>  {
>        int ret = 0;
>
> -       if (addr < dac_mmap_min_addr) {
> +       if (addr < mmap_min_addr) {
>                ret = cap_capable(current, current_cred(), CAP_SYS_RAWIO,
>                                  SECURITY_CAP_AUDIT);
>                /* set PF_SUPERPRIV if it turns out we allow the low mmap */
> --
> 1.6.5.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2010-04-14  3:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  2:48 wzt.wzt
2010-04-14  3:02 ` Eric Paris [this message]
2010-04-14  5:50   ` wzt wzt
2010-04-14  7:35     ` Amerigo Wang

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=j2z7e0fb38c1004132002sba54d278xc0337bed6e09dec5@mail.gmail.com \
    --to=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=wzt.wzt@gmail.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

all inboxes | Powered by JetHome®