提交 97d44cdd 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

Revert "can: gw: ensure DLC boundaries after CAN frame modification"

euler inclusion
category: feature
Bugzilla: N/A
CVE: N/A

Using lts patch instead of this patch.

----------------------------------------

This reverts commit 1378af97f8d132a0913c382a14ba4aa8dd37a06a.
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 9156238f
......@@ -416,29 +416,13 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)
while (modidx < MAX_MODFUNCTIONS && gwj->mod.modfunc[modidx])
(*gwj->mod.modfunc[modidx++])(cf, &gwj->mod);
/* Has the CAN frame been modified? */
/* check for checksum updates when the CAN frame has been modified */
if (modidx) {
/* get available space for the processed CAN frame type */
int max_len = nskb->len - offsetof(struct can_frame, data);
/* dlc may have changed, make sure it fits to the CAN frame */
if (cf->can_dlc > max_len)
goto out_delete;
/* check for checksum updates in classic CAN length only */
if (gwj->mod.csumfunc.crc8) {
if (cf->can_dlc > 8)
goto out_delete;
if (gwj->mod.csumfunc.crc8)
(*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8);
}
if (gwj->mod.csumfunc.xor) {
if (cf->can_dlc > 8)
goto out_delete;
if (gwj->mod.csumfunc.xor)
(*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor);
}
}
/* clear the skb timestamp if not configured the other way */
......@@ -450,14 +434,6 @@ static void can_can_gw_rcv(struct sk_buff *skb, void *data)
gwj->dropped_frames++;
else
gwj->handled_frames++;
return;
out_delete:
/* delete frame due to misconfiguration */
gwj->deleted_frames++;
kfree_skb(nskb);
return;
}
static inline int cgw_register_filter(struct net *net, struct cgw_job *gwj)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册