From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Hal Rosenstock
<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Daniel Micay
<danielmicay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
"Kalderon,
Michal" <Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
Ariel Elior <Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
Bart Van Assche
<bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>,
Parav Pandit <parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Noa Osherovich <noaos-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] infiniband: avoid overflow warning
Date: Fri, 18 Aug 2017 12:40:05 -0400 [thread overview]
Message-ID: <1503074405.2598.25.camel@redhat.com> (raw)
In-Reply-To: <20170731065016.2947796-1-arnd-r2nGTMty4D4@public.gmane.org>
On Mon, 2017-07-31 at 08:50 +0200, Arnd Bergmann wrote:
> A sockaddr_in structure on the stack getting passed into rdma_ip2gid
> triggers this warning, since we memcpy into a larger sockaddr_in6
> structure:
>
> In function 'memcpy',
> inlined from 'rdma_ip2gid' at include/rdma/ib_addr.h:175:3,
> inlined from 'addr_event.isra.4.constprop' at
> drivers/infiniband/core/roce_gid_mgmt.c:693:2,
> inlined from 'inetaddr_event' at
> drivers/infiniband/core/roce_gid_mgmt.c:716:9:
> include/linux/string.h:305:4: error: call to '__read_overflow2'
> declared with attribute error: detected read beyond size of object
> passed as 2nd parameter
>
> The warning seems appropriate here, but the code is also clearly
> correct, so we really just want to shut up this instance of the
> output.
>
> The best way I found so far is to avoid the memcpy() call and instead
> replace it with a struct assignment.
>
> Fixes: 6974f0c4555e ("include/linux/string.h: add the option of
> fortified string.h functions")
> Cc: Daniel Micay <danielmicay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Kees Cook <keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Signed-off-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Thanks, applied.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-08-18 16:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-31 6:50 [PATCH] infiniband: avoid overflow warning Arnd Bergmann
[not found] ` <20170731065016.2947796-1-arnd-r2nGTMty4D4@public.gmane.org>
2017-07-31 7:08 ` Moni Shoua
[not found] ` <CAG9sBKNaFTAuf2gL9QLOCwvH-xAq7SXfaMZxNMFo7d=6cH3TkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 7:30 ` Arnd Bergmann
[not found] ` <CAK8P3a2AP7WSF2HUe_4nxsNFqCit_djKdd3_5ab6P1YgP7bvJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 15:32 ` Bart Van Assche
[not found] ` <1501515117.2466.9.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-31 16:04 ` Arnd Bergmann
[not found] ` <CAK8P3a1r22C-Uxs93OSbS4_eRNhKUTv8xwc6wwGahE80whCjyA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 16:17 ` Bart Van Assche
[not found] ` <1501517853.2466.12.camel-Sjgp3cTcYWE@public.gmane.org>
2017-07-31 19:19 ` Arnd Bergmann
2017-07-31 19:35 ` Daniel Micay
2017-07-31 20:58 ` Kees Cook
[not found] ` <CAGXu5jJ66RY05M=sYZeAMVPEtpneOKyBN2CSNsrewj4EREeu+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 21:10 ` Arnd Bergmann
[not found] ` <CAK8P3a045_-89OQk+qG7odJ2NeeObq6QaKXccsaC_jOJxfYbfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 21:18 ` Kees Cook
[not found] ` <CAGXu5j+EPe7csgFt5SnDoobQWkOGH5qaoSZ=QMHHoGFFsMV45Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 21:37 ` Daniel Micay
2017-07-31 21:52 ` Arnd Bergmann
[not found] ` <CAK8P3a3q9d1_WU9hknhy5wH8_f26S3EUr=U1fu5=YL+3TmhBEw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-31 22:06 ` Kees Cook
2017-08-18 16:40 ` Doug Ledford [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=1503074405.2598.25.camel@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=Ariel.Elior-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=Michal.Kalderon-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
--cc=danielmicay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=keescook-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=noaos-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=parav-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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