Fix incongruency in handling of sysfs entries creation. This issue could cause invalid memory accesses, by not properly detecting the end of the sysfs attributes array. Signed-off-by: Luis Mendes <luis.p.mendes@xxxxxxxxx> --- gasket_sysfs.c | 3 +-- gasket_sysfs.h | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c --- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.c 2020-03-23 01:31:56.000000000 +0000 +++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.c 2020-03-29 18:52:39.399925886 +0100 @@ -228,8 +228,7 @@ int gasket_sysfs_create_entries(struct d } mutex_lock(&mapping->mutex); - for (i = 0; strcmp(attrs[i].attr.attr.name, GASKET_ARRAY_END_MARKER); - i++) { + for (i = 0; attrs[i].attr.attr.name != NULL; i++) { if (mapping->attribute_count == GASKET_SYSFS_MAX_NODES) { dev_err(device, "Maximum number of sysfs nodes reached for device\n"); diff -uprN -X linux-5.6-rc7-vanilla/Documentation/dontdiff linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h --- linux-5.6-rc7-vanilla/drivers/staging/gasket/gasket_sysfs.h 2020-03-23 01:31:56.000000000 +0000 +++ linux-5.6-rc7/drivers/staging/gasket/gasket_sysfs.h 2020-03-29 18:52:56.487839090 +0100 @@ -30,10 +30,6 @@ */ #define GASKET_SYSFS_MAX_NODES 196 -/* End markers for sysfs struct arrays. */ -#define GASKET_ARRAY_END_TOKEN GASKET_RESERVED_ARRAY_END -#define GASKET_ARRAY_END_MARKER __stringify(GASKET_ARRAY_END_TOKEN) - /* * Terminator struct for a gasket_sysfs_attr array. Must be at the end of * all gasket_sysfs_attribute arrays. _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel