* [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent
@ 2021-05-17 6:21 Heinrich Schuchardt
2021-05-17 7:10 ` Miquel Raynal
2021-05-27 11:42 ` Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2021-05-17 6:21 UTC (permalink / raw
To: u-boot
When reading directories the UEFI sub-system must supply file attributes
and timestamps. These fields will have to be added to struct fs_dirent.
SquashFS should not fill these fields with random data. Ensure that they
are zeroed out.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
fs/squashfs/sqfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 29805c3c6f..997be2dcf4 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -876,7 +876,7 @@ int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
char **token_list = NULL, *path = NULL;
u32 *pos_list = NULL;
- dirs = malloc(sizeof(*dirs));
+ dirs = calloc(1, sizeof(*dirs));
if (!dirs)
return -EINVAL;
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent
2021-05-17 6:21 [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent Heinrich Schuchardt
@ 2021-05-17 7:10 ` Miquel Raynal
2021-05-27 11:42 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Miquel Raynal @ 2021-05-17 7:10 UTC (permalink / raw
To: u-boot
Hi Heinrich,
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote on Mon, 17 May 2021
08:21:39 +0200:
> When reading directories the UEFI sub-system must supply file attributes
> and timestamps. These fields will have to be added to struct fs_dirent.
> SquashFS should not fill these fields with random data. Ensure that they
> are zeroed out.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> fs/squashfs/sqfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
> index 29805c3c6f..997be2dcf4 100644
> --- a/fs/squashfs/sqfs.c
> +++ b/fs/squashfs/sqfs.c
> @@ -876,7 +876,7 @@ int sqfs_opendir(const char *filename, struct fs_dir_stream **dirsp)
> char **token_list = NULL, *path = NULL;
> u32 *pos_list = NULL;
>
> - dirs = malloc(sizeof(*dirs));
> + dirs = calloc(1, sizeof(*dirs));
> if (!dirs)
> return -EINVAL;
>
> --
> 2.30.2
>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miqu?l
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent
2021-05-17 6:21 [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent Heinrich Schuchardt
2021-05-17 7:10 ` Miquel Raynal
@ 2021-05-27 11:42 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2021-05-27 11:42 UTC (permalink / raw
To: Heinrich Schuchardt
Cc: Joao Marcos Costa, Thomas Petazzoni, Miquel Raynal, u-boot
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
On Mon, May 17, 2021 at 08:21:39AM +0200, Heinrich Schuchardt wrote:
> When reading directories the UEFI sub-system must supply file attributes
> and timestamps. These fields will have to be added to struct fs_dirent.
> SquashFS should not fill these fields with random data. Ensure that they
> are zeroed out.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-27 11:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-17 6:21 [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent Heinrich Schuchardt
2021-05-17 7:10 ` Miquel Raynal
2021-05-27 11:42 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.