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: <1366734263.4016.32.camel@bwh-desktop.uk.solarflarecom.com>
Date:	Tue, 23 Apr 2013 17:24:23 +0100
From:	Ben Hutchings <bhutchings@...arflare.com>
To:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
CC:	<davem@...emloft.net>, <netdev@...r.kernel.org>, <kaber@...sh.net>,
	"Eric W. Biederman" <ebiederm@...ssion.com>
Subject: Re: [PATCH net-next] netlink: fix compilation after memory mapped
 patches

On Tue, 2013-04-23 at 10:55 +0200, Nicolas Dichtel wrote:
> Depending of the kernel configuration (CONFIG_UIDGID_STRICT_TYPE_CHECKS), we can
> get the following errors:
> 
> net/netlink/af_netlink.c: In function ‘netlink_queue_mmaped_skb’:
> net/netlink/af_netlink.c:663:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
> net/netlink/af_netlink.c:664:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’
> net/netlink/af_netlink.c: In function ‘netlink_ring_set_copied’:
> net/netlink/af_netlink.c:693:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kuid_t’
> net/netlink/af_netlink.c:694:14: error: incompatible types when assigning to type ‘__u32’ from type ‘kgid_t’
> 
> We must use the helpers to get the uid and gid.
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> ---
>  net/netlink/af_netlink.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
> index 2a3e9ba..0593a9a 100644
> --- a/net/netlink/af_netlink.c
> +++ b/net/netlink/af_netlink.c
> @@ -660,8 +660,8 @@ static void netlink_queue_mmaped_skb(struct sock *sk, struct sk_buff *skb)
>  	hdr->nm_len	= skb->len;
>  	hdr->nm_group	= NETLINK_CB(skb).dst_group;
>  	hdr->nm_pid	= NETLINK_CB(skb).creds.pid;
> -	hdr->nm_uid	= NETLINK_CB(skb).creds.uid;
> -	hdr->nm_gid	= NETLINK_CB(skb).creds.gid;
> +	hdr->nm_uid	= __kuid_val(NETLINK_CB(skb).creds.uid);
> +	hdr->nm_gid	= __kgid_val(NETLINK_CB(skb).creds.gid);

Shouldn't these use from_k{u,g}id_munged() like scm_recv() does?

Ben.

>  	netlink_frame_flush_dcache(hdr);
>  	netlink_set_status(hdr, NL_MMAP_STATUS_VALID);
>  
> @@ -690,8 +690,8 @@ static void netlink_ring_set_copied(struct sock *sk, struct sk_buff *skb)
>  	hdr->nm_len	= skb->len;
>  	hdr->nm_group	= NETLINK_CB(skb).dst_group;
>  	hdr->nm_pid	= NETLINK_CB(skb).creds.pid;
> -	hdr->nm_uid	= NETLINK_CB(skb).creds.uid;
> -	hdr->nm_gid	= NETLINK_CB(skb).creds.gid;
> +	hdr->nm_uid	= __kuid_val(NETLINK_CB(skb).creds.uid);
> +	hdr->nm_gid	= __kgid_val(NETLINK_CB(skb).creds.gid);
>  	netlink_set_status(hdr, NL_MMAP_STATUS_COPY);
>  }
>  

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

--
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