mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
Merge branch 'net-hamradio-fix-missing-input-validation-in-bpqether-and-scc'
Mashiro Chen says: ==================== net: hamradio: fix missing input validation in bpqether and scc This series fixes two missing input validation bugs in the hamradio drivers. Both patches were reviewed by Joerg Reuter (hamradio maintainer). ==================== Link: https://patch.msgid.link/20260409024927.24397-1-mashiro.chen@mailbox.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
2654557112
|
|
@ -187,6 +187,9 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
|
|||
|
||||
len = skb->data[0] + skb->data[1] * 256 - 5;
|
||||
|
||||
if (len < 0 || len > skb->len - 2)
|
||||
goto drop_unlock;
|
||||
|
||||
skb_pull(skb, 2); /* Remove the length bytes */
|
||||
skb_trim(skb, len); /* Set the length of the data */
|
||||
|
||||
|
|
|
|||
|
|
@ -1909,6 +1909,8 @@ static int scc_net_siocdevprivate(struct net_device *dev,
|
|||
if (!capable(CAP_SYS_RAWIO)) return -EPERM;
|
||||
if (!arg || copy_from_user(&memcfg, arg, sizeof(memcfg)))
|
||||
return -EINVAL;
|
||||
if (memcfg.bufsize < 16)
|
||||
return -EINVAL;
|
||||
scc->stat.bufsize = memcfg.bufsize;
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user