From: Miquel Raynal <miquel.raynal@bootlin.com>
To: u-boot@lists.denx.de
Subject: [PATCH 1/1] fs/squashfs: zero out unused fields in fs_dirent
Date: Mon, 17 May 2021 09:10:36 +0200 [thread overview]
Message-ID: <20210517091036.25768ba8@xps13> (raw)
In-Reply-To: <20210517062139.101617-1-xypron.glpk@gmx.de>
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
next prev parent reply other threads:[~2021-05-17 7:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2021-05-27 11:42 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210517091036.25768ba8@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox