summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2023-09-22 16:37:11 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-10 21:46:43 +0200
commit442e50393a29fd0abc7c6d4131d395c4742d6964 (patch)
tree364184b7fb8e2c9447334fbe9ba3cdf5aac03fff /security
parent52008a5e22acc4bb731ac99f4ebee748c9ed219a (diff)
regmap: rbtree: Fix wrong register marked as in-cache when creating new node
[ Upstream commit 7a795ac8d49e2433e1b97caf5e99129daf8e1b08 ] When regcache_rbtree_write() creates a new rbtree_node it was passing the wrong bit number to regcache_rbtree_set_register(). The bit number is the offset __in number of registers__, but in the case of creating a new block regcache_rbtree_write() was not dividing by the address stride to get the number of registers. Fix this by dividing by map->reg_stride. Compare with regcache_rbtree_read() where the bit is checked. This bug meant that the wrong register was marked as present. The register that was written to the cache could not be read from the cache because it was not marked as cached. But a nearby register could be marked as having a cached value even if it was never written to the cache. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Fixes: 3f4ff561bc88 ("regmap: rbtree: Make cache_present bitmap per node") Link: https://lore.kernel.org/r/20230922153711.28103-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions