Re: [PATCH v3] zram: don't free statically defined names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On (24/09/24 07:21), Christophe JAILLET wrote:
[..]
> > kfree_const() will not work if zram is built as a module. It works
> > only for .rodata for kernel image. [1]
> > 
> > 1. https://elixir.bootlin.com/linux/v6.11/source/include/asm-generic/sections.h#L177
> > 
> 
> If so, then it is likely that it is not correctly used elsewhere.
> 
> https://elixir.bootlin.com/linux/v6.11/source/drivers/dax/kmem.c#L289
> https://elixir.bootlin.com/linux/v6.11/source/drivers/firmware/arm_scmi/bus.c#L341
> https://elixir.bootlin.com/linux/v6.11/source/drivers/input/touchscreen/chipone_icn8505.c#L379

icn8505_probe_acpi() uses kfree_const(subsys)...

subsys is returned from acpi_get_subsystem_id() which only
does
		sub = kstrdup(obj->string.pointer, GFP_KERNEL);

However, if acpi_get_subsystem_id() returns an error then
icn8505_probe_acpi() does

		subsys = "unknown";

and I suspect that kfree_const(subsys) can, in fact, explode?




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux