]> git.baikalelectronics.ru Git - kernel.git/commit
bnx2x: fix AFEX memory overflow
authorYuval Mintz <yuvalmin@broadcom.com>
Sun, 5 Jan 2014 16:33:53 +0000 (18:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2014 01:22:25 +0000 (20:22 -0500)
commitd5321367ee29ad005142dcfb970a0be74642995e
treef8989f46cdfb6901e0c07f344f9d4b5c23a9f7a4
parent0691d1b5bfb8c559bbe10710d96d275da3087c89
bnx2x: fix AFEX memory overflow

There are 2 different (related) flows in the slowpath configuration
that utilize the same pointer and cast it to different structs;
This is obviously incorrect as the intended allocated memory is that
of the smaller struct, possibly causing the flow utilizing the larger
struct to corrupt other slowpath configuration.

Since both flows are exclusive, set the allocated memory to be a union
of both structs.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h