Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f378b68 authored by Eric Paris's avatar Eric Paris Committed by David S. Miller
Browse files

net: pass kern to net_proto_family create function



The generic __sock_create function has a kern argument which allows the
security system to make decisions based on if a socket is being created by
the kernel or by userspace.  This patch passes that flag to the
net_proto_family specific create function, so it can do the same thing.

Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Acked-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 13f18aa0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -779,7 +779,7 @@ base_sock_create(struct net *net, struct socket *sock, int protocol)
}

static int
mISDN_sock_create(struct net *net, struct socket *sock, int proto)
mISDN_sock_create(struct net *net, struct socket *sock, int proto, int kern)
{
	int err = -EPROTONOSUPPORT;

+2 −1
Original line number Diff line number Diff line
@@ -104,7 +104,8 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)

EXPORT_SYMBOL(pppox_ioctl);

static int pppox_create(struct net *net, struct socket *sock, int protocol)
static int pppox_create(struct net *net, struct socket *sock, int protocol,
			int kern)
{
	int rc = -EPROTOTYPE;

+2 −1
Original line number Diff line number Diff line
@@ -204,7 +204,8 @@ struct proto_ops {

struct net_proto_family {
	int		family;
	int		(*create)(struct net *net, struct socket *sock, int protocol);
	int		(*create)(struct net *net, struct socket *sock,
				  int protocol, int kern);
	struct module	*owner;
};

+2 −1
Original line number Diff line number Diff line
@@ -1021,7 +1021,8 @@ static struct proto ddp_proto = {
 * Create a socket. Initialise the socket, blank the addresses
 * set the state.
 */
static int atalk_create(struct net *net, struct socket *sock, int protocol)
static int atalk_create(struct net *net, struct socket *sock, int protocol,
			int kern)
{
	struct sock *sk;
	int rc = -ESOCKTNOSUPPORT;
+2 −1
Original line number Diff line number Diff line
@@ -127,7 +127,8 @@ static const struct proto_ops pvc_proto_ops = {
};


static int pvc_create(struct net *net, struct socket *sock,int protocol)
static int pvc_create(struct net *net, struct socket *sock, int protocol,
		      int kern)
{
	if (net != &init_net)
		return -EAFNOSUPPORT;
Loading