From: Jason Wang <jasowang@redhat.com>
To: P J P <ppandit@redhat.com>
Cc: "Stefan Hajnoczi" <stefanha@gmail.com>,
"Sven Schnelle" <svens@stackframe.org>,
"Qemu Developers" <qemu-devel@nongnu.org>,
"Li Qiang" <pangpei.lq@antfin.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Ziming Zhang" <ezrakiez@gmail.com>
Subject: Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access
Date: Mon, 23 Mar 2020 18:28:48 +0800 [thread overview]
Message-ID: <739d25c4-4fd7-2650-a236-902eed1a6eed@redhat.com> (raw)
In-Reply-To: <nycvar.YSQ.7.76.2003231056520.5086@xnncv>
On 2020/3/23 下午1:40, P J P wrote:
> +-- On Mon, 23 Mar 2020, P J P wrote --+
> | +-- On Mon, 23 Mar 2020, Jason Wang wrote --+
> | | hw/net/tulip.c:305:20: error: initialization of ‘_Bool (*)(NetClientState *)’
> | | {aka ‘_Bool (*)(struct NetClientState *)’} from incompatible pointer type ‘int
> | | (*)(NetClientState *)’ {aka ‘int (*)(struct NetClientState *)’}
> | | [-Werror=incompatible-pointer-types]
> | | .can_receive = tulip_can_receive,
> | | ^~~~~~~~~~~~~~~~~
> |
> | Strange, I did not get it.
>
> qemu/include/net.h:
>
> typedef int (NetCanReceive)(NetClientState *);
>
> typedef struct NetClientInfo {
> ...
> NetCanReceive *can_receive;
> ...
> }
>
> @Jason,
> Looking at the definition above, 'NetCanReceive' is returning an 'int' type.
> When I change 'tulip_can_receive' to return a 'bool', I get the reverse error
>
> hw/net/tulip.c:305:20: error: initialization of ‘int (*)(NetClientState *)’ {aka ‘int (*)(struct NetClientState *)’} from incompatible pointer type ‘_Bool (*)(NetClientState *)’ {aka ‘_Bool (*)(struct NetClientState *)’}
> [-Werror=incompatible-pointer-types]
> 305 | .can_receive = tulip_can_receive,
> | ^~~~~~~~~~~~~~~~~
>
> Maybe because of a stagged local change in your tree? (to confirm)
Right, it's the conversion from int to bool done by Philippe :)
I will fix the conflict after Qiang tests it.
Thanks
>
> Thank you.
> --
> Prasad J Pandit / Red Hat Product Security Team
> 8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
next prev parent reply other threads:[~2020-03-23 10:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-19 17:40 [PATCH v5 0/3] net: tulip: add checks to avoid OOB access P J P
2020-03-19 17:40 ` [PATCH v5 1/3] net: tulip: check frame size and r/w data length P J P
2020-03-19 17:40 ` [PATCH v5 2/3] net: tulip: add .can_receive routine P J P
2020-03-19 19:10 ` Philippe Mathieu-Daudé
2020-03-19 17:40 ` [PATCH v5 3/3] net: tulip: flush queued packets post receive P J P
2020-03-23 3:43 ` [PATCH v5 0/3] net: tulip: add checks to avoid OOB access Jason Wang
2020-03-23 3:56 ` Jason Wang
2020-03-23 4:40 ` P J P
2020-03-23 5:40 ` P J P
2020-03-23 10:28 ` Jason Wang [this message]
2020-03-23 12:24 ` P J P
2020-03-23 6:00 ` Li Qiang
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=739d25c4-4fd7-2650-a236-902eed1a6eed@redhat.com \
--to=jasowang@redhat.com \
--cc=ezrakiez@gmail.com \
--cc=pangpei.lq@antfin.com \
--cc=philmd@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=svens@stackframe.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).