No description
Find a file
Vladimir Oltean 4228c00e14 net: dsa: sja1105: fix NULL pointer dereference in sja1105_reload_cbs()
[ Upstream commit be7f62eeba ]

priv->cbs is an array of priv->info->num_cbs_shapers elements of type
struct sja1105_cbs_entry which only get allocated if CONFIG_NET_SCH_CBS
is enabled.

However, sja1105_reload_cbs() is called from sja1105_static_config_reload()
which in turn is called for any of the items in sja1105_reset_reasons,
therefore during the normal runtime of the driver and not just from a
code path which can be triggered by the tc-cbs offload.

The sja1105_reload_cbs() function does not contain a check whether the
priv->cbs array is NULL or not, it just assumes it isn't and proceeds to
iterate through the credit-based shaper elements. This leads to a NULL
pointer dereference.

The solution is to return success if the priv->cbs array has not been
allocated, since sja1105_reload_cbs() has nothing to do.

Fixes: 4d7525085a ("net: dsa: sja1105: offload the Credit-Based Shaper qdisc")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:29 +02:00
arch x86/sev: Split up runtime #VC handler for correct state tracking 2021-07-14 16:56:09 +02:00
block blk-mq: update hctx->dispatch_busy in case of real scheduler 2021-07-14 16:56:13 +02:00
certs certs: Add ability to preload revocation certs 2021-06-30 08:47:30 -04:00
crypto crypto: sm2 - fix a memory leak in sm2 2021-07-14 16:56:06 +02:00
Documentation mm/debug_vm_pgtable/basic: add validation for dirtiness after write protect 2021-07-14 16:56:13 +02:00
drivers net: dsa: sja1105: fix NULL pointer dereference in sja1105_reload_cbs() 2021-07-14 16:56:29 +02:00
fs dax: fix ENOMEM handling in grab_mapping_entry() 2021-07-14 16:56:13 +02:00
include net: macsec: fix the length used to copy the key for offloading 2021-07-14 16:56:28 +02:00
init sched/core: Initialize the idle task with preemption disabled 2021-07-14 16:55:50 +02:00
ipc ipc/mqueue, msg, sem: avoid relying on a stack reference past its expiry 2021-05-26 12:06:54 +02:00
kernel bpf: Fix null ptr deref with mixed tail calls and subprogs 2021-07-14 16:56:26 +02:00
lib lockdep/selftests: Fix selftests vs PROVE_RAW_LOCK_NESTING 2021-07-14 16:56:10 +02:00
LICENSES LICENSES/deprecated: add Zlib license text 2020-09-16 14:33:49 +02:00
mm mm/page_alloc: fix counting of managed_pages 2021-07-14 16:56:14 +02:00
net ipv6: fix out-of-bound access in ip6_parse_tlv() 2021-07-14 16:56:28 +02:00
samples samples/bpf: Fix the error return code of xdp_redirect's main() 2021-07-14 16:56:23 +02:00
scripts kbuild: Fix objtool dependency for 'OBJECT_FILES_NON_STANDARD_<obj> := n' 2021-07-14 16:56:04 +02:00
security evm: fix writing <securityfs>/evm overflow 2021-07-14 16:56:04 +02:00
sound ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook 830 G8 Notebook PC 2021-07-14 16:55:37 +02:00
tools tc-testing: fix list handling 2021-07-14 16:56:26 +02:00
usr Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
virt KVM: do not allow mapping valid but non-reference-counted pages 2021-06-30 08:47:25 -04:00
.clang-format RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
.mailmap mailmap: add two more addresses of Uwe Kleine-König 2020-12-06 10:19:07 -08:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Jason Cooper to CREDITS 2020-11-30 10:20:34 +01:00
Kbuild
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS f2fs: move ioctl interface definitions to separated file 2021-05-19 10:13:00 +02:00
Makefile Makefile: fix GDB warning with CONFIG_RELR 2021-07-14 16:55:53 +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.