History

Merge branch 'wireguard-fixes'

Jason A. Donenfeld says: ==================== wireguard fixes for 5.7-rc4 This series contains two fixes and a cleanup for wireguard: 1) Removal of a spurious newline, from Sultan Alsawaf. 2) Fix for a memory leak in an error path, in which memory allocated prior to the error wasn't freed, reported by Sultan Alsawaf. 3) Fix to ECN support to use RFC6040 properly like all the other tunnel drivers, from Toke Høiland-Jørgensen. ====================

David S. Miller committed 6 years ago

Commit 30724cc2 parents 42c556f eebabcb3 files · +5 −6Browse files

Unified · Split

3 files
  1. drivers/net/wireguard/queueing.c +3 −1
  2. drivers/net/wireguard/receive.c +2 −4
  3. drivers/net/wireguard/send.c +0 −1
drivers/net/wireguard/queueing.c+3−1
@@ -35,8 +35,10 @@ int wg_packet_queue_init(struct crypt_queue *queue, work_func_t function, · 34 unmodified lines
35 if (multicore) {35 if (multicore) {
36 queue->worker = wg_packet_percpu_multicore_worker_alloc(36 queue->worker = wg_packet_percpu_multicore_worker_alloc(
37 function, queue);37 function, queue);
38 if (!queue->worker)38 if (!queue->worker) {
39 ptr_ring_cleanup(&queue->ring, NULL);
39 return -ENOMEM;40 return -ENOMEM;
41 }
40 } else {42 } else {
41 INIT_WORK(&queue->work, function);43 INIT_WORK(&queue->work, function);
42 }44 }
drivers/net/wireguard/receive.c+2−4
@@ -393,13 +393,11 @@ static void wg_packet_consume_data_done(struct wg_peer *peer, · 392 unmodified lines
393 len = ntohs(ip_hdr(skb)->tot_len);393 len = ntohs(ip_hdr(skb)->tot_len);
394 if (unlikely(len < sizeof(struct iphdr)))394 if (unlikely(len < sizeof(struct iphdr)))
395 goto dishonest_packet_size;395 goto dishonest_packet_size;
396 if (INET_ECN_is_ce(PACKET_CB(skb)->ds))396 INET_ECN_decapsulate(skb, PACKET_CB(skb)->ds, ip_hdr(skb)->tos);
397 IP_ECN_set_ce(ip_hdr(skb));
398 } else if (skb->protocol == htons(ETH_P_IPV6)) {397 } else if (skb->protocol == htons(ETH_P_IPV6)) {
399 len = ntohs(ipv6_hdr(skb)->payload_len) +398 len = ntohs(ipv6_hdr(skb)->payload_len) +
400 sizeof(struct ipv6hdr);399 sizeof(struct ipv6hdr);
401 if (INET_ECN_is_ce(PACKET_CB(skb)->ds))400 INET_ECN_decapsulate(skb, PACKET_CB(skb)->ds, ipv6_get_dsfield(ipv6_hdr(skb)));
402 IP6_ECN_set_ce(skb, ipv6_hdr(skb));
403 } else {401 } else {
404 goto dishonest_packet_type;402 goto dishonest_packet_type;
405 }403 }
drivers/net/wireguard/send.c+0−1
@@ -304,7 +304,6 @@ void wg_packet_encrypt_worker(struct work_struct *work) · 303 unmodified lines
304 }304 }
305 wg_queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first,305 wg_queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first,
306 state);306 state);
307
308 }307 }
309}308}
310 309