From: Dan Carpenter <hidden> Date: 2021-08-27 13:24:55
These checks are still not strict enough. The main problem is that if
"cb->type == QRTR_TYPE_NEW_SERVER" is true then "len - hdrlen" is
guaranteed to be 4 but we need to be at least 16 bytes. In fact, we
can reject everything smaller than sizeof(*pkt) which is 20 bytes.
Also I don't like the ALIGN(size, 4). It's better to just insist that
data is needs to be aligned at the start.
Fixes: 0baa99ee353c ("net: qrtr: Allow non-immediate node routing")
Signed-off-by: Dan Carpenter <redacted>
---
This was from review. Not tested.
net/qrtr/qrtr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
On Fri, Aug 27, 2021 at 9:24 PM Dan Carpenter [off-list ref] wrote:
quoted hunk
These checks are still not strict enough. The main problem is that if
"cb->type == QRTR_TYPE_NEW_SERVER" is true then "len - hdrlen" is
guaranteed to be 4 but we need to be at least 16 bytes. In fact, we
can reject everything smaller than sizeof(*pkt) which is 20 bytes.
Also I don't like the ALIGN(size, 4). It's better to just insist that
data is needs to be aligned at the start.
Fixes: 0baa99ee353c ("net: qrtr: Allow non-immediate node routing")
Signed-off-by: Dan Carpenter <redacted>
---
This was from review. Not tested.
net/qrtr/qrtr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
From: Dan Carpenter <hidden> Date: 2021-08-27 17:17:43
On Fri, Aug 27, 2021 at 11:35:31PM +0800, butt3rflyh4ck wrote:
On Fri, Aug 27, 2021 at 9:24 PM Dan Carpenter [off-list ref] wrote:
quoted
These checks are still not strict enough. The main problem is that if
"cb->type == QRTR_TYPE_NEW_SERVER" is true then "len - hdrlen" is
guaranteed to be 4 but we need to be at least 16 bytes. In fact, we
can reject everything smaller than sizeof(*pkt) which is 20 bytes.
Also I don't like the ALIGN(size, 4). It's better to just insist that
data is needs to be aligned at the start.
Fixes: 0baa99ee353c ("net: qrtr: Allow non-immediate node routing")
Signed-off-by: Dan Carpenter <redacted>
---
This was from review. Not tested.
net/qrtr/qrtr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
From: Dan Carpenter <hidden> Date: 2021-08-30 08:37:51
These checks are still not strict enough. The main problem is that if
"cb->type == QRTR_TYPE_NEW_SERVER" is true then "len - hdrlen" is
guaranteed to be 4 but we need to be at least 16 bytes. In fact, we
can reject everything smaller than sizeof(*pkt) which is 20 bytes.
Also I don't like the ALIGN(size, 4). It's better to just insist that
data is needs to be aligned at the start.
Fixes: 0baa99ee353c ("net: qrtr: Allow non-immediate node routing")
Signed-off-by: Dan Carpenter <redacted>
---
v2: Fix a % vs & bug. Thanks, butt3rflyh4ck!
net/qrtr/qrtr.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Mon, 30 Aug 2021 11:37:17 +0300 you wrote:
These checks are still not strict enough. The main problem is that if
"cb->type == QRTR_TYPE_NEW_SERVER" is true then "len - hdrlen" is
guaranteed to be 4 but we need to be at least 16 bytes. In fact, we
can reject everything smaller than sizeof(*pkt) which is 20 bytes.
Also I don't like the ALIGN(size, 4). It's better to just insist that
data is needs to be aligned at the start.
[...]