In the Linux kernel, the following vulnerability has been resolved: misc: ad525x_dpot: use driver core groups for sysfs files ad_dpot_probe() creates per-RDAC sysfs files manually and then optionally creates the command sysfs group. This leaves probe responsible for rolling back partial sysfs state and makes remove responsible for matching every file that probe created. Move the device attributes into driver core dev_groups for the I2C and SPI drivers and use an is_visible() callback to expose only the attributes supported by the probed device. With this shape, the driver core creates the sysfs files only after probe succeeds and removes them before the remove callback frees the driver data.
https://git.kernel.org/stable/c/e3a8557e88eb26278eda60bf64f2ef33ce7de8bf
https://git.kernel.org/stable/c/e30f2c23c8d5620f9679e3b6656a6eb7cb1fd38b
https://git.kernel.org/stable/c/ddbd794e543e5f917d191f8259ce40b79c52d105
https://git.kernel.org/stable/c/c7ff7a70f405a3c6fde39ed00a36d9f4fecaf3ab
https://git.kernel.org/stable/c/ab2fe43041412d37f88eb368a99f63f98b31d8ea
https://git.kernel.org/stable/c/aa3ace3f6c66811001ffa63a53fbb01ed8109312
https://git.kernel.org/stable/c/1d43cef1d4ff258dee3020cc29f29fd6becfd8b9
https://git.kernel.org/stable/c/0394902df38279da7f880021b2cfc64577a60e42