From: Jakub Kicinski <kuba@kernel.org> Date: 2021-12-14 15:47:31
Commit 0976b888a150 ("ethtool: fix null-ptr-deref on ref tracker")
made the write to req_info.dev conditional, but as Eric points out
in a different follow up the structure is often allocated on the
stack and not kzalloc()'d so seems safer to always write the dev,
in case it's garbage on input.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
net/ethtool/netlink.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
From: Eric Dumazet <hidden> Date: 2021-12-15 10:47:59
On 12/14/21 7:47 AM, Jakub Kicinski wrote:
Commit 0976b888a150 ("ethtool: fix null-ptr-deref on ref tracker")
made the write to req_info.dev conditional, but as Eric points out
in a different follow up the structure is often allocated on the
stack and not kzalloc()'d so seems safer to always write the dev,
in case it's garbage on input.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Yep, this was basically how I wanted to fix this.
Reviewed-by: Eric Dumazet <redacted>
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller [off-list ref]:
On Tue, 14 Dec 2021 07:47:25 -0800 you wrote:
Commit 0976b888a150 ("ethtool: fix null-ptr-deref on ref tracker")
made the write to req_info.dev conditional, but as Eric points out
in a different follow up the structure is often allocated on the
stack and not kzalloc()'d so seems safer to always write the dev,
in case it's garbage on input.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[...]