Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:gcomes.obs:ipu6
intel-ipu6
8be07a2b4db358f6437bf1dfe049ac77a9660ebe.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 8be07a2b4db358f6437bf1dfe049ac77a9660ebe.patch of Package intel-ipu6
From 8be07a2b4db358f6437bf1dfe049ac77a9660ebe Mon Sep 17 00:00:00 2001 From: Hans de Goede <hdegoede@redhat.com> Date: Wed, 6 Mar 2024 16:43:11 +0100 Subject: [PATCH] cio2-bridge: Do not use on stack memory for software_node.name field cio2_bridge_create_connection_swnodes() was initalizing the nodes[SWNODE_SENSOR_HID] and nodes[SWNODE_VCM] software_node.name fields to *point* to the sensor_node_name and vcm_node_name on stack variables. But the software_node struct is much longer lived then the current stack-frame, so this is no good and leads to crashes with kernel >= 6.8 (and this could theoritically also lead to issues with older kernels). Fix this by using the long-lived node_names struct to intialize these software_node.name fields just like how this is already done for the other software_node-s. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/media/pci/intel/cio2-bridge.c | 10 ++++------ drivers/media/pci/intel/cio2-bridge.h | 3 +++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/media/pci/intel/cio2-bridge.c b/drivers/media/pci/intel/cio2-bridge.c index 889e4195d509..13ec100a2ae9 100644 --- a/drivers/media/pci/intel/cio2-bridge.c +++ b/drivers/media/pci/intel/cio2-bridge.c @@ -246,15 +246,13 @@ static void cio2_bridge_create_connection_swnodes(struct cio2_bridge *bridge, struct cio2_sensor *sensor) { struct software_node *nodes = sensor->swnodes; - char sensor_node_name[ACPI_ID_LEN + 2]; - char vcm_node_name[ACPI_ID_LEN + 2]; cio2_bridge_init_swnode_names(sensor); - snprintf(sensor_node_name, sizeof(sensor_node_name), + snprintf(sensor->node_names.sensor_name, sizeof(sensor->node_names.sensor_name), "%s-%u", sensor->name, sensor->ssdb.link); - nodes[SWNODE_SENSOR_HID] = NODE_SENSOR(sensor_node_name, + nodes[SWNODE_SENSOR_HID] = NODE_SENSOR(sensor->node_names.sensor_name, sensor->dev_properties); nodes[SWNODE_SENSOR_PORT] = NODE_PORT(sensor->node_names.port, &nodes[SWNODE_SENSOR_HID]); @@ -270,10 +268,10 @@ static void cio2_bridge_create_connection_swnodes(struct cio2_bridge *bridge, sensor->cio2_properties); if (sensor->ssdb.vcmtype && sensor->ssdb.vcmtype <= ARRAY_SIZE(cio2_vcm_types)) { - snprintf(vcm_node_name, sizeof(vcm_node_name), + snprintf(sensor->node_names.vcm_name, sizeof(sensor->node_names.vcm_name), "%s-%u", cio2_vcm_types[sensor->ssdb.vcmtype - 1], sensor->ssdb.link); - nodes[SWNODE_VCM] = NODE_VCM(vcm_node_name); + nodes[SWNODE_VCM] = NODE_VCM(sensor->node_names.vcm_name); } cio2_bridge_init_swnode_group(sensor); diff --git a/drivers/media/pci/intel/cio2-bridge.h b/drivers/media/pci/intel/cio2-bridge.h index 3f9080273dfe..fb692c208751 100644 --- a/drivers/media/pci/intel/cio2-bridge.h +++ b/drivers/media/pci/intel/cio2-bridge.h @@ -4,6 +4,7 @@ #ifndef __CIO2_BRIDGE_H #define __CIO2_BRIDGE_H +#include <linux/mod_devicetable.h> #include <linux/property.h> #include <linux/types.h> @@ -106,6 +107,8 @@ struct cio2_node_names { char port[7]; char endpoint[11]; char remote_port[7]; + char sensor_name[ACPI_ID_LEN + 2]; + char vcm_name[ACPI_ID_LEN + 2]; }; struct cio2_sensor_config {
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor