[PATCH net] rxrpc: Fix untrusted unsigned subtract

Simon Horman horms at kernel.org
Fri Sep 12 11:48:01 PDT 2025


On Fri, Sep 12, 2025 at 12:06:17AM +0100, David Howells wrote:
> Fix the following Smatch Smatch static checker warning:

nit: Smatch Smatch -> Smatch

> 
>    net/rxrpc/rxgk_app.c:65 rxgk_yfs_decode_ticket()
>    warn: untrusted unsigned subtract. 'ticket_len - 10 * 4'
> 
> by prechecking the length of what we're trying to extract in two places in
> the token and decoding for a response packet.
> 
> Also use sizeof() on the struct we're extracting rather specifying the size
> numerically to be consistent with the other related statements.
> 
> Fixes: 9d1d2b59341f ("rxrpc: rxgk: Implement the yfs-rxgk security class (GSSAPI)")
> Reported-by: Dan Carpenter <dan.carpenter at linaro.org>
> Closes: https://lists.infradead.org/pipermail/linux-afs/2025-September/010135.html
> Signed-off-by: David Howells <dhowells at redhat.com>
> cc: Marc Dionne <marc.dionne at auristor.com>
> cc: Jakub Kicinski <kuba at kernel.org>
> cc: "David S. Miller" <davem at davemloft.net>
> cc: Eric Dumazet <edumazet at google.com>
> cc: Paolo Abeni <pabeni at redhat.com>
> cc: Simon Horman <horms at kernel.org>
> cc: linux-afs at lists.infradead.org
> cc: netdev at vger.kernel.org
> ---
>  net/rxrpc/rxgk_app.c |   19 ++++++++++++++-----
>  1 file changed, 14 insertions(+), 5 deletions(-)

Reviewed-by: Simon Horman <horms at kernel.org>




More information about the linux-afs mailing list