Re: [PATCH] bpf: fix: address of local auto-variable assigned to a function parameter.

2020-12-24 Thread David Ahern
On 12/24/20 12:01 AM, YANG LI wrote: > Assigning local variable txq to the outputting parameter xdp->txq is not > safe, txq will be released after the end of the function call. > Then the result of using xdp is unpredictable. txq can only be accessed in this devmap context. Was it actually hit du

Re: [PATCH] bpf: fix: address of local auto-variable assigned to a function parameter.

2020-12-23 Thread Yonghong Song
On 12/23/20 11:01 PM, YANG LI wrote: Assigning local variable txq to the outputting parameter xdp->txq is not safe, txq will be released after the end of the function call. Then the result of using xdp is unpredictable. Fix this error by defining the struct xdp_txq_info in function dev_map_ru

[PATCH] bpf: fix: address of local auto-variable assigned to a function parameter.

2020-12-23 Thread YANG LI
Assigning local variable txq to the outputting parameter xdp->txq is not safe, txq will be released after the end of the function call. Then the result of using xdp is unpredictable. Fix this error by defining the struct xdp_txq_info in function dev_map_run_prog() as a static type. Signed-off-by