History log of /linux-master/drivers/soc/aspeed/aspeed-p2a-ctrl.c
Revision Date Author Comments
# 0af9e891 25-Sep-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

soc/aspeed: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Link: https://lore.kernel.org/r/20230925095532.1984344-2-u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230925095532.1984344-3-u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230925095532.1984344-4-u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230925095532.1984344-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Joel Stanley <joel@jms.id.au>


# 96b75c9d 03-Aug-2023 Rob Herring <robh@kernel.org>

soc: aspeed: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230803-dt-header-cleanups-for-soc-v2-18-d8de2cc88bff@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>


# 8b07e990 03-Aug-2021 Iwona Winiarska <iwona.winiarska@intel.com>

soc: aspeed: p2a-ctrl: Fix boundary check for mmap

The check mixes pages (vm_pgoff) with bytes (vm_start, vm_end) on one
side of the comparison, and uses resource address (rather than just the
resource size) on the other side of the comparison.
This can allow malicious userspace to easily bypass the boundary check and
map pages that are located outside memory-region reserved by the driver.

Fixes: 01c60dcea9f7 ("drivers/misc: Add Aspeed P2A control driver")
Cc: stable@vger.kernel.org
Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
Reviewed-by: Andrew Jeffery <andrew@aj.id.au>
Tested-by: Andrew Jeffery <andrew@aj.id.au>
Reviewed-by: Joel Stanley <joel@aj.id.au>
Signed-off-by: Joel Stanley <joel@jms.id.au>