| fb4a3554 | 10-Jul-2022 |
Pali Rohár <pali@kernel.org> |
UPSTREAM: ubifs: Use U-Boot assert() from <log.h> in UBI/UBIFS code
U-Boot already provides assert function, so it use also in ubi and ubifs code.
Change-Id: Ia88ff21d19ef155fd3e97c62f4b31bad1c8f78
UPSTREAM: ubifs: Use U-Boot assert() from <log.h> in UBI/UBIFS code
U-Boot already provides assert function, so it use also in ubi and ubifs code.
Change-Id: Ia88ff21d19ef155fd3e97c62f4b31bad1c8f78f5 Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit e2e6caa01ba97bcdb82100c6b928b5743e3aae6c)
show more ...
|
| 1ac561a7 | 10-Jul-2022 |
Pali Rohár <pali@kernel.org> |
UPSTREAM: ubifs: Fix ubifs_assert_cmt_locked()
U-Boot does not implement down_write_trylock() and its stub always returns true that lock was acquired. Therefore ubifs_assert_cmt_locked() assert curr
UPSTREAM: ubifs: Fix ubifs_assert_cmt_locked()
U-Boot does not implement down_write_trylock() and its stub always returns true that lock was acquired. Therefore ubifs_assert_cmt_locked() assert currently always fails.
Fix this issue by redefining ubifs_assert_cmt_locked() to just empty stub as there is nothing to assert.
Change-Id: I8daa938645cd75d0eb4269ff0994163a02c3ff13 Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit b4f210563e63e5d4b73e3232fd7156424533063e)
show more ...
|
| 410b6a2c | 30-May-2022 |
Pali Rohár <pali@kernel.org> |
UPSTREAM: ubifs: Fix reference count leak in ubifsumount
Original ubifs code was designed that after ubifs_umount() call it is required to also call ubi_close_volume() which closes underlying UBI vo
UPSTREAM: ubifs: Fix reference count leak in ubifsumount
Original ubifs code was designed that after ubifs_umount() call it is required to also call ubi_close_volume() which closes underlying UBI volume. But U-Boot ubifs modification have not implemented it properly which caused that ubifsumount command contains resource leak. It can be observed by calling simple sequence of commands:
=> ubi part mtd2 ubi0: attaching mtd2 ... => ubifsmount ubi0 => ubifsumount Unmounting UBIFS volume rootfs! => ubi detach ubi0 error: ubi_detach_mtd_dev: ubi0 reference count 1, destroy anyway ubi0: detaching mtd2 ubi0: mtd2 is detached
Fix this issue by calling ubi_close_volume() and mutex_unlock() in directly in ubifs_umount() function before freeing U-Boot's global ubifs_sb. And remove duplicate calls of these two functions in remaining places. Note that when ubifs_umount() is not called then during error handling is still needed to call ubi_close_volume() and mutex_unlock.
With this change ubifsumount command does not throw that error anymore:
=> ubi part rootfs ubi0: attaching mtd2 ... => ubifsmount ubi0 => ubifsumount Unmounting UBIFS volume rootfs! => ubi detach ubi0: detaching mtd2 ubi0: mtd2 is detached
Change-Id: I8f5400dbdb98374e3f5a6bce82a5f53e5ecb89bc Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 69ca709d0fb001851f443b0b744c6d65bb6c22c1)
show more ...
|
| 255bb283 | 17-May-2022 |
Pali Rohár <pali@kernel.org> |
UPSTREAM: ubifs: Fix lockup/crash when reading files
Commit b1a14f8a1c2e ("UBIFS: Change ubifsload to not read beyond the requested size") added optimization to do not read more bytes than it is rea
UPSTREAM: ubifs: Fix lockup/crash when reading files
Commit b1a14f8a1c2e ("UBIFS: Change ubifsload to not read beyond the requested size") added optimization to do not read more bytes than it is really needed. But this commit introduced incorrect handling of the hole at the end of file. This logic cause U-Boot to crash or lockup when trying to read from the ubifs filesystem.
When read_block() call returns -ENOENT error (not an error, but the hole) then dn-> structure is not filled and contain garbage. So using of dn->size for memcpy() argument cause that U-Boot tries to copy unspecified amount of bytes from possible unmapped memory. Which randomly cause lockup of P2020 CPU.
Fix this issue by copying UBIFS_BLOCK_SIZE bytes from read buffer when dn->size is not available. UBIFS_BLOCK_SIZE is the size of the buffer itself and read_block() fills buffer by zeros when it returns -ENOENT.
This patch fixes ubifsload on P2020.
Fixes: b1a14f8a1c2e ("UBIFS: Change ubifsload to not read beyond the requested size") Change-Id: I361a8cae545d40475bb540b9ae92f4c04cce484d Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 339f652992919be11e3f1b791515140de646a3ef)
show more ...
|
| 983b77b8 | 28-Mar-2022 |
Ville Baillie <villeb@bytesnap.co.uk> |
UPSTREAM: ubifs: Fix journal replay wrt. xattr nodes
Backport commit 1cb51a15b576 ("ubifs: Fix journal replay wrt. xattr nodes") from the Linux Kernel, which has the following Signed-off-by line: Ch
UPSTREAM: ubifs: Fix journal replay wrt. xattr nodes
Backport commit 1cb51a15b576 ("ubifs: Fix journal replay wrt. xattr nodes") from the Linux Kernel, which has the following Signed-off-by line: Change-Id: Ib379b76f9617aa0e75d8dd49fdc1ac7ea09f4fe5 Signed-off-by: Richard Weinberger <richard@nod.at>
For U-Boot, after comapring with the upstream commit: Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 749c6a6275a201007d7fd53de63b21cdf108eebf) Change-Id: I1c107989ccff2e3e6f3ff7e5cb4ffe7b974cada3
show more ...
|
| 8b098ddb | 25-Dec-2020 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
UPSTREAM: ubifs: do not decide upon uninitialized variable
Before 'if (err)' we have to initialize the variable otherwise we use a random value from the stack.
Change-Id: I3cca8db88ae7e5f5976e52a8f
UPSTREAM: ubifs: do not decide upon uninitialized variable
Before 'if (err)' we have to initialize the variable otherwise we use a random value from the stack.
Change-Id: I3cca8db88ae7e5f5976e52a8ffbda70a3027c032 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 81f562719e475b0e13ff7a0201cae19f8cc367fe)
show more ...
|
| f0ae2c10 | 27-Jun-2018 |
Christophe Kerello <christophe.kerello@st.com> |
UPSTREAM: ubifs: remove useless code
By checking ubifs source code, s_instances parameter is not used anymore. So, set this parameter and the associated source code under __UBOOT__ compilation.
Cha
UPSTREAM: ubifs: remove useless code
By checking ubifs source code, s_instances parameter is not used anymore. So, set this parameter and the associated source code under __UBOOT__ compilation.
Change-Id: I0f51242a76c8de3ab258f1b5d8f75f542be176c0 Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 5a08cfee3967d6e8174d7de135af1daa8e4aea00)
show more ...
|
| 6dd3ad81 | 05-Nov-2018 |
Paul Davey <paul.davey@alliedtelesis.co.nz> |
UPSTREAM: fs: ubifs: Fix UBIFS decompression on 64 bit
Add local size_t variable to crypto_comp_decompress as intermediate storage for destination length to avoid memory corruption and incorrect res
UPSTREAM: fs: ubifs: Fix UBIFS decompression on 64 bit
Add local size_t variable to crypto_comp_decompress as intermediate storage for destination length to avoid memory corruption and incorrect results on 64 bit targets.
This is what linux does for the various lz compression implementations.
Change-Id: I8a2de3ff31824f0574370225240fdcf6ef76967d Signed-off-by: Paul Davey <paul.davey@alliedtelesis.co.nz> Cc: Heiko Schocher <hs@denx.de> Tested-by: Heiko Schocher <hs@denx.de> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit e4aa10ba5770fc391bf8a4b00c131353901704e7)
show more ...
|
| c0088914 | 09-Aug-2018 |
Stefan Roese <sr@denx.de> |
UPSTREAM: fs: ubifs: Add missing newlines in super.c
I just stumbled over some cluttered UBIFS messages. It seems some newline chars are missing in the current U-Boot UBI source.
Change-Id: I3537f8
UPSTREAM: fs: ubifs: Add missing newlines in super.c
I just stumbled over some cluttered UBIFS messages. It seems some newline chars are missing in the current U-Boot UBI source.
Change-Id: I3537f8149a6539a889f17110a7b3b1b7ffd905f2 Signed-off-by: Stefan Roese <sr@denx.de> Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 7236e24bc4366e166b9f5f5e156f7b64cdb64949)
show more ...
|
| 3430bfce | 04-Apr-2018 |
Bradley Bolen <bradleybolen@gmail.com> |
UPSTREAM: ubifs: Change value of mutex_is_locked()
The mutex lock and unlock functions are stubbed out and mutex_is_locked was 0. This caused asserts to fail in ubifs code when checking that the mu
UPSTREAM: ubifs: Change value of mutex_is_locked()
The mutex lock and unlock functions are stubbed out and mutex_is_locked was 0. This caused asserts to fail in ubifs code when checking that the mutex was locked. For example,
UBIFS assert failed in ubifs_change_lp at 540 UBIFS assert failed in ubifs_release_lprops at 278
Assume that the "mutex" is locked since that is the normal case when it is checked in the ubifs code.
Change-Id: I422de1a01ee7110febbd33573aafa190d2df1d96 Signed-off-by: Bradley Bolen <bradleybolen@gmail.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 05ea83b67ed7861c1693187dbf3a2613601c1b15)
show more ...
|
| e903c1bb | 24-Mar-2018 |
Petr Vorel <petr.vorel@gmail.com> |
UPSTREAM: ubifs: Reintroduce using CONFIG_UBIFS_SILENCE_MSG
Use of CONFIG_UBIFS_SILENCE_MSG was added in 147162dac6 ("ubi: ubifs: Turn off verbose prints")
Then it was removed in ff94bc40af ("mtd,
UPSTREAM: ubifs: Reintroduce using CONFIG_UBIFS_SILENCE_MSG
Use of CONFIG_UBIFS_SILENCE_MSG was added in 147162dac6 ("ubi: ubifs: Turn off verbose prints")
Then it was removed in ff94bc40af ("mtd, ubi, ubifs: resync with Linux-3.14")
Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Heiko Schocher <hs@denx.de> Change-Id: I84bf2147134ee48551a5a539f09b3202033d7ca2 Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit e9951281585060a7ba9d9826e286ff3e7ed067bb)
show more ...
|
| 458520ad | 08-Nov-2017 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
UPSTREAM: ubifs: no NULL check needed before free
kfree() calls free. free() checks if the parameter is NULL.
Change-Id: I77522f68451bac8c2e5db627a65ee179cb6ab0a9 Signed-off-by: Heinrich Schuchardt
UPSTREAM: ubifs: no NULL check needed before free
kfree() calls free. free() checks if the parameter is NULL.
Change-Id: I77522f68451bac8c2e5db627a65ee179cb6ab0a9 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit 4b29975fd0f25256d8e643076a2c4c5f9de00f8f)
show more ...
|
| 635356e5 | 30-Sep-2017 |
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> |
UPSTREAM: fs/fat: Check malloc return values and fix memory leaks
Check malloc() return values and properly unwind on errors so memory allocated for fat_itr structures get freed properly.
Also fixe
UPSTREAM: fs/fat: Check malloc return values and fix memory leaks
Check malloc() return values and properly unwind on errors so memory allocated for fat_itr structures get freed properly.
Also fixes a leak of fsdata.fatbuf in fat_size().
Fixes: 2460098cffacd1 ("fs/fat: Reduce stack usage") Change-Id: If2abd822a136b40375f6b0052c88c0d9deb3a632 Reported-by: Coverity (CID: 167225, 167233, 167234) Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit af609e3764ea3ed7c0ccad8e57f9d9671c81c3e8)
show more ...
|
| 86597fe0 | 30-Sep-2017 |
Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> |
UPSTREAM: fs/fat: Fix 'CACHE: Misaligned operation at range' warnings
The 'block' field of fat_itr needs to be properly aligned for DMA and while it does have '__aligned(ARCH_DMA_MINALIGN)', the fat
UPSTREAM: fs/fat: Fix 'CACHE: Misaligned operation at range' warnings
The 'block' field of fat_itr needs to be properly aligned for DMA and while it does have '__aligned(ARCH_DMA_MINALIGN)', the fat_itr structure itself needs to be properly aligned as well.
While at it use malloc_cache_aligned() for the other aligned allocations in the file as well.
Fixes: 2460098cffacd1 ("fs/fat: Reduce stack usage") Change-Id: I0b7bfe73d00435d8ec3dcd7f52a10deca07a704e Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 09fa964bba80c45432660f0e64362181900a5aef)
show more ...
|