diff options
| author | Sukrut Bellary <sukrut.bellary@linux.com> | 2024-09-02 15:14:09 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-12 11:11:41 +0200 |
| commit | f77dc8a75859e559f3238a6d906206259227985e (patch) | |
| tree | 685d166794a3eba4190c93137f82b9285f014219 /drivers/android/binder.c | |
| parent | 7d301dd2722f71e39d5b4a3f7cadff310fbffa03 (diff) | |
| download | linux-f77dc8a75859e559f3238a6d906206259227985e.tar.gz linux-f77dc8a75859e559f3238a6d906206259227985e.tar.bz2 linux-f77dc8a75859e559f3238a6d906206259227985e.zip | |
misc: fastrpc: Fix double free of 'buf' in error path
commit e8c276d4dc0e19ee48385f74426aebc855b49aaf upstream.
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>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20240902141409.70371-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android/binder.c')
0 files changed, 0 insertions, 0 deletions
