lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100318090037.69bcd073@nehalam>
Date:	Thu, 18 Mar 2010 09:00:37 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	James Chapman <jchapman@...alix.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 08/12] netlink: Export genl_lock() API for use by
 modules

On Thu, 18 Mar 2010 10:22:10 +0000
James Chapman <jchapman@...alix.com> wrote:

> This lets kernel modules which use genl netlink APIs serialize netlink
> processing.
> 
> Signed-off-by: James Chapman <jchapman@...alix.com>
> ---
>  include/linux/genetlink.h |    8 ++++++++
>  net/netlink/genetlink.c   |    6 ++++--
>  2 files changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
> index b834ef6..61549b2 100644
> --- a/include/linux/genetlink.h
> +++ b/include/linux/genetlink.h
> @@ -80,4 +80,12 @@ enum {
>  
>  #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
>  
> +#ifdef __KERNEL__
> +
> +/* All generic netlink requests are serialized by a global lock.  */
> +extern void genl_lock(void);
> +extern void genl_unlock(void);
> +
> +#endif /* __KERNEL__ */
> +
>  #endif	/* __LINUX_GENERIC_NETLINK_H */
> diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
> index a4b6e14..a28fda7 100644
> --- a/net/netlink/genetlink.c
> +++ b/net/netlink/genetlink.c
> @@ -20,15 +20,17 @@
>  
>  static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
>  
> -static inline void genl_lock(void)
> +void genl_lock(void)
>  {
>  	mutex_lock(&genl_mutex);
>  }
> +EXPORT_SYMBOL(genl_lock);
>  
> -static inline void genl_unlock(void)
> +void genl_unlock(void)
>  {
>  	mutex_unlock(&genl_mutex);
>  }
> +EXPORT_SYMBOL(genl_unlock);

EXPORT_SYMBOL_GPL() for this?


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ