From: Luis Henriques <luis.henriques@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: Vlad Yasevich <vyasevic@redhat.com>,
Daniel Borkmann <dborkman@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Luis Henriques <luis.henriques@canonical.com>
Subject: [PATCH 3.11 109/138] net: sctp: cache auth_enable per endpoint
Date: Tue, 3 Jun 2014 12:39:15 +0100 [thread overview]
Message-ID: <1401795584-22664-110-git-send-email-luis.henriques@canonical.com> (raw)
In-Reply-To: <1401795584-22664-1-git-send-email-luis.henriques@canonical.com>
3.11.10.11 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Vlad Yasevich <vyasevic@redhat.com>
commit b14878ccb7fac0242db82720b784ab62c467c0dc upstream.
Currently, it is possible to create an SCTP socket, then switch
auth_enable via sysctl setting to 1 and crash the system on connect:
Oops[#1]:
CPU: 0 PID: 0 Comm: swapper Not tainted 3.14.1-mipsgit-20140415 #1
task: ffffffff8056ce80 ti: ffffffff8055c000 task.ti: ffffffff8055c000
[...]
Call Trace:
[<ffffffff8043c4e8>] sctp_auth_asoc_set_default_hmac+0x68/0x80
[<ffffffff8042b300>] sctp_process_init+0x5e0/0x8a4
[<ffffffff8042188c>] sctp_sf_do_5_1B_init+0x234/0x34c
[<ffffffff804228c8>] sctp_do_sm+0xb4/0x1e8
[<ffffffff80425a08>] sctp_endpoint_bh_rcv+0x1c4/0x214
[<ffffffff8043af68>] sctp_rcv+0x588/0x630
[<ffffffff8043e8e8>] sctp6_rcv+0x10/0x24
[<ffffffff803acb50>] ip6_input+0x2c0/0x440
[<ffffffff8030fc00>] __netif_receive_skb_core+0x4a8/0x564
[<ffffffff80310650>] process_backlog+0xb4/0x18c
[<ffffffff80313cbc>] net_rx_action+0x12c/0x210
[<ffffffff80034254>] __do_softirq+0x17c/0x2ac
[<ffffffff800345e0>] irq_exit+0x54/0xb0
[<ffffffff800075a4>] ret_from_irq+0x0/0x4
[<ffffffff800090ec>] rm7k_wait_irqoff+0x24/0x48
[<ffffffff8005e388>] cpu_startup_entry+0xc0/0x148
[<ffffffff805a88b0>] start_kernel+0x37c/0x398
Code: dd0900b8 000330f8 0126302d <dcc60000> 50c0fff1 0047182a a48306a0
03e00008 00000000
---[ end trace b530b0551467f2fd ]---
Kernel panic - not syncing: Fatal exception in interrupt
What happens while auth_enable=0 in that case is, that
ep->auth_hmacs is initialized to NULL in sctp_auth_init_hmacs()
when endpoint is being created.
After that point, if an admin switches over to auth_enable=1,
the machine can crash due to NULL pointer dereference during
reception of an INIT chunk. When we enter sctp_process_init()
via sctp_sf_do_5_1B_init() in order to respond to an INIT chunk,
the INIT verification succeeds and while we walk and process
all INIT params via sctp_process_param() we find that
net->sctp.auth_enable is set, therefore do not fall through,
but invoke sctp_auth_asoc_set_default_hmac() instead, and thus,
dereference what we have set to NULL during endpoint
initialization phase.
The fix is to make auth_enable immutable by caching its value
during endpoint initialization, so that its original value is
being carried along until destruction. The bug seems to originate
from the very first days.
Fix in joint work with Daniel Borkmann.
Reported-by: Joshua Kinard <kumba@gentoo.org>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Joshua Kinard <kumba@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: backported to 3.11: used davem's backport to 3.10 ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
include/net/sctp/structs.h | 4 +++-
net/sctp/auth.c | 17 ++++++---------
net/sctp/endpointola.c | 3 ++-
net/sctp/sm_make_chunk.c | 32 ++++++++++++++-------------
net/sctp/sm_statefuns.c | 6 +++---
net/sctp/socket.c | 54 ++++++++++++++++++++++------------------------
net/sctp/sysctl.c | 38 ++++++++++++++++++++++++++++++--
7 files changed, 93 insertions(+), 61 deletions(-)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e745c92a1532..1992651659a3 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1252,6 +1252,7 @@ struct sctp_endpoint {
/* SCTP-AUTH: endpoint shared keys */
struct list_head endpoint_shared_keys;
__u16 active_key_id;
+ __u8 auth_enable;
};
/* Recover the outter endpoint structure. */
@@ -1280,7 +1281,8 @@ struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *,
int sctp_has_association(struct net *net, const union sctp_addr *laddr,
const union sctp_addr *paddr);
-int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
+int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
+ const struct sctp_association *asoc,
sctp_cid_t, sctp_init_chunk_t *peer_init,
struct sctp_chunk *chunk, struct sctp_chunk **err_chunk);
int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk,
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index ba1dfc3f8def..7a19117254db 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -393,14 +393,13 @@ nomem:
*/
int sctp_auth_asoc_init_active_key(struct sctp_association *asoc, gfp_t gfp)
{
- struct net *net = sock_net(asoc->base.sk);
struct sctp_auth_bytes *secret;
struct sctp_shared_key *ep_key;
/* If we don't support AUTH, or peer is not capable
* we don't need to do anything.
*/
- if (!net->sctp.auth_enable || !asoc->peer.auth_capable)
+ if (!asoc->ep->auth_enable || !asoc->peer.auth_capable)
return 0;
/* If the key_id is non-zero and we couldn't find an
@@ -447,16 +446,16 @@ struct sctp_shared_key *sctp_auth_get_shkey(
*/
int sctp_auth_init_hmacs(struct sctp_endpoint *ep, gfp_t gfp)
{
- struct net *net = sock_net(ep->base.sk);
struct crypto_hash *tfm = NULL;
__u16 id;
- /* if the transforms are already allocted, we are done */
- if (!net->sctp.auth_enable) {
+ /* If AUTH extension is disabled, we are done */
+ if (!ep->auth_enable) {
ep->auth_hmacs = NULL;
return 0;
}
+ /* If the transforms are already allocated, we are done */
if (ep->auth_hmacs)
return 0;
@@ -677,12 +676,10 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param)
/* Check if peer requested that this chunk is authenticated */
int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc)
{
- struct net *net;
if (!asoc)
return 0;
- net = sock_net(asoc->base.sk);
- if (!net->sctp.auth_enable || !asoc->peer.auth_capable)
+ if (!asoc->ep->auth_enable || !asoc->peer.auth_capable)
return 0;
return __sctp_auth_cid(chunk, asoc->peer.peer_chunks);
@@ -691,12 +688,10 @@ int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc)
/* Check if we requested that peer authenticate this chunk. */
int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc)
{
- struct net *net;
if (!asoc)
return 0;
- net = sock_net(asoc->base.sk);
- if (!net->sctp.auth_enable)
+ if (!asoc->ep->auth_enable)
return 0;
return __sctp_auth_cid(chunk,
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 9e3d257de0e0..cceed111dc64 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -75,7 +75,8 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
if (!ep->digest)
return NULL;
- if (net->sctp.auth_enable) {
+ ep->auth_enable = net->sctp.auth_enable;
+ if (ep->auth_enable) {
/* Allocate space for HMACS and CHUNKS authentication
* variables. There are arrays that we encode directly
* into parameters to make the rest of the operations easier.
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index da85571cc4ee..02b265c53cf5 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -198,6 +198,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
gfp_t gfp, int vparam_len)
{
struct net *net = sock_net(asoc->base.sk);
+ struct sctp_endpoint *ep = asoc->ep;
sctp_inithdr_t init;
union sctp_params addrs;
size_t chunksize;
@@ -257,7 +258,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
chunksize += vparam_len;
/* Account for AUTH related parameters */
- if (net->sctp.auth_enable) {
+ if (ep->auth_enable) {
/* Add random parameter length*/
chunksize += sizeof(asoc->c.auth_random);
@@ -342,7 +343,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
}
/* Add SCTP-AUTH chunks to the parameter list */
- if (net->sctp.auth_enable) {
+ if (ep->auth_enable) {
sctp_addto_chunk(retval, sizeof(asoc->c.auth_random),
asoc->c.auth_random);
if (auth_hmacs)
@@ -1990,7 +1991,7 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
/* if the peer reports AUTH, assume that he
* supports AUTH.
*/
- if (net->sctp.auth_enable)
+ if (asoc->ep->auth_enable)
asoc->peer.auth_capable = 1;
break;
case SCTP_CID_ASCONF:
@@ -2082,6 +2083,7 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
* SCTP_IERROR_NO_ERROR - continue with the chunk
*/
static sctp_ierror_t sctp_verify_param(struct net *net,
+ const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
union sctp_params param,
sctp_cid_t cid,
@@ -2132,7 +2134,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
goto fallthrough;
case SCTP_PARAM_RANDOM:
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
goto fallthrough;
/* SCTP-AUTH: Secion 6.1
@@ -2149,7 +2151,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
break;
case SCTP_PARAM_CHUNKS:
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
goto fallthrough;
/* SCTP-AUTH: Section 3.2
@@ -2165,7 +2167,7 @@ static sctp_ierror_t sctp_verify_param(struct net *net,
break;
case SCTP_PARAM_HMAC_ALGO:
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
goto fallthrough;
hmacs = (struct sctp_hmac_algo_param *)param.p;
@@ -2200,10 +2202,9 @@ fallthrough:
}
/* Verify the INIT packet before we process it. */
-int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
- sctp_cid_t cid,
- sctp_init_chunk_t *peer_init,
- struct sctp_chunk *chunk,
+int sctp_verify_init(struct net *net, const struct sctp_endpoint *ep,
+ const struct sctp_association *asoc, sctp_cid_t cid,
+ sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk,
struct sctp_chunk **errp)
{
union sctp_params param;
@@ -2246,8 +2247,8 @@ int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
/* Verify all the variable length parameters */
sctp_walk_params(param, peer_init, init_hdr.params) {
-
- result = sctp_verify_param(net, asoc, param, cid, chunk, errp);
+ result = sctp_verify_param(net, ep, asoc, param, cid,
+ chunk, errp);
switch (result) {
case SCTP_IERROR_ABORT:
case SCTP_IERROR_NOMEM:
@@ -2479,6 +2480,7 @@ static int sctp_process_param(struct sctp_association *asoc,
struct sctp_af *af;
union sctp_addr_param *addr_param;
struct sctp_transport *t;
+ struct sctp_endpoint *ep = asoc->ep;
/* We maintain all INIT parameters in network byte order all the
* time. This allows us to not worry about whether the parameters
@@ -2618,7 +2620,7 @@ do_addr_param:
goto fall_through;
case SCTP_PARAM_RANDOM:
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
goto fall_through;
/* Save peer's random parameter */
@@ -2631,7 +2633,7 @@ do_addr_param:
break;
case SCTP_PARAM_HMAC_ALGO:
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
goto fall_through;
/* Save peer's HMAC list */
@@ -2647,7 +2649,7 @@ do_addr_param:
break;
case SCTP_PARAM_CHUNKS:
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
goto fall_through;
asoc->peer.peer_chunks = kmemdup(param.p,
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 261c73020daf..6db319574ec1 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -364,7 +364,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
/* Verify the INIT chunk before processing it. */
err_chunk = NULL;
- if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type,
+ if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
&err_chunk)) {
/* This chunk contains fatal error. It is to be discarded.
@@ -531,7 +531,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
/* Verify the INIT chunk before processing it. */
err_chunk = NULL;
- if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type,
+ if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
&err_chunk)) {
@@ -1437,7 +1437,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
/* Verify the INIT chunk before processing it. */
err_chunk = NULL;
- if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type,
+ if (!sctp_verify_init(net, ep, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
&err_chunk)) {
/* This chunk contains fatal error. It is to be discarded.
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 085eb1ba8b3e..698449560c03 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -3302,10 +3302,10 @@ static int sctp_setsockopt_auth_chunk(struct sock *sk,
char __user *optval,
unsigned int optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authchunk val;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (optlen != sizeof(struct sctp_authchunk))
@@ -3322,7 +3322,7 @@ static int sctp_setsockopt_auth_chunk(struct sock *sk,
}
/* add this chunk id to the endpoint */
- return sctp_auth_ep_add_chunkid(sctp_sk(sk)->ep, val.sauth_chunk);
+ return sctp_auth_ep_add_chunkid(ep, val.sauth_chunk);
}
/*
@@ -3335,12 +3335,12 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
char __user *optval,
unsigned int optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_hmacalgo *hmacs;
u32 idents;
int err;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (optlen < sizeof(struct sctp_hmacalgo))
@@ -3357,7 +3357,7 @@ static int sctp_setsockopt_hmac_ident(struct sock *sk,
goto out;
}
- err = sctp_auth_ep_set_hmacs(sctp_sk(sk)->ep, hmacs);
+ err = sctp_auth_ep_set_hmacs(ep, hmacs);
out:
kfree(hmacs);
return err;
@@ -3373,12 +3373,12 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
char __user *optval,
unsigned int optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authkey *authkey;
struct sctp_association *asoc;
int ret;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (optlen <= sizeof(struct sctp_authkey))
@@ -3399,7 +3399,7 @@ static int sctp_setsockopt_auth_key(struct sock *sk,
goto out;
}
- ret = sctp_auth_set_key(sctp_sk(sk)->ep, asoc, authkey);
+ ret = sctp_auth_set_key(ep, asoc, authkey);
out:
kzfree(authkey);
return ret;
@@ -3415,11 +3415,11 @@ static int sctp_setsockopt_active_key(struct sock *sk,
char __user *optval,
unsigned int optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authkeyid val;
struct sctp_association *asoc;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (optlen != sizeof(struct sctp_authkeyid))
@@ -3431,8 +3431,7 @@ static int sctp_setsockopt_active_key(struct sock *sk,
if (!asoc && val.scact_assoc_id && sctp_style(sk, UDP))
return -EINVAL;
- return sctp_auth_set_active_key(sctp_sk(sk)->ep, asoc,
- val.scact_keynumber);
+ return sctp_auth_set_active_key(ep, asoc, val.scact_keynumber);
}
/*
@@ -3444,11 +3443,11 @@ static int sctp_setsockopt_del_key(struct sock *sk,
char __user *optval,
unsigned int optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authkeyid val;
struct sctp_association *asoc;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (optlen != sizeof(struct sctp_authkeyid))
@@ -3460,8 +3459,7 @@ static int sctp_setsockopt_del_key(struct sock *sk,
if (!asoc && val.scact_assoc_id && sctp_style(sk, UDP))
return -EINVAL;
- return sctp_auth_del_key_id(sctp_sk(sk)->ep, asoc,
- val.scact_keynumber);
+ return sctp_auth_del_key_id(ep, asoc, val.scact_keynumber);
}
@@ -5359,16 +5357,16 @@ static int sctp_getsockopt_maxburst(struct sock *sk, int len,
static int sctp_getsockopt_hmac_ident(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_hmacalgo __user *p = (void __user *)optval;
struct sctp_hmac_algo_param *hmacs;
__u16 data_len = 0;
u32 num_idents;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
- hmacs = sctp_sk(sk)->ep->auth_hmacs_list;
+ hmacs = ep->auth_hmacs_list;
data_len = ntohs(hmacs->param_hdr.length) - sizeof(sctp_paramhdr_t);
if (len < sizeof(struct sctp_hmacalgo) + data_len)
@@ -5389,11 +5387,11 @@ static int sctp_getsockopt_hmac_ident(struct sock *sk, int len,
static int sctp_getsockopt_active_key(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authkeyid val;
struct sctp_association *asoc;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (len < sizeof(struct sctp_authkeyid))
@@ -5408,7 +5406,7 @@ static int sctp_getsockopt_active_key(struct sock *sk, int len,
if (asoc)
val.scact_keynumber = asoc->active_key_id;
else
- val.scact_keynumber = sctp_sk(sk)->ep->active_key_id;
+ val.scact_keynumber = ep->active_key_id;
len = sizeof(struct sctp_authkeyid);
if (put_user(len, optlen))
@@ -5422,7 +5420,7 @@ static int sctp_getsockopt_active_key(struct sock *sk, int len,
static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authchunks __user *p = (void __user *)optval;
struct sctp_authchunks val;
struct sctp_association *asoc;
@@ -5430,7 +5428,7 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len,
u32 num_chunks = 0;
char __user *to;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (len < sizeof(struct sctp_authchunks))
@@ -5466,7 +5464,7 @@ num:
static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
- struct net *net = sock_net(sk);
+ struct sctp_endpoint *ep = sctp_sk(sk)->ep;
struct sctp_authchunks __user *p = (void __user *)optval;
struct sctp_authchunks val;
struct sctp_association *asoc;
@@ -5474,7 +5472,7 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
u32 num_chunks = 0;
char __user *to;
- if (!net->sctp.auth_enable)
+ if (!ep->auth_enable)
return -EACCES;
if (len < sizeof(struct sctp_authchunks))
@@ -5491,7 +5489,7 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len,
if (asoc)
ch = (struct sctp_chunks_param*)asoc->c.auth_chunks;
else
- ch = sctp_sk(sk)->ep->auth_chunk_list;
+ ch = ep->auth_chunk_list;
if (!ch)
goto num;
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index 9a5c4c9eddaf..e41a43470b84 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -65,8 +65,11 @@ extern int sysctl_sctp_wmem[3];
static int proc_sctp_do_hmac_alg(struct ctl_table *ctl,
int write,
void __user *buffer, size_t *lenp,
-
loff_t *ppos);
+static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
+ void __user *buffer, size_t *lenp,
+ loff_t *ppos);
+
static struct ctl_table sctp_table[] = {
{
.procname = "sctp_mem",
@@ -267,7 +270,7 @@ static struct ctl_table sctp_net_table[] = {
.data = &init_net.sctp.auth_enable,
.maxlen = sizeof(int),
.mode = 0644,
- .proc_handler = proc_dointvec,
+ .proc_handler = proc_sctp_do_auth,
},
{
.procname = "addr_scope_policy",
@@ -348,6 +351,37 @@ static int proc_sctp_do_hmac_alg(struct ctl_table *ctl,
return ret;
}
+static int proc_sctp_do_auth(struct ctl_table *ctl, int write,
+ void __user *buffer, size_t *lenp,
+ loff_t *ppos)
+{
+ struct net *net = current->nsproxy->net_ns;
+ struct ctl_table tbl;
+ int new_value, ret;
+
+ memset(&tbl, 0, sizeof(struct ctl_table));
+ tbl.maxlen = sizeof(unsigned int);
+
+ if (write)
+ tbl.data = &new_value;
+ else
+ tbl.data = &net->sctp.auth_enable;
+
+ ret = proc_dointvec(&tbl, write, buffer, lenp, ppos);
+
+ if (write) {
+ struct sock *sk = net->sctp.ctl_sock;
+
+ net->sctp.auth_enable = new_value;
+ /* Update the value in the control socket */
+ lock_sock(sk);
+ sctp_sk(sk)->ep->auth_enable = new_value;
+ release_sock(sk);
+ }
+
+ return ret;
+}
+
int sctp_sysctl_net_register(struct net *net)
{
struct ctl_table *table;
--
1.9.1
next prev parent reply other threads:[~2014-06-03 11:52 UTC|newest]
Thread overview: 139+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-03 11:37 [3.11.y.z extended stable] Linux 3.11.10.11 stable review Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 001/138] rt2x00: fix beaconing on USB Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 002/138] rtlwifi: rtl8188ee: initialize packet_beacon Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 003/138] Input: synaptics - add min/max quirk for ThinkPad Edge E431 Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 004/138] Input: atkbd - fix keyboard not working on some LG laptops Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 005/138] Bluetooth: Fix triggering BR/EDR L2CAP Connect too early Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 006/138] Bluetooth: Fix redundant encryption request for reauthentication Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 007/138] Bluetooth: Add support for Lite-on [04ca:3007] Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 008/138] drm/i915: Break encoder->crtc link separately in intel_sanitize_crtc() Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 009/138] iio:imu:mpu6050: Fixed segfault in Invensens MPU driver due to null dereference Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 010/138] rtl8192cu: Fix unbalanced irq enable in error path of rtl92cu_hw_init() Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 011/138] usb: gadget: at91-udc: fix irq and iomem resource retrieval Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 012/138] drm/radeon: use pflip irq on R600+ v2 Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 013/138] drm/radeon: check buffer relocation offset Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 014/138] drm/nouveau/acpi: allow non-optimus setups to load vbios from acpi Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 015/138] drm/nouveau: fix another lock unbalance in nouveau_crtc_page_flip Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 016/138] ALSA: usb-audio: work around corrupted TEAC UD-H01 feedback data Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 017/138] USB: OHCI: fix problem with global suspend on ATI controllers Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 018/138] usb: qcserial: add a number of Dell devices Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 019/138] usb: storage: shuttle_usbat: fix discs being detected twice Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 020/138] fsl-usb: do not test for PHY_CLK_VALID bit on controller version 1.6 Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 021/138] tty: serial: 8250_core.c Bug fix for Exar chips Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 022/138] drivers/tty/hvc: don't free hvc_console_setup after init Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 023/138] USB: Nokia 305 should be treated as unusual dev Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 024/138] USB: Nokia 5300 " Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 025/138] HID: usbhid: quirk for Synaptics HD touchscreen Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 026/138] HID: usbhid: quirk for Synaptics Quad " Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 027/138] HID: add NO_INIT_REPORTS quirk for Synaptics Touch Pad V 103S Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 028/138] Input: elantech - fix touchpad initialization on Gigabyte U2442 Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 029/138] posix_acl: handle NULL ACL in posix_acl_equiv_mode Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 030/138] mm/compaction: make isolate_freepages start at pageblock boundary Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 031/138] trace: module: Maintain a valid user count Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 032/138] mtd: nuc900_nand: NULL dereference in nuc900_nand_enable() Luis Henriques
2014-06-03 11:37 ` [PATCH 3.11 033/138] mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 034/138] ACPI / EC: Clear stale EC events on Samsung systems Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 035/138] ACPI / EC: Process rather than discard events in acpi_ec_clear Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 036/138] powerpc/tm: Disable IRQ in tm_recheckpoint Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 037/138] rtlwifi: rtl8192se: Fix regression due to commit 1bf4bbb Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 038/138] drm: cirrus: add power management support Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 039/138] powerpc: Add vr save/restore functions Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 040/138] x86/efi: Correct EFI boot stub use of code32_start Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 041/138] tracepoint: Do not waste memory on mods with no tracepoints Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 042/138] rbd: fix error paths in rbd_img_request_fill() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 043/138] percpu: make pcpu_alloc_chunk() use pcpu_mem_free() instead of kfree() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 044/138] workqueue: fix bugs in wq_update_unbound_numa() failure path Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 045/138] [media] fc2580: fix tuning failure on 32-bit arch Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 046/138] memory: mvebu-devbus: fix the conversion of the bus width Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 047/138] workqueue: make rescuer_thread() empty wq->maydays list before exiting Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 048/138] workqueue: fix a possible race condition between rescuer and pwq-release Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 049/138] PCI: mvebu: fix off-by-one in the computed size of the mbus windows Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 050/138] bus: mvebu-mbus: allow several windows with the same target/attribute Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 051/138] ARM: mvebu: fix NOR bus-width in Armada XP GP Device Tree Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 052/138] ARM: mvebu: fix NOR bus-width in Armada XP DB " Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 053/138] ARM: mvebu: fix NOR bus-width in Armada XP OpenBlocks AX3 " Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 054/138] crypto: caam - add allocation failure handling in SPRINTFCAT macro Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 055/138] [media] media-device: fix infoleak in ioctl media_enum_entities() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 056/138] md: avoid possible spinning md thread at shutdown Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 057/138] NFSd: Move default initialisers from create_client() to alloc_client() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 058/138] NFSd: call rpc_destroy_wait_queue() from free_client() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 059/138] libata: clean up ZPODD when a port is detached Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 060/138] ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 061/138] ACPI / processor: do not mark present at boot but not onlined CPU as onlined Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 062/138] NFSD: Call ->set_acl with a NULL ACL structure if no entries Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 063/138] gpio: mcp23s08: trivial: fixed coding style issues Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 064/138] gpio: mcp23s08: Bug fix of SPI device tree registration Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 065/138] ARM: dts: i.MX53: Fix ipu register space size Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 066/138] mm, thp: close race between mremap() and split_huge_page() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 067/138] powerpc/powernv: Reset root port in firmware Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 068/138] hrtimer: Set expiry time before switch_hrtimer_base() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 069/138] hwmon: (emc1403) fix inverted store_hyst() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 070/138] hwmon: (emc1403) Support full range of known chip revision numbers Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 071/138] iommu/amd: Fix interrupt remapping for aliased devices Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 072/138] ASoC: wm8962: Update register CLASS_D_CONTROL_1 to be non-volatile Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 073/138] [media] V4L2: ov7670: fix a wrong index, potentially Oopsing the kernel from user-space Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 074/138] [media] V4L2: fix VIDIOC_CREATE_BUFS in 64- / 32-bit compatibility mode Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 075/138] x86, mm, hugetlb: Add missing TLB page invalidation for hugetlb_cow() Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 076/138] i2c: s3c2410: resume race fix Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 077/138] i2c: rcar: bail out on zero length transfers Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 078/138] dm crypt: fix cpu hotplug crash by removing per-cpu structure Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 079/138] metag: fix memory barriers Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 080/138] metag: Reduce maximum stack size to 256MB Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 081/138] x86-64, modify_ldt: Make support for 16-bit segments a runtime option Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 082/138] drm/i915: restore backlight precision when converting from ACPI Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 083/138] PCI: shpchp: Check bridge's secondary (not primary) bus speed Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 084/138] Target/iser: Fix wrong connection requests list addition Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 085/138] Target/iser: Fix iscsit_accept_np and rdma_cm racy flow Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 086/138] iscsi-target: Change BUG_ON to REJECT in iscsit_process_nop_out Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 087/138] target: Don't allow setting WC emulation if device doesn't support Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 088/138] mips: dts: Fix missing device_type="memory" property in memory nodes Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 089/138] arm64: fix pud_huge() for 2-level pagetables Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 090/138] libceph: fix corruption when using page_count 0 page in rbd Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 091/138] clk: tegra: Fix wrong value written to PLLE_AUX Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 092/138] ARM: 8012/1: kdump: Avoid overflow when converting pfn to physaddr Luis Henriques
2014-06-03 11:38 ` [PATCH 3.11 093/138] ARM: perf: hook up perf_sample_event_took around pmu irq handling Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 094/138] list: introduce list_next_entry() and list_prev_entry() Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 095/138] net: sctp: wake up all assocs if sndbuf policy is per socket Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 096/138] net: sctp: test if association is dead in sctp_wake_up_waiters Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 097/138] l2tp: take PMTU from tunnel UDP socket Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 098/138] net: core: don't account for udp header size when computing seglen Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 099/138] bonding: Remove debug_fs files when module init fails Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 100/138] bridge: Fix double free and memory leak around br_allowed_ingress Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 101/138] ipv6: Limit mtu to 65575 bytes Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 102/138] gre: don't allow to add the same tunnel twice Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 103/138] net: ipv4: current group_info should be put after using Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 104/138] ipv4: return valid RTA_IIF on ip route get Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 105/138] filter: prevent nla extensions to peek beyond the end of the message Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 106/138] ip6_gre: don't allow to remove the fb_tunnel_dev Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 107/138] vlan: Fix lockdep warning when vlan dev handle notification Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 108/138] tg3: update rx_jumbo_pending ring param only when jumbo frames are enabled Luis Henriques
2014-06-03 11:39 ` Luis Henriques [this message]
2014-06-03 11:39 ` [PATCH 3.11 110/138] net: Fix ns_capable check in sock_diag_put_filterinfo Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 111/138] rtnetlink: Warn when interface's information won't fit in our packet Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 112/138] rtnetlink: Only supply IFLA_VF_PORTS information when RTEXT_FILTER_VF is set Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 113/138] ipv6: fib: fix fib dump restart Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 114/138] bridge: Handle IFLA_ADDRESS correctly when creating bridge device Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 115/138] sctp: reset flowi4_oif parameter on route lookup Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 116/138] Revert "macvlan : fix checksums error when we are in bridge mode" Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 117/138] tcp_cubic: fix the range of delayed_ack Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 118/138] net: ipv4: ip_forward: fix inverted local_df test Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 119/138] net: ipv6: send pkttoobig immediately if orig frag size > mtu Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 120/138] ipv4: fib_semantics: increment fib_info_cnt after fib_info allocation Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 121/138] net: cdc_mbim: handle unaccelerated VLAN tagged frames Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 122/138] macvlan: Don't propagate IFF_ALLMULTI changes on down interfaces Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 123/138] ip6_tunnel: fix potential NULL pointer dereference Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 124/138] ipv4: initialise the itag variable in __mkroute_input Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 125/138] net-gro: reset skb->truesize in napi_reuse_skb() Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 126/138] net: qmi_wwan: add Telit LE920 newer firmware support Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 127/138] net: qmi_wwan: fix Cinterion PLXX product ID Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 128/138] net: qmi_wwan: Olivetti Olicard 200 support Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 129/138] net: qmi_wwan: add ZTE MF667 Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 130/138] net: qmi_wwan: add support for Cinterion PXS8 and PHS8 Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 131/138] net: qmi_wwan: add Sierra Wireless EM7355 Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 132/138] net: qmi_wwan: add Sierra Wireless MC73xx Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 133/138] net: qmi_wwan: add Sierra Wireless MC7305/MC7355 Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 134/138] net: qmi_wwan: add Olivetti Olicard 500 Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 135/138] net: qmi_wwan: add Alcatel L800MA Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 136/138] net: qmi_wwan: add a number of CMOTech devices Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 137/138] net: qmi_wwan: add a number of Dell devices Luis Henriques
2014-06-03 11:39 ` [PATCH 3.11 138/138] netfilter: Fix potential use after free in ip6_route_me_harder() Luis Henriques
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=1401795584-22664-110-git-send-email-luis.henriques@canonical.com \
--to=luis.henriques@canonical.com \
--cc=davem@davemloft.net \
--cc=dborkman@redhat.com \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=vyasevic@redhat.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®