baa18b6e | 26-Feb-2025 |
Thorsten Blum <thorsten.blum@linux.dev> |
platform/x86: hp-bioscfg: Replace deprecated strncpy() with strscpy()
Since kstrtol() requires a NUL-terminated string as input and strncpy() is deprecated for NUL-terminated destination buffers, us
platform/x86: hp-bioscfg: Replace deprecated strncpy() with strscpy()
Since kstrtol() requires a NUL-terminated string as input and strncpy() is deprecated for NUL-terminated destination buffers, use strscpy() instead.
Compile-tested only.
Link: https://github.com/KSPP/linux/issues/90 Cc: linux-hardening@vger.kernel.org Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://lore.kernel.org/r/20250225232126.356274-2-thorsten.blum@linux.dev Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
92c47597 | 13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes()
acpi_object *obj is unused in this function, so delete it, also delete a unnecessary kfree(obj);
Signed-off-by: Harshit Moga
platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes()
acpi_object *obj is unused in this function, so delete it, also delete a unnecessary kfree(obj);
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-4-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
f40f9399 | 13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
'attr_name_kobj' is allocated using kzalloc, but on all the error paths it is not freed, hence we have a memory leak.
Fix t
platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
'attr_name_kobj' is allocated using kzalloc, but on all the error paths it is not freed, hence we have a memory leak.
Fix the error path before kobject_init_and_add() by adding kfree().
kobject_put() must be always called after passing the object to kobject_init_and_add(). Only the error path which is immediately next to kobject_init_and_add() calls kobject_put() and not any other error path after it.
Fix the error handling after kobject_init_and_add() by moving the kobject_put() into the goto label err_other_attr_init that is already used by all the error paths after kobject_init_and_add().
Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Cc: stable@vger.kernel.org # 6.6.x: c5dbf0416000: platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() Cc: stable@vger.kernel.org # 6.6.x: 5736aa9537c9: platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202309201412.on0VXJGo-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> [ij: Added the stable dep tags] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-3-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
5736aa95 | 13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
attr_name_kobj's memory allocation is done with mutex_lock() held, this is not needed.
Move allocation outside of mutex
platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
attr_name_kobj's memory allocation is done with mutex_lock() held, this is not needed.
Move allocation outside of mutex_lock() so unlock is not needed when allocation fails.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-2-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
6f8972a0 | 03-Aug-2023 |
Li Zetao <lizetao1@huawei.com> |
platform/x86: hp-bioscfg: Use kmemdup() to replace kmalloc + memcpy
There are some warnings reported by coccinelle:
./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:317:35-42: WARNING opp
platform/x86: hp-bioscfg: Use kmemdup() to replace kmalloc + memcpy
There are some warnings reported by coccinelle:
./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:317:35-42: WARNING opportunity for kmemdup ./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:270:40-47: WARNING opportunity for kmemdup ./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:233:36-43: WARNING opportunity for kmemdup
Use kmemdup rather than duplicating its implementation.
Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230803032027.3044851-1-lizetao1@huawei.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
bfecbcb5 | 31-Jul-2023 |
Jorge Lopez <jorge.lopez2@hp.com> |
platform/x86: hp-bioscfg: Remove duplicate use of variable in inner loop
Replace use of same variable in inner loop.
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r
platform/x86: hp-bioscfg: Remove duplicate use of variable in inner loop
Replace use of same variable in inner loop.
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230731203141.30044-9-jorge.lopez2@hp.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
efd4211e | 31-Jul-2023 |
Jorge Lopez <jorge.lopez2@hp.com> |
platform/x86: hp-bioscfg: Change how password encoding size is evaluated
Update steps how password encoding size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.ker
platform/x86: hp-bioscfg: Change how password encoding size is evaluated
Update steps how password encoding size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230731203141.30044-8-jorge.lopez2@hp.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
42efc9e6 | 31-Jul-2023 |
Jorge Lopez <jorge.lopez2@hp.com> |
platform/x86: hp-bioscfg: Change how enum possible values size is evaluated
Updates steps how enum possible values size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://l
platform/x86: hp-bioscfg: Change how enum possible values size is evaluated
Updates steps how enum possible values size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230731203141.30044-7-jorge.lopez2@hp.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
24652a8c | 31-Jul-2023 |
Jorge Lopez <jorge.lopez2@hp.com> |
platform/x86: hp-bioscfg: Change how order list size is evaluated
Update steps how order list size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/2023
platform/x86: hp-bioscfg: Change how order list size is evaluated
Update steps how order list size is evaluated
Signed-off-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230731203141.30044-6-jorge.lopez2@hp.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|