[PATCH] mvebu: harmonize GL.iNet GL-MV1000 MTD partitions layout with vendor

2022-11-19 Thread Enrico Mioso
The GL-MV1000 ships with a 16MB spi-nor flash, containing a copy of the stock GL.iNet firmware. Add the corresponding flash areas, so our view matches the one of the in-flash stock firmware. Signed-off-by: Enrico Mioso --- .../dts/marvell/armada-3720-gl-mv1000.dts | 20 ++-

[PATCH 22.03] ath79: mikrotik: use OpenWrt loader for initram image

2022-11-19 Thread Thibaut VARĂˆNE
From: John Thomson Return to using the OpenWrt kernel loader to decompress and load kernel initram image. Continue to use the vmlinuz kernel for squashfs. Mikrotik's bootloader RouterBOOT on some ath79 devices is failing to boot the current initram, due to the size of the initram image. On

24 core buildbot server donation feasible

2022-11-19 Thread Dave Taht
Equinix's open source support program indicated a willingness to contribute a bare metal buildbot server from this list: https://metal.equinix.com/developers/docs/hardware/legacy-servers/ I don't know who does the buildbots these days?, but please, get in touch with whoever does, ask them to

[PATCH v2 2/9] uci: maintain option position in uci_set

2022-11-19 Thread Jan Venekamp
Maintain the position of an option in the list when updating an option in uci_set. Signed-off-by: Jan Venekamp --- list.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/list.c b/list.c index ac3686c..a8f2a2c 100644 --- a/list.c +++ b/list.c @@ -76,7 +76,7 @@

[PATCH v2 3/9] uci: optimize update option in uci_set

2022-11-19 Thread Jan Venekamp
Optimize for the case when there is no need to reallocate memory when updating an option in uci_set. Signed-off-by: Jan Venekamp --- list.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/list.c b/list.c index a8f2a2c..5148dfd 100644 --- a/list.c +++

[PATCH v2 1/9] uci: fix use-after-free uci_set on update option

2022-11-19 Thread Jan Venekamp
When uci_set is called with ptr->o set and ptr->option = NULL, then in uci_expand_ptr ptr->option is set to ptr->o->e.name. This will result in use-after-free because ptr->option is used in the call to uci_add_delta after uci_free_option(ptr->o). Signed-off-by: Jan Venekamp --- list.c | 7

[PATCH v2 0/9] uci: fixes for uci_set and uci_add_list

2022-11-19 Thread Jan Venekamp
When developing a C application that updates options with uci_set I noticed that config files were not getting these updates. I found that this was due to a use-after-free bug in uci_set. Looking further at the code I also noticed some other issues. This patch series contains fixes to these

[PATCH v2 5/9] uci: fix atomicity of uci_add_list

2022-11-19 Thread Jan Venekamp
The function uci_add_list is not atomic, when an alloc inside uci_add_element_list fails the option can be left in an indeterminate state. Refactor uci_add_list to fix this and make the code flow easier to read. Signed-off-by: Jan Venekamp --- list.c | 74

[PATCH v2 4/9] uci: fix use-after-free uci_add_list

2022-11-19 Thread Jan Venekamp
When uci_add_list is called with ptr->o set and ptr->option = NULL, then in uci_expand_ptr ptr->option is set to ptr->o->e.name. If ptr->o->type is UCI_TYPE_STRING then prev is set to ptr->o. This will result in use-after-free because ptr->option is used in the call to uci_add_delta in

[PATCH v2 6/9] uci: maintain option position in uci_add_list

2022-11-19 Thread Jan Venekamp
Maintain the position of an option in the list when a string option is converted to a list option in uci_add_list. Signed-off-by: Jan Venekamp --- list.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/list.c b/list.c index 3518967..e6d631c 100644 --- a/list.c +++

[PATCH v2 8/9] uci: optimize update section in uci_set

2022-11-19 Thread Jan Venekamp
Optimize for the case when there is no need to update the section and the case there is no need to reallocate memory when updating a section in uci_set. Signed-off-by: Jan Venekamp --- list.c| 23 +++ tests/shunit2/tests.d/090_cli_options | 8

[PATCH v2 7/9] uci: fix memory leak uci_set on update section

2022-11-19 Thread Jan Venekamp
If uci_realloc fails when updating a section in uci_set the reference to the memory allocated by s = uci_strdup() is lost. Also, if uci_strdup and uci_realloc both succeed it could happen that ptr->s->type == uci_dataptr(ptr->s) by accident. Then later on in uci_free_section the allocated

[PATCH v2 9/9] uci: macro uci_alloc_element not in uci.h

2022-11-19 Thread Jan Venekamp
The macro uci_alloc_element is in the public header file uci.h. However, the macros output refers to uci_alloc_generic wich is in uci_internal.h and not public. Thus, uci_alloc_element should be private as well and moved to uci_internal.h. Signed-off-by: Jan Venekamp --- uci.h | 10

[PATCH 1/1] uci: ignore wrong section / option name in uci_ptr

2022-11-19 Thread Jan Venekamp
Several functions that have a uci_ptr as argument expect if ptr->s / ptr->o are provided that strcmp(ptr->s->e.name, ptr->section) == 0 and strcmp(ptr->o->e.name, ptr->option) == 0. Normally this is ensured by a call to uci_lookup_ptr that precedes the function invocation and by uci_expand_ptr.

[PATCH 0/1] uci: ignore wrong section / option name in uci_ptr

2022-11-19 Thread Jan Venekamp
This patch depends on patch series: [PATCH v2] uci: fixes for uci_set and uci_add_list Jan Venekamp (1): uci: ignore wrong section / option name in uci_ptr list.c | 61 -- 1 file changed, 25 insertions(+), 36 deletions(-) -- 2.32.0