Skip to content

Commit d882109

Browse files
committed
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says: ==================== The following patchset contains four fixes for Netfilter and one fix for IPVS, they are: * Fix data leak to user-space via getsockopt IP_VS_SO_GET_DESTS, from Dan Carpenter. * Fix xt_TCPMSS if no TCP MSS is specified in syn packets, to avoid the violation of RFC879, from Phil Oester. * Fix incomplete dump of objects via nfnetlink_acct and nfnetlink_cttimeout, from myself. * Fix missing HW protocol in packets passed to user-space via NFQUEUE, from myself. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 40edeff + a8241c6 commit d882109

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

net/netfilter/ipvs/ip_vs_ctl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,7 @@ __ip_vs_get_dest_entries(struct net *net, const struct ip_vs_get_dests *get,
25422542
struct ip_vs_dest *dest;
25432543
struct ip_vs_dest_entry entry;
25442544

2545+
memset(&entry, 0, sizeof(entry));
25452546
list_for_each_entry(dest, &svc->destinations, n_list) {
25462547
if (count >= get->num_dests)
25472548
break;

net/netfilter/nfnetlink_acct.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,12 @@ nfnl_acct_dump(struct sk_buff *skb, struct netlink_callback *cb)
149149

150150
rcu_read_lock();
151151
list_for_each_entry_rcu(cur, &nfnl_acct_list, head) {
152-
if (last && cur != last)
153-
continue;
152+
if (last) {
153+
if (cur != last)
154+
continue;
154155

156+
last = NULL;
157+
}
155158
if (nfnl_acct_fill_info(skb, NETLINK_CB(cb->skb).portid,
156159
cb->nlh->nlmsg_seq,
157160
NFNL_MSG_TYPE(cb->nlh->nlmsg_type),

net/netfilter/nfnetlink_cttimeout.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,12 @@ ctnl_timeout_dump(struct sk_buff *skb, struct netlink_callback *cb)
220220

221221
rcu_read_lock();
222222
list_for_each_entry_rcu(cur, &cttimeout_list, head) {
223-
if (last && cur != last)
224-
continue;
223+
if (last) {
224+
if (cur != last)
225+
continue;
225226

227+
last = NULL;
228+
}
226229
if (ctnl_timeout_fill_info(skb, NETLINK_CB(cb->skb).portid,
227230
cb->nlh->nlmsg_seq,
228231
NFNL_MSG_TYPE(cb->nlh->nlmsg_type),

net/netfilter/nfnetlink_queue_core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,9 +637,6 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
637637
if (queue->copy_mode == NFQNL_COPY_NONE)
638638
return -EINVAL;
639639

640-
if ((queue->flags & NFQA_CFG_F_GSO) || !skb_is_gso(entry->skb))
641-
return __nfqnl_enqueue_packet(net, queue, entry);
642-
643640
skb = entry->skb;
644641

645642
switch (entry->pf) {
@@ -651,6 +648,9 @@ nfqnl_enqueue_packet(struct nf_queue_entry *entry, unsigned int queuenum)
651648
break;
652649
}
653650

651+
if ((queue->flags & NFQA_CFG_F_GSO) || !skb_is_gso(skb))
652+
return __nfqnl_enqueue_packet(net, queue, entry);
653+
654654
nf_bridge_adjust_skb_data(skb);
655655
segs = skb_gso_segment(skb, 0);
656656
/* Does not use PTR_ERR to limit the number of error codes that can be

net/netfilter/xt_TCPMSS.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ tcpmss_mangle_packet(struct sk_buff *skb,
125125

126126
skb_put(skb, TCPOLEN_MSS);
127127

128+
/* RFC 879 states that the default MSS is 536 without specific
129+
* knowledge that the destination host is prepared to accept larger.
130+
* Since no MSS was provided, we MUST NOT set a value > 536.
131+
*/
132+
newmss = min(newmss, (u16)536);
133+
128134
opt = (u_int8_t *)tcph + sizeof(struct tcphdr);
129135
memmove(opt + TCPOLEN_MSS, opt, tcplen - sizeof(struct tcphdr));
130136

0 commit comments

Comments
 (0)