linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Biju Das <biju.das@bp.renesas.com>,
	Simon Horman <horms@verge.net.au>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Chris Paterson <Chris.Paterson2@renesas.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Fabrizio Castro <fabrizio.castro@bp.renesas.com>,
	linux-rtc@vger.kernel.org,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH v3] nvmem: check invalid number of bytes in nvmem_{read,write}()
Date: Tue, 11 Dec 2018 12:27:49 +0100	[thread overview]
Message-ID: <CAMuHMdWjRBCeNq7ZiCPd3xWC=S9gLO=-EfQ1WWN711LT+w=CzQ@mail.gmail.com> (raw)
In-Reply-To: <43b3a03c-3739-94d2-c97d-c36999f04a9b@linaro.org>

Hi Srinivas,

On Tue, Dec 11, 2018 at 12:10 PM Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
> On 11/12/18 11:06, Geert Uytterhoeven wrote:
> >> I was trying with arm32 toolchain and compiler happy. Now tried with Arm64 toolchain, it provides a warning and the below typecast fixed the issue.
> >> if (unlikely(check_add_overflow(bytes, (size_t)offset, &new_bytes)))
> >>
> >> Does typecasting to (size_t)  fixed the issue in your environment? Please let  me know.
> > That's a side-effect of offset not being loff_t...
> check_add_overflow will expect all the params to be of same type, so
> changing to loff_t will not help too.

Right, it has separate checks for signed/unsigned additions, but
both parameter types must have the same signedness, too.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

      reply	other threads:[~2018-12-11 11:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11  9:24 [PATCH v3] nvmem: check invalid number of bytes in nvmem_{read,write}() Biju Das
2018-12-11  9:55 ` Srinivas Kandagatla
2018-12-11 10:54   ` Biju Das
2018-12-11 11:06     ` Geert Uytterhoeven
2018-12-11 11:10       ` Srinivas Kandagatla
2018-12-11 11:27         ` Geert Uytterhoeven [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='CAMuHMdWjRBCeNq7ZiCPd3xWC=S9gLO=-EfQ1WWN711LT+w=CzQ@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=Chris.Paterson2@renesas.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=biju.das@bp.renesas.com \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).