Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [bug report] SUNRPC: Fix svcauth_gss_proxy_init()
Date: Sat, 4 May 2024 11:18:39 -0400	[thread overview]
Message-ID: <ZjZRz3JuXPAvt3mb@tissot.1015granger.net> (raw)
In-Reply-To: <4d92f9a7-a278-4d61-9804-f6bc7cd7963a@moroto.mountain>

On Sat, May 04, 2024 at 02:23:23PM +0300, Dan Carpenter wrote:
> Hello Chuck Lever,
> 
> Commit 5866efa8cbfb ("SUNRPC: Fix svcauth_gss_proxy_init()") from Oct
> 24, 2019 (linux-next), leads to the following Smatch static checker
> warning:
> 
> 	net/sunrpc/auth_gss/svcauth_gss.c:1039 gss_free_in_token_pages()
> 	warn: iterator 'i' not incremented

We haven't seen a problem in practice, thus it's likely that
->page_len is rarely if ever larger than a page. I will post a fix
in a day or two. Thanks, Dan!


> net/sunrpc/auth_gss/svcauth_gss.c
>     1034 static void gss_free_in_token_pages(struct gssp_in_token *in_token)
>     1035 {
>     1036         u32 inlen;
>     1037         int i;
>     1038 
> --> 1039         i = 0;
>     1040         inlen = in_token->page_len;
>     1041         while (inlen) {
>     1042                 if (in_token->pages[i])
>     1043                         put_page(in_token->pages[i]);
>                                                           ^
> This puts page zero over and over.
> 
>     1044                 inlen -= inlen > PAGE_SIZE ? PAGE_SIZE : inlen;
>     1045         }
>     1046 
>     1047         kfree(in_token->pages);
>     1048         in_token->pages = NULL;
>     1049 }
> 
> regards,
> dan carpenter
> 

-- 
Chuck Lever

      reply	other threads:[~2024-05-04 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04 11:23 [bug report] SUNRPC: Fix svcauth_gss_proxy_init() Dan Carpenter
2024-05-04 15:18 ` Chuck Lever [this message]

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=ZjZRz3JuXPAvt3mb@tissot.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-nfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).