From: Dan Carpenter <hidden> Date: 2021-06-19 13:52:35
We recently changed these two pointers from void pointers to struct
pointers and it breaks the pointer math so now the "txphdr" points
beyond the end of the buffer.
Fixes: 56a967c4f7e5 ("net: qualcomm: rmnet: Remove some unneeded casts")
Signed-off-by: Dan Carpenter <redacted>
---
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
We recently changed these two pointers from void pointers to struct
pointers and it breaks the pointer math so now the "txphdr" points
beyond the end of the buffer.
Fixes: 56a967c4f7e5 ("net: qualcomm: rmnet: Remove some unneeded
casts")
Signed-off-by: Dan Carpenter <redacted>
---
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
The fix for that is to not enable -Wpointer-arith. The warning is dumb.
Sorry, that was uncalled for and not correct. The GCC warning would be
useful if we were trying to write portable userspace code. But in the
kernel the kernel uses GCC extensions a lot.
The Clang compiler can also compile the kernel these days. But it had
to add support for a bunch of GCC extensions to make that work. Really
most of linux userspace is written with GCC in mind so Clang had to do
this anyway.
So we will never enable -Wpointer-arith in the kernel because there is
no need.
regards,
dan carpenter
The fix for that is to not enable -Wpointer-arith. The warning is
dumb.
Sorry, that was uncalled for and not correct. The GCC warning would be
useful if we were trying to write portable userspace code. But in the
kernel the kernel uses GCC extensions a lot.
The Clang compiler can also compile the kernel these days. But it had
to add support for a bunch of GCC extensions to make that work. Really
most of linux userspace is written with GCC in mind so Clang had to do
this anyway.
So we will never enable -Wpointer-arith in the kernel because there is
no need.
regards,
dan carpenter
Thanks for the clarification.
Reviewed-by: Subash Abhinov Kasiviswanathan <redacted>
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Sat, 19 Jun 2021 16:52:22 +0300 you wrote:
We recently changed these two pointers from void pointers to struct
pointers and it breaks the pointer math so now the "txphdr" points
beyond the end of the buffer.
Fixes: 56a967c4f7e5 ("net: qualcomm: rmnet: Remove some unneeded casts")
Signed-off-by: Dan Carpenter <redacted>
[...]