mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: srinivas.kandagatla@linaro.org
Cc: linux-kernel@vger.kernel.org,
	Sukrut Bellary <sukrut.bellary@linux.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH 1/1] misc: fastrpc: Fix double free of 'buf' in error path
Date: Tue, 3 Sep 2024 12:19:26 +0200	[thread overview]
Message-ID: <2024090311-foam-pouncing-fcdd@gregkh> (raw)
In-Reply-To: <20240902141409.70371-2-srinivas.kandagatla@linaro.org>

On Mon, Sep 02, 2024 at 03:14:09PM +0100, srinivas.kandagatla@linaro.org wrote:
> From: Sukrut Bellary <sukrut.bellary@linux.com>
> 
> smatch warning:
> drivers/misc/fastrpc.c:1926 fastrpc_req_mmap() error: double free of 'buf'
> 
> In fastrpc_req_mmap() error path, the fastrpc buffer is freed in
> fastrpc_req_munmap_impl() if unmap is successful.
> 
> But in the end, there is an unconditional call to fastrpc_buf_free().
> So the above case triggers the double free of fastrpc buf.
> 
> Fixes: 72fa6f7820c4 ("misc: fastrpc: Rework fastrpc_req_munmap")
> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Signed-off-by: Sukrut Bellary <sukrut.bellary@linux.com>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/misc/fastrpc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Any reason you forgot a cc: stable@ on this?

I'll go add it by hand...


  reply	other threads:[~2024-09-03 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02 14:14 [PATCH 0/1] misc: fastrpc: fixes for 6.11 srinivas.kandagatla
2024-09-02 14:14 ` [PATCH 1/1] misc: fastrpc: Fix double free of 'buf' in error path srinivas.kandagatla
2024-09-03 10:19   ` Greg KH [this message]
2024-09-03 10:46     ` Srinivas Kandagatla

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=2024090311-foam-pouncing-fcdd@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=sukrut.bellary@linux.com \
    /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

all inboxes | Powered by JetHome®