Skip to content

Commit 9a059cd

Browse files
committed
rxrpc: Downgrade the BUG() for unsupported token type in rxrpc_read()
If rxrpc_read() (which allows KEYCTL_READ to read a key), sees a token of a type it doesn't recognise, it can BUG in a couple of places, which is unnecessary as it can easily get back to userspace. Fix this to print an error message instead. Fixes: 9945515 ("RxRPC: Parse security index 5 keys (Kerberos 5)") Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 5630511 commit 9a059cd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/rxrpc/key.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,8 @@ static long rxrpc_read(const struct key *key,
11071107
break;
11081108

11091109
default: /* we have a ticket we can't encode */
1110-
BUG();
1110+
pr_err("Unsupported key token type (%u)\n",
1111+
token->security_index);
11111112
continue;
11121113
}
11131114

@@ -1223,7 +1224,6 @@ static long rxrpc_read(const struct key *key,
12231224
break;
12241225

12251226
default:
1226-
BUG();
12271227
break;
12281228
}
12291229

0 commit comments

Comments
 (0)