From: Richard Weinberger <richard@sigma-star.at>
To: u-boot@lists.denx.de, upstream@sigma-star.at
Cc: Richard Weinberger <richard@nod.at>,
ilias.apalodimas@linaro.org, sjg@chromium.org,
christian.taedcke@weidmueller.com, trini@konsulko.com,
upstream+uboot@sigma-star.at,
Heinrich Schuchardt <xypron.glpk@gmx.de>
Subject: Re: [PATCH] fat: fat2rtc: Sanitize timestamps
Date: Fri, 12 Jul 2024 11:51:06 +0200 [thread overview]
Message-ID: <2549250.Sgy9Pd6rRy@somecomputer> (raw)
In-Reply-To: <E6A299D7-6DA8-4FA7-8864-BB6F346B4394@gmx.de>
Am Freitag, 12. Juli 2024, 11:46:08 CEST schrieb 'Heinrich Schuchardt' via upstream:
> Am 12. Juli 2024 10:24:54 MESZ schrieb Richard Weinberger <richard@nod.at>:
> >Make sure that tm_mday and tm_mon are within the expected
> >range. Upper layers such as rtc_calc_weekday() will use
> >them as lookup keys for arrays and this can cause out of
> >bounds memory accesses.
>
> rtc_calc_weekday() might receive invalid input from other sources. Shouldn't the function always validate its input before array access?
It depends on the overall design.
Functions like strlen() also assume that you provide a valid string,
so rtc_calc_weekday() can assume too that the passed rtc_time structure contains valid data.
In doubt, let's fix both FAT and rtc_calc_weekday().
Thanks,
//richard
--
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y
next prev parent reply other threads:[~2024-07-12 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 8:24 [PATCH] fat: fat2rtc: Sanitize timestamps Richard Weinberger
2024-07-12 9:46 ` Heinrich Schuchardt
2024-07-12 9:51 ` Richard Weinberger [this message]
2024-07-12 11:55 ` Heinrich Schuchardt
2024-07-12 16:56 ` 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=2549250.Sgy9Pd6rRy@somecomputer \
--to=richard@sigma-star.at \
--cc=christian.taedcke@weidmueller.com \
--cc=ilias.apalodimas@linaro.org \
--cc=richard@nod.at \
--cc=sjg@chromium.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=upstream+uboot@sigma-star.at \
--cc=upstream@sigma-star.at \
--cc=xypron.glpk@gmx.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 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.