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
3535 if (multicore) {
3636 queue->worker = wg_packet_percpu_multicore_worker_alloc(
3737 function, queue);
38− if (!queue->worker)
38+ if (!queue->worker) {
39+ ptr_ring_cleanup(&queue->ring, NULL);
3940 return -ENOMEM;
41+ }
4042 } else {
4143 INIT_WORK(&queue->work, function);
4244 }
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
393393 len = ntohs(ip_hdr(skb)->tot_len);
394394 if (unlikely(len < sizeof(struct iphdr)))
395395 goto dishonest_packet_size;
396− if (INET_ECN_is_ce(PACKET_CB(skb)->ds))
397− IP_ECN_set_ce(ip_hdr(skb));
396+ INET_ECN_decapsulate(skb, PACKET_CB(skb)->ds, ip_hdr(skb)->tos);
398397 } else if (skb->protocol == htons(ETH_P_IPV6)) {
399398 len = ntohs(ipv6_hdr(skb)->payload_len) +
400399 sizeof(struct ipv6hdr);
401− if (INET_ECN_is_ce(PACKET_CB(skb)->ds))
402− IP6_ECN_set_ce(skb, ipv6_hdr(skb));
400+ INET_ECN_decapsulate(skb, PACKET_CB(skb)->ds, ipv6_get_dsfield(ipv6_hdr(skb)));
403401 } else {
404402 goto dishonest_packet_type;
405403 }
drivers/net/wireguard/send.c+0−1
@@ -304,7 +304,6 @@ void wg_packet_encrypt_worker(struct work_struct *work) · 303 unmodified lines
304304 }
305305 wg_queue_enqueue_per_peer(&PACKET_PEER(first)->tx_queue, first,
306306 state);
307−
308307 }
309308 }
310309