From: David Marchand <david.marchand@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev <dev@dpdk.org>, dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] eal: fix unitialized data warning
Date: Fri, 29 Nov 2019 09:25:15 +0100 [thread overview]
Message-ID: <CAJFAV8wU1fmJu5zF5qJTPnAABpA-aQiXBjTP65-9+41a7fv7Tw@mail.gmail.com> (raw)
In-Reply-To: <20191127223232.26404-1-stephen@networkplumber.org>
On Wed, Nov 27, 2019 at 11:32 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Valgrind reports that eal interrupt thread is calling epoll_ctl
> with uninitialized data. Trivial to fix by initializing it.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/librte_eal/linux/eal/eal_interrupts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/linux/eal/eal_interrupts.c
> index 1955324d3045..2cd537ba4492 100644
> --- a/lib/librte_eal/linux/eal/eal_interrupts.c
> +++ b/lib/librte_eal/linux/eal/eal_interrupts.c
> @@ -1045,7 +1045,7 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)
> static __attribute__((noreturn)) void *
> eal_intr_thread_main(__rte_unused void *arg)
> {
> - struct epoll_event ev;
> + struct epoll_event ev = { };
>
> /* host thread, never break out */
> for (;;) {
typedef union epoll_data
{
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
struct epoll_event
{
uint32_t events; /* Epoll events */
epoll_data_t data; /* User data variable */
} __EPOLL_PACKED;
static __attribute__((noreturn)) void *
eal_intr_thread_main(__rte_unused void *arg)
{
struct epoll_event ev;
[...]
ev.events = EPOLLIN | EPOLLPRI | EPOLLRDHUP | EPOLLHUP;
ev.data.fd = src->intr_handle.fd;
[...]
if (epoll_ctl(pfd, EPOLL_CTL_ADD,
src->intr_handle.fd, &ev) < 0){
So the uninitialised part is because we only set an int in the union.
False positive from valgrind, but the fix is quite simple.
Acked-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
next prev parent reply other threads:[~2019-11-29 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 22:32 Stephen Hemminger
2019-11-29 8:25 ` David Marchand [this message]
2019-11-29 17:02 ` Stephen Hemminger
2019-12-04 11:12 ` David Marchand
2019-12-04 12:17 ` [dpdk-stable] [dpdk-dev] " Andrew Rybchenko
2019-12-04 12:31 ` David Marchand
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=CAJFAV8wU1fmJu5zF5qJTPnAABpA-aQiXBjTP65-9+41a7fv7Tw@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.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).