No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tom Rix fe0278843b soundwire: fix double free of dangling pointer
[ Upstream commit 3fbbf2148a406b3e350fe91e6fdd78eb42ecad24 ]

clang static analysis flags this problem

stream.c:844:9: warning: Use of memory after
  it is freed
        kfree(bus->defer_msg.msg->buf);
              ^~~~~~~~~~~~~~~~~~~~~~~

This happens in an error handler cleaning up memory
allocated for elements in a list.

	list_for_each_entry(m_rt, &stream->master_list, stream_node) {
		bus = m_rt->bus;

		kfree(bus->defer_msg.msg->buf);
		kfree(bus->defer_msg.msg);
	}

And is triggered when the call to sdw_bank_switch() fails.
There are a two problems.

First, when sdw_bank_switch() fails, though it frees memory it
does not clear bus's reference 'defer_msg.msg' to that memory.

The second problem is the freeing msg->buf. In some cases
msg will be NULL so this will dereference a null pointer.
Need to check before freeing.

Fixes: 99b8a5d608 ("soundwire: Add bank switch routine")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200902202650.14189-1-trix@redhat.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-17 13:47:43 +02:00
arch arm64: dts: imx8mq: Fix TMU interrupt property 2020-09-17 13:47:42 +02:00
block blk-iocost: ioc_pd_free() shouldn't assume irq disabled 2020-09-09 19:12:35 +02:00
certs
crypto crypto: af_alg - Work around empty control messages without MSG_MORE 2020-09-03 11:27:05 +02:00
Documentation affs: fix basic permission bits to actually work 2020-09-09 19:12:34 +02:00
drivers soundwire: fix double free of dangling pointer 2020-09-17 13:47:43 +02:00
fs affs: fix basic permission bits to actually work 2020-09-09 19:12:34 +02:00
include libata: implement ATA_HORKAGE_MAX_TRIM_128M and apply to Sandisks 2020-09-09 19:12:34 +02:00
init
ipc
kernel kbuild: add variables for compression tools 2020-09-03 11:27:10 +02:00
lib
LICENSES
mm mm/khugepaged.c: fix khugepaged's request size in collapse_file 2020-09-09 19:12:37 +02:00
net net: disable netpoll on fresh napis 2020-09-12 14:18:55 +02:00
samples
scripts checkpatch: fix the usage of capture group ( ... ) 2020-09-09 19:12:37 +02:00
security
sound ALSA: hda/realtek - Improved routing for Thinkpad X1 7th/8th Gen 2020-09-09 19:12:33 +02:00
tools selftests/timers: Turn off timeout setting 2020-09-17 13:47:41 +02:00
usr
virt KVM: arm64: Only reschedule if MMU_NOTIFIER_RANGE_BLOCKABLE is not set 2020-08-26 10:41:08 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2020-08-26 10:40:46 +02:00
Makefile Linux 5.4.65 2020-09-12 14:18:56 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.