mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
Pablo Neira Ayuso says: ==================== The following patchset contains three netfilter fixes for your net tree, they are: * A couple of fixes to resolve info leak to userspace due to uninitialized memory area in ulogd, from Mathias Krause. * Fix instruction ordering issues that may lead to the access of uninitialized data in x_tables. The problem involves the table update (producer) and the main packet matching (consumer) routines. Detected in SMP ARMv7, from Will Deacon. ==================== Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
commit
afb14c7cb6
6 changed files with 25 additions and 13 deletions
|
|
@ -271,6 +271,11 @@ unsigned int arpt_do_table(struct sk_buff *skb,
|
|||
local_bh_disable();
|
||||
addend = xt_write_recseq_begin();
|
||||
private = table->private;
|
||||
/*
|
||||
* Ensure we load private-> members after we've fetched the base
|
||||
* pointer.
|
||||
*/
|
||||
smp_read_barrier_depends();
|
||||
table_base = private->entries[smp_processor_id()];
|
||||
|
||||
e = get_entry(table_base, private->hook_entry[hook]);
|
||||
|
|
|
|||
|
|
@ -327,6 +327,11 @@ ipt_do_table(struct sk_buff *skb,
|
|||
addend = xt_write_recseq_begin();
|
||||
private = table->private;
|
||||
cpu = smp_processor_id();
|
||||
/*
|
||||
* Ensure we load private-> members after we've fetched the base
|
||||
* pointer.
|
||||
*/
|
||||
smp_read_barrier_depends();
|
||||
table_base = private->entries[cpu];
|
||||
jumpstack = (struct ipt_entry **)private->jumpstack[cpu];
|
||||
stackptr = per_cpu_ptr(private->stackptr, cpu);
|
||||
|
|
|
|||
|
|
@ -220,6 +220,7 @@ static void ipt_ulog_packet(struct net *net,
|
|||
ub->qlen++;
|
||||
|
||||
pm = nlmsg_data(nlh);
|
||||
memset(pm, 0, sizeof(*pm));
|
||||
|
||||
/* We might not have a timestamp, get one */
|
||||
if (skb->tstamp.tv64 == 0)
|
||||
|
|
@ -238,8 +239,6 @@ static void ipt_ulog_packet(struct net *net,
|
|||
}
|
||||
else if (loginfo->prefix[0] != '\0')
|
||||
strncpy(pm->prefix, loginfo->prefix, sizeof(pm->prefix));
|
||||
else
|
||||
*(pm->prefix) = '\0';
|
||||
|
||||
if (in && in->hard_header_len > 0 &&
|
||||
skb->mac_header != skb->network_header &&
|
||||
|
|
@ -251,13 +250,9 @@ static void ipt_ulog_packet(struct net *net,
|
|||
|
||||
if (in)
|
||||
strncpy(pm->indev_name, in->name, sizeof(pm->indev_name));
|
||||
else
|
||||
pm->indev_name[0] = '\0';
|
||||
|
||||
if (out)
|
||||
strncpy(pm->outdev_name, out->name, sizeof(pm->outdev_name));
|
||||
else
|
||||
pm->outdev_name[0] = '\0';
|
||||
|
||||
/* copy_len <= skb->len, so can't fail. */
|
||||
if (skb_copy_bits(skb, 0, pm->payload, copy_len) < 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue