All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: netdev@vger.kernel.org
Cc: Marc Dionne <marc.dionne@auristor.com>,
	linux-afs@lists.infradead.org, dhowells@redhat.com,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH net 2/9] rxrpc: Fix security setting propagation
Date: Thu, 15 Dec 2022 16:19:56 +0000	[thread overview]
Message-ID: <167112119625.152641.17989220946528839395.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <167112117887.152641.6194213035340041732.stgit@warthog.procyon.org.uk>

Fix the propagation of the security settings from sendmsg to the rxrpc_call
struct.

Fixes: f3441d4125fc ("rxrpc: Copy client call parameters into rxrpc_call earlier")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---

 net/rxrpc/call_object.c |    1 +
 net/rxrpc/conn_client.c |    2 --
 net/rxrpc/security.c    |    6 +++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index be5eb8cdf549..89dcf60b1158 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -217,6 +217,7 @@ static struct rxrpc_call *rxrpc_alloc_client_call(struct rxrpc_sock *rx,
 	call->tx_total_len	= p->tx_total_len;
 	call->key		= key_get(cp->key);
 	call->local		= rxrpc_get_local(cp->local, rxrpc_local_get_call);
+	call->security_level	= cp->security_level;
 	if (p->kernel)
 		__set_bit(RXRPC_CALL_KERNEL, &call->flags);
 	if (cp->upgrade)
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index a08e33c9e54b..87efa0373aed 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -551,8 +551,6 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn,
 	call->conn	= rxrpc_get_connection(conn, rxrpc_conn_get_activate_call);
 	call->cid	= conn->proto.cid | channel;
 	call->call_id	= call_id;
-	call->security	= conn->security;
-	call->security_ix = conn->security_ix;
 	call->dest_srx.srx_service = conn->service_id;
 
 	trace_rxrpc_connect_call(call);
diff --git a/net/rxrpc/security.c b/net/rxrpc/security.c
index 209f2c25a0da..ab968f65a490 100644
--- a/net/rxrpc/security.c
+++ b/net/rxrpc/security.c
@@ -67,13 +67,13 @@ const struct rxrpc_security *rxrpc_security_lookup(u8 security_index)
  */
 int rxrpc_init_client_call_security(struct rxrpc_call *call)
 {
-	const struct rxrpc_security *sec;
+	const struct rxrpc_security *sec = &rxrpc_no_security;
 	struct rxrpc_key_token *token;
 	struct key *key = call->key;
 	int ret;
 
 	if (!key)
-		return 0;
+		goto found;
 
 	ret = key_validate(key);
 	if (ret < 0)
@@ -88,7 +88,7 @@ int rxrpc_init_client_call_security(struct rxrpc_call *call)
 
 found:
 	call->security = sec;
-	_leave(" = 0");
+	call->security_ix = sec->security_index;
 	return 0;
 }
 



  parent reply	other threads:[~2022-12-15 16:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20221218120951.1212-1-hdanton@sina.com>
     [not found] ` <20221216001958.1149-1-hdanton@sina.com>
2022-12-15 16:19   ` [PATCH net 0/9] rxrpc: Fixes for I/O thread conversion/SACK table expansion David Howells
2022-12-15 16:19     ` [PATCH net 1/9] rxrpc: Fix missing unlock in rxrpc_do_sendmsg() David Howells
2022-12-15 16:19     ` David Howells [this message]
2022-12-15 16:20     ` [PATCH net 3/9] rxrpc: Fix NULL deref in rxrpc_unuse_local() David Howells
2022-12-15 16:20     ` [PATCH net 4/9] rxrpc: Fix I/O thread startup getting skipped David Howells
2022-12-15 16:20     ` [PATCH net 5/9] rxrpc: Fix locking issues in rxrpc_put_peer_locked() David Howells
2022-12-15 16:20     ` [PATCH net 6/9] rxrpc: Fix switched parameters in peer tracing David Howells
2022-12-15 16:20     ` [PATCH net 7/9] rxrpc: Fix I/O thread stop David Howells
2022-12-15 16:20     ` [PATCH net 8/9] rxrpc: rxperf: Fix uninitialised variable David Howells
2022-12-15 16:20     ` [PATCH net 9/9] rxrpc: Fix the return value of rxrpc_new_incoming_call() David Howells
2022-12-15 19:48     ` [PATCH net 0/9] rxrpc: Fixes for I/O thread conversion/SACK table expansion Marc Dionne
2022-12-16  6:46     ` [PATCH net 7/9] rxrpc: Fix I/O thread stop David Howells
2022-12-18 19:59     ` David Howells
2022-12-19  0:20     ` David Howells
2022-12-19 10:20     ` [PATCH net 0/9] rxrpc: Fixes for I/O thread conversion/SACK table expansion patchwork-bot+netdevbpf

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=167112119625.152641.17989220946528839395.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.