On Mon, Feb 4, 2019 at 5:57 AM Sascha Hauer wrote:
>
> On Mon, Jan 28, 2019 at 10:55:47PM -0800, Andrey Smirnov wrote:
> > Codepaths using memmap() in md.c don't do any boundary checks, so it
> > can be easily made to read past the underlying file's
> > boundary. For example on i.MX8MQ based board
ftruncate needs to set errno correctly on error.
Signed-off-by: Sascha Hauer
---
fs/fs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/fs.c b/fs/fs.c
index 4ec9c7a842..c5b17e158a 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -216,8 +216,10 @@ int ftruncate(int fd, loff_t leng
When a cdev doesn't have a truncate callback then forbid truncation
and fail with -EPERM.
Before this we had always failed with -ENOSPC in this situation.
We checked for f->fsdev->dev.num_resources being nonzero, but this
check was absolutely meaningless. It goes back to ancient times when
the reso
This series ontop of Andreys series (minus the patches that I have
reverted) makes /dev/mem work for the whole 64bit address space without
hopefully special casing too much. "fs: set errno in ftruncate()" and
"fs: devfs: forbid truncation when cdev has no truncate operation" are
not directly relate
The size of /dev/mem was limited to the lower half of the 64bit address
range. This is unfortunate since on some architectures (MIPS64, namely)
the upper half contains meaningful addresses. We can't just set /dev/mem
to its real size since that's bigger than the maximum loff_t. Set the
DEVFS_IS_CHA
loff_t is the correct type for file sizes. Use it to allow to truncate
to sizes bigger than 32bit.
Signed-off-by: Sascha Hauer
---
fs/devfs.c | 2 +-
fs/efi.c | 2 +-
fs/efivarfs.c| 2 +-
fs/fat/fat.c | 2 +-
fs/nfs.c | 2 +-
fs/omap4_usbbootfs.c
open_and_lseek() increases the file size when the file is opened in
write mode and scrolled past the files end. This fails badly on /dev/mem
because loff_t which we use for the file size is signed variable, which
is used as an unsigned variable in /dev/mem. To catch this case do not
try to truncate
On Mon, Jan 28, 2019 at 10:55:40PM -0800, Andrey Smirnov wrote:
> Returning requested offset from .lseek() callback doesn't really give
> us any new information while bringing unnecessary
> complications. Change all .lseek() types (both in struct struct
> cdev_operations and in struct fs_driver_d)
On Mon, Jan 28, 2019 at 10:55:47PM -0800, Andrey Smirnov wrote:
> Codepaths using memmap() in md.c don't do any boundary checks, so it
> can be easily made to read past the underlying file's
> boundary. For example on i.MX8MQ based board with 4GiB or RAM we get:
>
> md -b -s /dev/ram0 0xfff0
>
Recent DTS update brought in switch to the new PMC clock
bindings, however we do not support that yet. Revert this
change until PMC clock bindings support is implemented.
Fixes: 33fdc89d4cbd ("dts: update to v5.0-rc1")
Signed-off-by: Ladislav Michl
---
Disclaimer: Runtime tested only on at91sam9
Hello friends,
I'm trying to modify DT dynamically while Barebox is running, but it
doesn't work the way I expect. E.g. I use of_delete_node(), but `of_dump`
shows all nodes that are expected to be deleted, so the corresponding
devices are available both from Barebox and Linux.
So is there any w
11 matches
Mail list logo