[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access
From: |
P J P |
Subject: |
Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access |
Date: |
Mon, 23 Mar 2020 11:10:49 +0530 (IST) |
+-- 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)
Thank you.
--
Prasad J Pandit / Red Hat Product Security Team
8685 545E B54C 486B C6EB 271E E285 8B5A F050 DE8D
- [PATCH v5 0/3] net: tulip: add checks to avoid OOB access, P J P, 2020/03/19
- [PATCH v5 1/3] net: tulip: check frame size and r/w data length, P J P, 2020/03/19
- [PATCH v5 2/3] net: tulip: add .can_receive routine, P J P, 2020/03/19
- [PATCH v5 3/3] net: tulip: flush queued packets post receive, P J P, 2020/03/19
- Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access, Jason Wang, 2020/03/22
- Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access, P J P, 2020/03/23
- Re: [PATCH v5 0/3] net: tulip: add checks to avoid OOB access, Li Qiang, 2020/03/23