linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: james.l.morris@oracle.com (James Morris)
To: linux-security-module@vger.kernel.org
Subject: [PATCH] security: Export few symbols referred by other modules
Date: Tue, 5 Dec 2017 23:04:35 +1100 (AEDT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1712052259390.14735@localhost> (raw)
In-Reply-To: <1512471537-23865-1-git-send-email-hareeshg@codeaurora.org>

On Tue, 5 Dec 2017, Hareesh Gundu wrote:

> Export mmap_min_addr and security_mmap_addr() to allow
> kernel modules to use them.
> 
> Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>

I'm not sure whether this should be EXPORT_SYMBOL or EXPORT_SYMBOL_GPL, as 
this hook was added in 2009, well after EXPORT_SYMBOL_GPL came into being.

Most of the LSM hooks are marked EXPORT_SYMBOL because they were part of 
an existing interface when EXPORT_SYMBOL_GPL was introduced, IIRC.

What do folks think?




> ---
>  security/min_addr.c | 1 +
>  security/security.c | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/security/min_addr.c b/security/min_addr.c
> index 94d2b0c..4653711 100644
> --- a/security/min_addr.c
> +++ b/security/min_addr.c
> @@ -6,6 +6,7 @@
>  
>  /* amount of vm to protect from userspace access by both DAC and the LSM*/
>  unsigned long mmap_min_addr;
> +EXPORT_SYMBOL(mmap_min_addr);
>  /* amount of vm to protect from userspace using CAP_SYS_RAWIO (DAC) */
>  unsigned long dac_mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR;
>  /* amount of vm to protect from userspace using the LSM = CONFIG_LSM_MMAP_MIN_ADDR */
> diff --git a/security/security.c b/security/security.c
> index 1cd8526..27874a3 100644
> --- a/security/security.c
> +++ b/security/security.c
> @@ -931,6 +931,7 @@ int security_mmap_addr(unsigned long addr)
>  {
>  	return call_int_hook(mmap_addr, 0, addr);
>  }
> +EXPORT_SYMBOL(security_mmap_addr);
>  
>  int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
>  			    unsigned long prot)
> -- 
> 1.9.1
> 

-- 
James Morris
<james.l.morris@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-12-05 12:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 10:58 [PATCH] security: Export few symbols referred by other modules Hareesh Gundu
2017-12-05 12:04 ` James Morris [this message]
2017-12-05 13:21   ` Tetsuo Handa
2017-12-06 15:15     ` Hareesh Gundu
2017-12-06 15:32       ` Greg KH
2017-12-07  0:10         ` James Morris
2017-12-05 13:34   ` Greg KH

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=alpine.LFD.2.20.1712052259390.14735@localhost \
    --to=james.l.morris@oracle.com \
    --cc=linux-security-module@vger.kernel.org \
    /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).