From: Richard Weinberger <richard@nod.at>
To: chengzhihao1 <chengzhihao1@huawei.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
George Kennedy <george.kennedy@oracle.com>,
linux-mtd <linux-mtd@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
yi zhang <yi.zhang@huawei.com>
Subject: Re: [PATCH v2] ubi: Fix failure attaching when vid_hdr offset equals to (sub)page size
Date: Sat, 4 Mar 2023 18:11:10 +0100 (CET) [thread overview]
Message-ID: <272361861.203885.1677949870976.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <20230304074243.1348767-1-chengzhihao1@huawei.com>
----- Ursprüngliche Mail -----
> Von: "chengzhihao1" <chengzhihao1@huawei.com>
> + /*
> + * Memory allocation for VID header is ubi->vid_hdr_alsize
> + * which is described in comments in io.c.
> + * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds
> + * ubi->vid_hdr_alsize, so that all vid header operations
> + * won't access memory out of bounds.
> + */
> + if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) {
> + ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)"
> + " + VID header size(%d) > VID header aligned size(%d).",
> + ubi->vid_hdr_offset, ubi->vid_hdr_shift,
> + (int)UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize);
Hmm, why are you casting to int instead of using %zu as format string?
Thanks,
//richard
prev parent reply other threads:[~2023-03-04 17:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 7:42 Zhihao Cheng
2023-03-04 17:11 ` Richard Weinberger [this message]
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=272361861.203885.1677949870976.JavaMail.zimbra@nod.at \
--to=richard@nod.at \
--cc=chengzhihao1@huawei.com \
--cc=george.kennedy@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=s.hauer@pengutronix.de \
--cc=yi.zhang@huawei.com \
/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
all inboxes | Powered by JetHome®