[PATCH] usb: kbd: Also accept keyboards with Interrupt OUT endpoint

2021-02-20 Thread Stefan Brüns
a keyboard device is found, while the Set_Protocol request is issued quite some time later. Signed-off-by: Stefan Brüns --- common/usb_kbd.c | 23 ++- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 60c6027e04..afad260

[U-Boot] [PATCH] patman: Unquote output from get_maintainer.pl

2018-01-01 Thread Stefan Brüns
get_maintainer.pl quotes names which it considers unsafe, i.e. anything containing [^a-zA-Z0-9_ \-]. This confuses patman, it will duplicate addresses which are also in Series-to/cc. Strip the quotes. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- tools/patman/get_maintai

Re: [U-Boot] [linux-sunxi] Re: [PATCH 12/16] configs: sun50i: enable ums on bananapi-m64

2017-12-12 Thread Stefan Brüns
e a consistent experience across boards, and we > > will not have to always chase all the defconfigs to provide it. > > I think there's a problem on A64 -- the Pine series are all designed to be > host-only, and it's the most popular A64 board series. No, it just means the *initial*

[U-Boot] [PATCH v1] Document padding between GPT header and partition entries

2017-10-17 Thread Stefan Brüns
so mention support for non-standard layouts in gdisk 1.0.3. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- doc/README.gpt | 33 + 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/doc/README.gpt b/doc/README.gpt index d3db8bce1c..7

[U-Boot] [PATCH] fs/ext4: Initialize group descriptor size for revision level 0 filesystems

2016-12-26 Thread Stefan Brüns
genext2fs creates revision level 0 filesystems, which are not readable by u-boot due to the initialized group descriptor size field. f798b1dda1c5de818b806189e523d1b75db7e72d Reported-by: Kever Yang <kever.y...@rock-chips.com> Reported-by: frostyby...@protonmail.com Signed-off-by: Stefan

[U-Boot] [PATCH] fs/fat: simplify get_fatent for FAT12

2016-12-16 Thread Stefan Brüns
From: Stefan Brüns <stefan.bru...@rwth-aachen.de> Instead of shuffling bits from two adjacent 16 bit words, use one 16 bit word with the appropriate byte offset in the buffer. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/fat/fat.c | 34 +

[U-Boot] [PATCH v2 2/2] fs/fat: merge readwrite get_fatent_value() with readonly get_fatent()

2016-12-16 Thread Stefan Brüns
is fine as it checks if any buffers needs flushing. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@gmail.com> --- fs/fat/fat.c | 25 ++-- fs/fat/fat_w

[U-Boot] [PATCH v2 1/2] fs/fat: Avoid corruption of sectors following the FAT

2016-12-16 Thread Stefan Brüns
The FAT is read/flushed in segments of 6 (FATBUFBLOCKS) disk sectors. The last segment may be less than 6 sectors, cap the length. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Benoît Thébaudeau <benoit.thebaudeau@gmail.com> --- fs/fat/fat.c |

[U-Boot] [PATCH v2 0/2] fs/fat: more bugfixes, cleanups

2016-12-16 Thread Stefan Brüns
Fix a possible filesystem corruption if the FS is almost full, and remove some duplicate code. Stefan Brüns (2): fs/fat: Avoid corruption of sectors following the FAT fs/fat: merge readwrite get_fatent_value() with readonly get_fatent() fs/fat/fat.c | 26 +-- fs/fat

[U-Boot] [PATCH v3 1/2] test/py: Pass u_boot_log instead of console for run_and_log

2016-12-11 Thread Stefan Brüns
From: Stefan Brüns <stefan.bru...@rwth-aachen.de> The runner actually has no console dependency, only on the log provided by the console. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- Alternate approach to the previous patch, always pass the logfile, change

[U-Boot] [PATCH 0/2] fs/fat: more bugfixes, cleanups

2016-12-10 Thread Stefan Brüns
Fix a possible filesystem corruption if the FS is almost full, and remove some duplicate code. Stefan Brüns (1): fs/fat: Avoid corruption of sectors following the FAT Stefan Brüns (1): fs/fat: merge readwrite get_fatent_value() with readonly get_fatent() fs/fat/fat.c | 20

[U-Boot] [PATCH 2/2] fs/fat: merge readwrite get_fatent_value() with readonly get_fatent()

2016-12-10 Thread Stefan Brüns
is fine as it checks if any buffers needs flushing. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/fat/fat.c | 19 + fs/fat/fat_write.c | 118 +++-- 2 files changed, 24 insertions(+), 113 deletions(-) diff

[U-Boot] [PATCH 1/2] fs/fat: Avoid corruption of sectors following the FAT

2016-12-10 Thread Stefan Brüns
From: Stefan Brüns <stefan.bru...@rwth-aachen.de> The FAT is read/flushed in segments of 6 (FATBUFBLOCKS) disk sectors. The last segment may be less than 6 sectors, cap the length. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/fat/fat.c | 1 + fs/fat/fat_

[U-Boot] [PATCH v2 2/2] test/py: Create tests for ext4 and fat testing on sandbox

2016-12-04 Thread Stefan Brüns
From: Stefan Brüns <stefan.bru...@rwth-aachen.de> The following checks are currently implemented: 1. listing a directory 2. verifying size of a file 3. veryfying md5sum for a file region 4. reading the beginning of a file Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de>

[U-Boot] [PATCH v2 1/2] test/py: Allow to pass u_boot_log instead of console for run_and_log

2016-12-04 Thread Stefan Brüns
The runner actually has no console dependency, only on the log provided by the console. Accept both u_boot_console or a multiplexed_log. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/py/u_boot_utils.py | 20 ++-- 1 file changed, 14 insertions(+), 6 del

[U-Boot] [PATCH v2 1/2] ext4: Allow reading files with non-zero offset, clamp read len

2016-11-06 Thread Stefan Brüns
Support was already implemented, but not hooked up. This fixes several fails in the test cases. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- v2: - update ext4fs_read(...) calls from spl_ext.c - move clamping to ext4fs_read_file(...), i.e. correct the check for offse

[U-Boot] [PATCH 2/2] fs-test.sh: Update expected results

2016-11-05 Thread Stefan Brüns
After the latest changes, ext4 no longer has any fails. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh index 6e71b61..b194864 100755 --- a/t

[U-Boot] [PATCH 1/2] ext4: Allow reading files with non-zero offset, clamp read len

2016-11-05 Thread Stefan Brüns
Support was already implemented, but not hooked up. This fixes several fails in the test cases. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4fs.c | 15 +-- include/ext4fs.h | 2 +- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/f

[U-Boot] [PATCH] ext4: Fix handling of sparse files

2016-11-05 Thread Stefan Brüns
A sparse file may have regions not mapped by any extents, at the start or at the end of the file, or anywhere between, thus not finding a matching extent region is never an error. Found by python filesystem tests. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- f

[U-Boot] [PATCH 1/3] test/py: expose config and log as session scoped fixture

2016-11-05 Thread Stefan Brüns
If a test uses a fixture which is expensive to setup, the fixture can possibly created with session or module scope. As u_boot_console has function scope, it can not be used in this case. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/py/conftest.p

[U-Boot] [PATCH 2/3] test/py: Allow to pass u_boot_log instead of console for run_and_log

2016-11-05 Thread Stefan Brüns
The runner actually has no console dependency, only on the log provided by the console. Accept both u_boot_console or a multiplexed_log. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/py/u_boot_utils.py | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-)

[U-Boot] [PATCH 3/3] test/py: Create tests for ext4 and fat testing on sandbox

2016-11-05 Thread Stefan Brüns
The following checks are currently implemented: 1. listing a directory 2. verifying size of a file 3. veryfying md5sum for a file region 4. reading the beginning of a file Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/py/tests/test_fs.py

[U-Boot] [PATCH 0/3] Create python filesystem tests

2016-11-05 Thread Stefan Brüns
regions of a file 4. Reading the head of a file 3. and 4. have some overlap, but the latter will also read sparse file regions. As the old test, some parts need root privileges to mount the image. Stefan Brüns (3): test/py: expose config and log as session scoped fixture test/py: Allow to pass

[U-Boot] [PATCH] tools: add mksunxiboot to tools-all target

2016-10-29 Thread Stefan Brüns
mksunxiboot is useful outside of u-boot, it is e.g. used by sunxi-tools. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- tools/Makefile | 1 + tools/mksunxiboot.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile

[U-Boot] [PATCH] test/py: Fix exception, do not parametrize with empty set

2016-10-16 Thread Stefan Brüns
t_dfu[env__usb_dev_port0-env__dfu_config0]" "" --- Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/py/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/py/conftest.py b/test/py/conftest.py index 5b3a923..ebef40d 100644 --- a/test/py/conftest.py

[U-Boot] [PATCH] cmd/tpm_test: Fix misleading code indentation

2016-10-16 Thread Stefan Brüns
ter is misleadingly indented as if it is guarded by the ‘for’ printf("\n--\n"); ^~ Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- cmd/tpm_test.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/tpm_test.c b/c

[U-Boot] [PATCH v4 2/7] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-10-09 Thread Stefan Brüns
sanity check, so that the check actually verifies the correct value. So far this has not triggered any known bugs, but we're better off safe than sorry. If the buffer is to small, the returned memory_map_size indicates the required size to the caller. Signed-off-by: Stefan Brüns <stefan.

[U-Boot] [PATCH v4 4/7] efi_loader: Track size of pool allocations to allow freeing

2016-10-09 Thread Stefan Brüns
pool allocations and the corresponding page allocation, we create an auxiliary struct efi_pool_allocation. Given the allocation size free_pool size can handoff freeing the page range, which was indirectly allocated by a call to allocate_pool, to free_pages. Signed-off-by: Stefan Brüns <stefan.

[U-Boot] [PATCH v4 3/7] efi_loader: Move efi_allocate_pool implementation to efi_memory.c

2016-10-09 Thread Stefan Brüns
efi_allocate_pool_ext() for use by payloads and an internal helper efi_allocate_pool() in efi_memory.c that handles the actual allocation. While at it, change the magic 0xfff / 12 constants to the more obvious EFI_PAGE_MASK/SHIFT defines. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- i

[U-Boot] [PATCH 1/3] ext4: cleanup unlink_filename function

2016-10-09 Thread Stefan Brüns
Use the same variable names as in search_dir, to make purpose of variables more obvious. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/fs/ext4/ext4_co

[U-Boot] [PATCH 2/3] ext4: Fix handling of direntlen in unlink_filename

2016-10-09 Thread Stefan Brüns
search_dir for directory traversal. This code has the correct checks for direntlen >= sizeof(struct dirent), and offset < blocksize. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 45 + 1 file changed

[U-Boot] [PATCH 0/3] ext4: cleanup/fix unlink_filename function

2016-10-09 Thread Stefan Brüns
This patch series addresses Coverity defects CID 153383/153384. The first patch is a preparation patch, the second addresses the actual issue. The last patch corrects the journal handling in the same function. Stefan Brüns (3): ext4: cleanup unlink_filename function ext4: Fix handling

[U-Boot] [PATCH 3/3] ext4: Only write journal entries for modified blocks in unlink_filename

2016-10-09 Thread Stefan Brüns
Instead of creating a journal entry for each directory block, even if the block is unmodified, only log the modified block. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-)

[U-Boot] [PATCH v2 4/5] sandbox/fs: Set correct filetype for unknown filetype

2016-10-04 Thread Stefan Brüns
and e.g. socket files show up as regular files. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Acked-by: Simon Glass <s...@chromium.org> --- arch/sandbox/cpu/os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 16af3f5..

[U-Boot] [PATCH v3 5/7] efi_loader: Readd freed pages to memory pool

2016-10-01 Thread Stefan Brüns
. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Alexander Graf <ag...@suse.de> --- include/efi_loader.h| 2 +- lib/efi_loader/efi_memory.c | 11 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/efi_loader.h b/include/

[U-Boot] [PATCH v3 7/7] efi_loader: Do not leak memory when unlinking a mapping

2016-10-01 Thread Stefan Brüns
As soon as a mapping is unlinked from the list, there are no further references to it, so it should be freed. If it not unlinked, update the start address and length. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Alexander Graf <ag...@suse.de> --- li

[U-Boot] [PATCH v2 0/6] efi_loader: implement BS.FreePages()/BS.FreePool, some cleanup

2016-10-01 Thread Stefan Brüns
arithmetic, add some comments Stefan Brüns (7): efi_loader: Update description of internal efi_mem_carve_out efi_loader: Fix memory map size check to avoid out-of-bounds access efi_loader: Move efi_allocate_pool implementation to efi_memory.c efi_loader: Track size of pool allocations to allow

[U-Boot] [PATCH v3 3/7] efi_loader: Move efi_allocate_pool implementation to efi_memory.c

2016-10-01 Thread Stefan Brüns
Implementation essentially unchanged, but use EFI_PAGE_MASK/SHIFT instead of numeric constants. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- include/efi_loader.h | 3 +++ lib/efi_loader/efi_boottime.c | 11 +-- lib/efi_loader/efi_memory.c | 11

[U-Boot] [PATCH v3 4/7] efi_loader: Track size of pool allocations to allow freeing

2016-10-01 Thread Stefan Brüns
allocate_pool has to return a buffer which is 8-byte aligned. Shift the region returned by allocate_pages by 8 byte and store the size in the headroom. The 8 byte overhead is neglegible, but provides the required size when freeing the allocation later. Signed-off-by: Stefan Brüns <stefan.

[U-Boot] [PATCH v3 1/7] efi_loader: Update description of internal efi_mem_carve_out

2016-10-01 Thread Stefan Brüns
In 74c16acce30bb882ad5951829d8dafef8eea564c the return values where changed, but the description was kept. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/efi_

[U-Boot] [PATCH v3 6/7] efi_loader: Keep memory mapping sorted when splitting an entry

2016-10-01 Thread Stefan Brüns
The code assumes sorted mappings in descending address order. When splitting a mapping, insert the new part next to the current mapping. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Alexander Graf <ag...@suse.de> --- lib/efi_loader/efi_memory.c | 3 ++- 1

[U-Boot] [PATCH v3 2/7] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-10-01 Thread Stefan Brüns
Do not overwrite the specified size of the provided buffer without having checked it is sufficient. If the buffer is to small, memory_map_size is updated to indicate the required size, and an error code is returned. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_

[U-Boot] [PATCH 4/5] sandbox/fs: Set correct filetype for unknown filetype

2016-10-01 Thread Stefan Brüns
Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- arch/sandbox/cpu/os.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 16af3f5..df2bd4c 100644 --- a/arch/sandbox/cpu/os.c +++ b/arch/sandbox/cpu/os.c @@ -363,6 +363,8

[U-Boot] [PATCH 5/5] sandbox/fs: Use readdir instead of deprecated readdir_r

2016-10-01 Thread Stefan Brüns
Using readdir_r limits the maximum file name length and may even be unsafe, and is thus deprecated in since glibc 2.24. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- arch/sandbox/cpu/os.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff

[U-Boot] [PATCH 0/5] Fix some trivial issues in sandbox/fs

2016-10-01 Thread Stefan Brüns
Stefan Brüns (5): sandbox/fs: Free memory allocated by os_dirent_ls sandbox/fs: Make linking of nodes in os_dirent_ls more obvious sandbox/fs: Use correct size path name buffer sandbox/fs: Set correct filetype for unknown filetype sandbox/fs: Use readdir instead of deprecated readdir_r

[U-Boot] [PATCH 3/5] sandbox/fs: Use correct size path name buffer

2016-10-01 Thread Stefan Brüns
The readdir linux manpage explicitly states (quoting POSIX.1) that sizeof(d_name) is not correct for determining the required size, but to always use strlen. Grow the buffer if needed. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- arch/sandbox/cpu/os.c | 13 ++---

[U-Boot] [PATCH 2/5] sandbox/fs: Make linking of nodes in os_dirent_ls more obvious

2016-10-01 Thread Stefan Brüns
Previously, after reading/creating the second dirent, the second entry would be chained to the first entry and the first entry would be linked to head. Instead, immediately link the first entry to head. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- arch/sandbox/cpu/os

[U-Boot] [PATCH 1/5] sandbox/fs: Free memory allocated by os_dirent_ls

2016-10-01 Thread Stefan Brüns
Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/sandbox/sandboxfs.c | 1 + include/os.h | 11 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c index 2703eed..cd10fd6 100644 --- a/fs/s

[U-Boot] [PATCH v2 5/6] efi_loader: Keep memory mapping sorted when splitting an entry

2016-10-01 Thread Stefan Brüns
The code assumes sorted mappings in descending address order. When splitting a mapping, insert the new part next to the current mapping. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Alexander Graf <ag...@suse.de> --- lib/efi_loader/efi_memory.c | 3 ++- 1

[U-Boot] [PATCH v2 3/6] efi_loader: Track size of pool allocations to allow freeing

2016-10-01 Thread Stefan Brüns
allocate_pool has to return a buffer which is 8-byte aligned. Shift the region returned by allocate_pages by 8 byte and store the size in the headroom. The 8 byte overhead is neglegible, but provides the required size when freeing the allocation later. Signed-off-by: Stefan Brüns <stefan.

[U-Boot] [PATCH v2 1/6] efi_loader: Update description of internal efi_mem_carve_out

2016-10-01 Thread Stefan Brüns
In 74c16acce30bb882ad5951829d8dafef8eea564c the return values where changed, but the description was kept. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/efi_

[U-Boot] [PATCH v2 2/6] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-10-01 Thread Stefan Brüns
Do not overwrite the specified size of the provided buffer without having checked it is sufficient. If the buffer is to small, memory_map_size is updated to indicate the required size, and an error code is returned. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_

[U-Boot] [PATCH v2 4/6] efi_loader: Readd freed pages to memory pool

2016-10-01 Thread Stefan Brüns
. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Alexander Graf <ag...@suse.de> --- lib/efi_loader/efi_memory.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 72a5

[U-Boot] [PATCH v2 6/6] efi_loader: Do not leak memory when unlinking a mapping

2016-10-01 Thread Stefan Brüns
As soon as a mapping is unlinked from the list, there are no further references to it, so it should be freed. If it not unlinked, update the start address and length. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Alexander Graf <ag...@suse.de> --- li

[U-Boot] [PATCH v2 0/6] efi_loader: implement BS.FreePages()/BS.FreePool, some cleanup

2016-10-01 Thread Stefan Brüns
- (Hopefully) clarified commit message efi_loader: Track size of pool allocations to allow freeing - rebased on top of 'efi_loader: Fix crash on 32-bit systems' - assert correct address in efi_free_pool - use EFI_PAGE_MASK instead of 0xfff, EFI_PAGE_SHIFT likewise Stefan Brüns (6

[U-Boot] [PATCH 6/6] efi_loader: Do not leak memory when unlinking a mapping

2016-09-29 Thread Stefan Brüns
As soon as a mapping is unlinked from the list, there are no further references to it, so it should be freed. If it not unlinked, update the start address and length. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory.c | 7 +-- 1 file chan

[U-Boot] [PATCH 2/6] efi_loader: Fix memory map size check to avoid out-of-bounds access

2016-09-29 Thread Stefan Brüns
memory_map_size as IN parameter specifies the size of the provided buffer. If the buffer is to small, memory_map_size is updated to indicate the required size, and an error code is returned. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory

[U-Boot] [PATCH 1/6] efi_loader: Update description of internal efi_mem_carve_out

2016-09-29 Thread Stefan Brüns
In 74c16acce30bb882ad5951829d8dafef8eea564c the return values where changed, but the description was kept. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/efi_

[U-Boot] [PATCH 5/6] efi_loader: Keep memory mapping sorted when splitting an entry

2016-09-29 Thread Stefan Brüns
The code assumes sorted mappings in descending address order. When splitting a mapping, insert the new part next to the current mapping. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[U-Boot] [PATCH 0/6] efi_loader: implement BS.FreePages()/BS.FreePool, some cleanup

2016-09-29 Thread Stefan Brüns
Linux 4.8 no longer boots, as it runs out of descriptor space. Readding the mapping allows reuse, and the next AllocatePool will likely not add a new mapping. Also fix some small issues found while debugging. Stefan Brüns (6): efi_loader: Update description of internal efi_mem_carve_out

[U-Boot] [PATCH 3/6] efi_loader: Track size of pool allocations to allow freeing

2016-09-29 Thread Stefan Brüns
allocate_pool has to return a buffer which is 8-byte aligned. Shift the region returned by allocate_pages by 8 byte and store the size in the headroom. The 8 byte overhead is neglegible, but provides the required size when freeing the allocation later. Signed-off-by: Stefan Brüns <stefan.

[U-Boot] [PATCH 4/6] efi_loader: Readd freed pages to memory pool

2016-09-29 Thread Stefan Brüns
. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- lib/efi_loader/efi_memory.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 5d71fdf..763b79f 100644 --- a/lib/efi_loader/efi_memory.c

[U-Boot] [PATCH v2 6/7] ext4: Respect group descriptor size when adjusting free counts

2016-09-19 Thread Stefan Brüns
Also adjust high 16/32 bits when free inode/block counts are modified. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- v2: rebase on last version of ext4 endian fixes fs/ext4/ext4_common.c | 53 +++ fs/ext4/ext4_write.c

[U-Boot] [PATCH v2 3/7] ext4: Add helper functions for block group descriptor field access

2016-09-19 Thread Stefan Brüns
The helper functions encapsulate access of the block group descriptors, independent of group descriptor size. The helpers also deal with the endianess of the fields, and with split fields like free_blocks/ free_blocks_high. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de>

[U-Boot] [PATCH 7/7] ext4: Revert rejection of 64bit enabled ext4 fs

2016-09-16 Thread Stefan Brüns
Enable mounting of ext4 fs with 64bit feature, as it is supported now. These had been disabled in 6f94ab6656ceffb3f2a972c8de4c554502b6f2b7. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 9 - 1 file changed, 9 deletions(-) diff --git a/f

[U-Boot] [PATCH 5/7] ext4: Use helper function to access group descriptor and its fields

2016-09-16 Thread Stefan Brüns
The descriptor size is variable, thus array indices are not generically applicable. The larger group descriptors also contain e.g. high parts of block numbers, which have to be read and written. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c

[U-Boot] [PATCH 1/7] ext4: Update ext2/3/4 superblock, group descriptor and inode structures

2016-09-16 Thread Stefan Brüns
Most importantly, the superblock provides the used group descriptor size, which is required for the EXT4_FEATURE_INCOMPAT_64BIT. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- include/ext_common.h | 50 ++ 1 file chang

[U-Boot] [PATCH 6/7] ext4: Respect group descriptor size when adjusting free counts

2016-09-16 Thread Stefan Brüns
Also adjust high 16/32 bits when free inode/block counts are modified. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 53 +++ fs/ext4/ext4_write.c | 40 ++ 2 files c

[U-Boot] [PATCH 3/7] ext4: Add helper functions for block group descriptor field access

2016-09-16 Thread Stefan Brüns
The helper functions encapsulate access of the block group descriptors, independent of group descriptor size. The helpers also deal with the endianess of the fields, and with split fields like free_blocks/ free_blocks_high. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- f

[U-Boot] [PATCH 0/7] Add support for ext4 with enabled 64bit feature

2016-09-16 Thread Stefan Brüns
The EXT4_FEATURE_INCOMPAT_64BIT changes the on disk layout. Use the correct structure sizes/offsets and respect split high/low free inode/block counts. Stefan Brüns (7): ext4: Update ext2/3/4 superblock, group descriptor and inode structures ext4: determine group descriptor size for 64bit

[U-Boot] [PATCH 2/7] ext4: determine group descriptor size for 64bit feature

2016-09-16 Thread Stefan Brüns
If EXT4_FEATURE_INCOMPAT_64BIT is set, the descriptor can be read from the superblocks, otherwise it defaults to 32. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 18 ++ include/ext4fs.h | 2 ++ 2 files changed, 16 insertions

[U-Boot] [PATCH 4/7] ext4: Use correct descriptor size when reading the block group descriptor

2016-09-16 Thread Stefan Brüns
The correct descriptor size must be used when calculating offsets, and also to read the correct amount of data. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4/ext4_comm

[U-Boot] [PATCH v2 1/5] test/fs: Restructure file path specification to allow some flexibility

2016-09-13 Thread Stefan Brüns
Instead of providing the full path, specify directory and filename separately. This allows to specify intermediate directories, required for some additional tests. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.s

[U-Boot] [PATCH v2 3/5] test/fs: strip noise from filesystem code prior to checking results

2016-09-13 Thread Stefan Brüns
ext4 and fat code emit some diagnostic messages during command execution. These additional lines force a match window size which strictly is not necessary. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 26 +++--- 1 file chang

[U-Boot] [PATCH v2 5/5] test/fs: Check writes using "." (same dir) relative path

2016-09-13 Thread Stefan Brüns
/ and /./ should reference the same file. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh index 69abdab..520344b

[U-Boot] [PATCH v2 4/5] test/fs: Check ext4 behaviour if dirent is first entry in directory block

2016-09-13 Thread Stefan Brüns
Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh index b9c2306..69abdab 100755 --- a/test/fs/fs-test.sh +++ b/test/fs/fs-test.sh @@ -293,6 +293,12 @@ ${PREFIX}l

[U-Boot] [PATCH v2 0/5] Enhance fs tests

2016-09-13 Thread Stefan Brüns
e in cleanup Added: test/fs: remove use of undefined WRITE_FILE variable test/fs: strip noise from filesystem code prior to checking results Stefan Brüns (5): test/fs: Restructure file path specification to allow some flexibility test/fs: remove use of undefined WRITE_FILE variable

[U-Boot] [PATCH v2 2/5] test/fs: remove use of undefined WRITE_FILE variable

2016-09-13 Thread Stefan Brüns
The write file is created from $SMALL_FILE by appending ".w" on all other occurences in the code. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/fs/fs-test

[U-Boot] [PATCH 4/4] cmd/fat: Do not crash on write when is not specified

2016-09-11 Thread Stefan Brüns
argc is checked, but is off by one. In case is not specified, create an empty file, which is identical to the ext4write behaviour. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- cmd/fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/fat.c

[U-Boot] [PATCH 3/4] fs/fat: Correct description of determine_fatent function

2016-09-11 Thread Stefan Brüns
Current description does not match the function behaviour. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/fat/fat_write.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c index babe9c8..0583af3 100644 --- a/

[U-Boot] [PATCH 2/4] fs/fat: Do not write unmodified fat entries to disk

2016-09-11 Thread Stefan Brüns
the on-disk blocks. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/fat/fat.c | 1 + fs/fat/fat_write.c | 31 +++ include/fat.h | 1 + 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 8

[U-Boot] [PATCH 1/4] fs/fat: Remove two statements without effect

2016-09-11 Thread Stefan Brüns
fatlength is a local variable which is no more used after the assignment. s_name is not used in the function, save the strncpy. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/fat/fat_write.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/

[U-Boot] [PATCH 0/4] Fat filesystem enhancements

2016-09-11 Thread Stefan Brüns
Start cleanup of fat filesystem. Stefan Brüns (4): fs/fat: Remove two statements without effect fs/fat: Do not write unmodified fat entries to disk fs/fat: Correct description of determine_fatent function cmd/fat: Do not crash on write when is not specified cmd/fat.c | 4

[U-Boot] [PATCH 0/3] Enhance fs tests

2016-09-11 Thread Stefan Brüns
Test for two corner cases in ext4 directory traversal. Stefan Brüns (3): test/fs: Restructure file path specification to allow some flexibility test/fs: Check ext4 behaviour if dirent is first entry in directory block test/fs: Check writes using "." (same dir) relative path

[U-Boot] [PATCH 1/3] test/fs: Restructure file path specification to allow some flexibility

2016-09-11 Thread Stefan Brüns
Instead of providing the full path, specify directory and filename separately. This allows to specify intermediate directories, required for some additional tests. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.s

[U-Boot] [PATCH 3/3] test/fs: Check writes using "." (same dir) relative path

2016-09-11 Thread Stefan Brüns
/ and /./ should reference the same file. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 27 +++ 1 file changed, 27 insertions(+) diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh index cb2a765..46975ec 100755 --- a/test

[U-Boot] [PATCH 2/3] test/fs: Check ext4 behaviour if dirent is first entry in directory block

2016-09-11 Thread Stefan Brüns
Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- test/fs/fs-test.sh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh index 12450ed..cb2a765 100755 --- a/test/fs/fs-test.sh +++ b/test/fs/fs-test.sh @@ -291,6 +291,12 @@ ${PREFIX}l

[U-Boot] [PATCH v5 07/16] ext4: Only update number of of unused inodes if GDT_CSUM feature is set

2016-09-05 Thread Stefan Brüns
e2fsck warns about "Group descriptor 0 marked uninitialized without feature set." The bg_itable_unused field is only defined if FEATURE_RO_COMPAT_GDT_CSUM is set, and should be set (kept) zero otherwise. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by:

[U-Boot] [PATCH v5 10/16] ext4: Avoid out-of-bounds access of block bitmap

2016-09-05 Thread Stefan Brüns
ion will be done. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/ext4_common.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/fs/ext4/ext4_common.c b/fs/ext

[U-Boot] [PATCH v5 15/16] ext4: Correct block number handling, empty block vs. error code

2016-09-05 Thread Stefan Brüns
img ; ext4write host 0 0 /2.5GB.file 1 ' The 2.5GB.file from the fs test is actually a sparse file. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_common.c | 6 +++--- fs/ext4/ext4_write.c | 11 ++- 2 files changed, 13 insertions(+), 4 deletions(-) d

[U-Boot] [PATCH v5 14/16] ext4: remove duplicated block release code for extents

2016-09-05 Thread Stefan Brüns
blocks. Actually the code to release the extent tree index blocks is still missing, but at least add a FIXME at the appropriate place. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_write.c | 110 --- 1 file chang

[U-Boot] [PATCH v5 03/16] ext4: Do not crash when trying to grow a directory using extents

2016-09-05 Thread Stefan Brüns
before pushing garbage to the disk. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/ext4_common.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_co

[U-Boot] [PATCH v5 05/16] ext4: Avoid corruption of directories with hash tree indexes

2016-09-05 Thread Stefan Brüns
While directories can be read using the old linear scan method, adding a new file would require updating the index tree (alternatively, the whole tree could be removed). Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com>

[U-Boot] [PATCH v5 13/16] ext4: initialize full inode for inodes bigger than 128 bytes

2016-09-05 Thread Stefan Brüns
Make sure the the extra_isize field (offset 128) is initialized to 0, to mark any extra data as invalid. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/ext4_write.c | 10 -- 1 file changed, 4 inse

[U-Boot] [PATCH v5 04/16] ext4: Scan all directory blocks for space when inserting a new entry

2016-09-05 Thread Stefan Brüns
blocks, as the old code does. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/ext4_common.c | 74 +-- 1 file changed, 30 insertions(+), 44 deletions(-) dif

[U-Boot] [PATCH v5 16/16] ext4: Fix memory leak of journal buffer if block is updated multiple times

2016-09-05 Thread Stefan Brüns
If the same block is updated multiple times in a row during a single file system operation, gd_index is decremented to use the same journal entry again. Avoid loosing the already allocated buffer. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> --- fs/ext4/ext4_journal.c | 6 +++

[U-Boot] [PATCH v5 00/16] Fix several possible crashes/corruptions in ext4

2016-09-05 Thread Stefan Brüns
. Revieved-by has been added as appropriate. Stefan Brüns (16): ext4: fix possible crash on directory traversal, ignore deleted entries ext4: propagate error if creation of directory entry fails ext4: Do not crash when trying to grow a directory using extents ext4: Scan all directory blocks

[U-Boot] [PATCH v5 09/16] ext4: After completely filled group, scan next group from the beginning

2016-09-05 Thread Stefan Brüns
and 16296-16297 -- 8103 + 1 + 8192 = 16296. This can be shown with debugfs, commands 'ffb' and 'stat X240'. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/ext4_common.c | 8 +--- 1 file changed, 5 insertions(+),

[U-Boot] [PATCH v5 11/16] ext4: Fix memory leak in case of failure

2016-09-05 Thread Stefan Brüns
temp_ptr should always be freed, even if the function is left via goto fail. Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/ext4_write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

[U-Boot] [PATCH v5 08/16] ext4: Do not clear zalloc'ed buffers a second time

2016-09-05 Thread Stefan Brüns
zero_buffer is never written, thus clearing it is pointless. journal_buffer is completely initialized by ext4fs_devread (or in case of failure, not used). Signed-off-by: Stefan Brüns <stefan.bru...@rwth-aachen.de> Reviewed-by: Lukasz Majewski <l.majew...@samsung.com> --- fs/ext4/e

  1   2   >