Skip to content

Commit fdb9948

Browse files
dhowellsdavem330
authored andcommitted
rxrpc: Fix security setting propagation
Fix the propagation of the security settings from sendmsg to the rxrpc_call struct. Fixes: f3441d4 ("rxrpc: Copy client call parameters into rxrpc_call earlier") Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 4feb2c4 commit fdb9948

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

net/rxrpc/call_object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ static struct rxrpc_call *rxrpc_alloc_client_call(struct rxrpc_sock *rx,
217217
call->tx_total_len = p->tx_total_len;
218218
call->key = key_get(cp->key);
219219
call->local = rxrpc_get_local(cp->local, rxrpc_local_get_call);
220+
call->security_level = cp->security_level;
220221
if (p->kernel)
221222
__set_bit(RXRPC_CALL_KERNEL, &call->flags);
222223
if (cp->upgrade)

net/rxrpc/conn_client.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,6 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn,
551551
call->conn = rxrpc_get_connection(conn, rxrpc_conn_get_activate_call);
552552
call->cid = conn->proto.cid | channel;
553553
call->call_id = call_id;
554-
call->security = conn->security;
555-
call->security_ix = conn->security_ix;
556554
call->dest_srx.srx_service = conn->service_id;
557555

558556
trace_rxrpc_connect_call(call);

net/rxrpc/security.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ const struct rxrpc_security *rxrpc_security_lookup(u8 security_index)
6767
*/
6868
int rxrpc_init_client_call_security(struct rxrpc_call *call)
6969
{
70-
const struct rxrpc_security *sec;
70+
const struct rxrpc_security *sec = &rxrpc_no_security;
7171
struct rxrpc_key_token *token;
7272
struct key *key = call->key;
7373
int ret;
7474

7575
if (!key)
76-
return 0;
76+
goto found;
7777

7878
ret = key_validate(key);
7979
if (ret < 0)
@@ -88,7 +88,7 @@ int rxrpc_init_client_call_security(struct rxrpc_call *call)
8888

8989
found:
9090
call->security = sec;
91-
_leave(" = 0");
91+
call->security_ix = sec->security_index;
9292
return 0;
9393
}
9494

0 commit comments

Comments
 (0)