summaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2018-04-08 16:07:37 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2018-04-08 16:07:37 +0200
commitd6bbe8be6bda0f7ea62fa6b891dcf01a3b977391 (patch)
tree806e6462fdae914b3978bd6b7d6af0c5e55fc303 /net/bridge
parent64bc01b0025eaee66ae613d15bfd7d570a8f6f92 (diff)
parent2cad7a1d1316d2955982c50b3b9a6809dff5a7d3 (diff)
Merge 4.4.127 into android-4.4
Changes in 4.4.127 mtd: jedec_probe: Fix crash in jedec_read_mfr() ALSA: pcm: Use dma_bytes as size parameter in dma_mmap_coherent() ALSA: pcm: potential uninitialized return values perf/hwbp: Simplify the perf-hwbp code, fix documentation partitions/msdos: Unable to mount UFS 44bsd partitions usb: gadget: define free_ep_req as universal function usb: gadget: change len to size_t on alloc_ep_req() usb: gadget: fix usb_ep_align_maybe endianness and new usb_ep_align usb: gadget: align buffer size when allocating for OUT endpoint usb: gadget: f_hid: fix: Prevent accessing released memory kprobes/x86: Fix to set RWX bits correctly before releasing trampoline ACPI, PCI, irq: remove redundant check for null string pointer writeback: fix the wrong congested state variable definition PCI: Make PCI_ROM_ADDRESS_MASK a 32-bit constant dm ioctl: remove double parentheses Input: mousedev - fix implicit conversion warning netfilter: nf_nat_h323: fix logical-not-parentheses warning genirq: Use cpumask_available() for check of cpumask variable cpumask: Add helper cpumask_available() selinux: Remove unnecessary check of array base in selinux_set_mapping() fs: compat: Remove warning from COMPATIBLE_IOCTL jiffies.h: declare jiffies and jiffies_64 with ____cacheline_aligned_in_smp frv: declare jiffies to be located in the .data section audit: add tty field to LOGIN event tty: provide tty_name() even without CONFIG_TTY netfilter: ctnetlink: Make some parameters integer to avoid enum mismatch selinux: Remove redundant check for unknown labeling behavior arm64: avoid overflow in VA_START and PAGE_OFFSET xfrm_user: uncoditionally validate esn replay attribute struct RDMA/ucma: Check AF family prior resolving address RDMA/ucma: Fix use-after-free access in ucma_close RDMA/ucma: Ensure that CM_ID exists prior to access it RDMA/ucma: Check that device is connected prior to access it RDMA/ucma: Check that device exists prior to accessing it RDMA/ucma: Don't allow join attempts for unsupported AF family RDMA/ucma: Introduce safer rdma_addr_size() variants net: xfrm: use preempt-safe this_cpu_read() in ipcomp_alloc_tfms() xfrm: Refuse to insert 32 bit userspace socket policies on 64 bit systems netfilter: bridge: ebt_among: add more missing match size checks netfilter: x_tables: add and use xt_check_proc_name Bluetooth: Fix missing encryption refresh on Security Request llist: clang: introduce member_address_is_nonnull() scsi: virtio_scsi: always read VPD pages for multiqueue too usb: dwc2: Improve gadget state disconnection handling USB: serial: ftdi_sio: add RT Systems VX-8 cable USB: serial: ftdi_sio: add support for Harman FirmwareHubEmulator USB: serial: cp210x: add ELDAT Easywave RX09 id mei: remove dev_err message on an unsupported ioctl media: usbtv: prevent double free in error case parport_pc: Add support for WCH CH382L PCI-E single parallel port card. crypto: ahash - Fix early termination in hash walk crypto: x86/cast5-avx - fix ECB encryption when long sg follows short one fs/proc: Stop trying to report thread stacks staging: comedi: ni_mio_common: ack ai fifo error interrupts. Input: i8042 - add Lenovo ThinkPad L460 to i8042 reset list Input: i8042 - enable MUX on Sony VAIO VGN-CS series to fix touchpad vt: change SGR 21 to follow the standards Documentation: pinctrl: palmas: Add ti,palmas-powerhold-override property definition ARM: dts: dra7: Add power hold and power controller properties to palmas ARM: dts: am57xx-beagle-x15-common: Add overide powerhold property md/raid10: reset the 'first' at the end of loop net: hns: Fix ethtool private flags nospec: Move array_index_nospec() parameter checking into separate macro nospec: Kill array_index_nospec_mask_check() Revert "PCI/MSI: Stop disabling MSI/MSI-X in pci_device_shutdown()" Revert "ARM: dts: am335x-pepper: Fix the audio CODEC's reset pin" Revert "ARM: dts: omap3-n900: Fix the audio CODEC's reset pin" Revert "cpufreq: Fix governor module removal race" Revert "mtip32xx: use runtime tag to initialize command header" spi: davinci: fix up dma_mapping_error() incorrect patch net: cavium: liquidio: fix up "Avoid dma_unmap_single on uninitialized ndata" Revert "ip6_vti: adjust vti mtu according to mtu of lower device" Linux 4.4.127 Change-Id: Ia3b9ed0a5b2ea6c682386dbee5337ed8413d1a53 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/netfilter/ebt_among.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/bridge/netfilter/ebt_among.c b/net/bridge/netfilter/ebt_among.c
index 9637a681bdda..9adf16258cab 100644
--- a/net/bridge/netfilter/ebt_among.c
+++ b/net/bridge/netfilter/ebt_among.c
@@ -177,6 +177,28 @@ static bool poolsize_invalid(const struct ebt_mac_wormhash *w)
return w && w->poolsize >= (INT_MAX / sizeof(struct ebt_mac_wormhash_tuple));
}
+static bool wormhash_offset_invalid(int off, unsigned int len)
+{
+ if (off == 0) /* not present */
+ return false;
+
+ if (off < (int)sizeof(struct ebt_among_info) ||
+ off % __alignof__(struct ebt_mac_wormhash))
+ return true;
+
+ off += sizeof(struct ebt_mac_wormhash);
+
+ return off > len;
+}
+
+static bool wormhash_sizes_valid(const struct ebt_mac_wormhash *wh, int a, int b)
+{
+ if (a == 0)
+ a = sizeof(struct ebt_among_info);
+
+ return ebt_mac_wormhash_size(wh) + a == b;
+}
+
static int ebt_among_mt_check(const struct xt_mtchk_param *par)
{
const struct ebt_among_info *info = par->matchinfo;
@@ -189,6 +211,10 @@ static int ebt_among_mt_check(const struct xt_mtchk_param *par)
if (expected_length > em->match_size)
return -EINVAL;
+ if (wormhash_offset_invalid(info->wh_dst_ofs, em->match_size) ||
+ wormhash_offset_invalid(info->wh_src_ofs, em->match_size))
+ return -EINVAL;
+
wh_dst = ebt_among_wh_dst(info);
if (poolsize_invalid(wh_dst))
return -EINVAL;
@@ -201,6 +227,14 @@ static int ebt_among_mt_check(const struct xt_mtchk_param *par)
if (poolsize_invalid(wh_src))
return -EINVAL;
+ if (info->wh_src_ofs < info->wh_dst_ofs) {
+ if (!wormhash_sizes_valid(wh_src, info->wh_src_ofs, info->wh_dst_ofs))
+ return -EINVAL;
+ } else {
+ if (!wormhash_sizes_valid(wh_dst, info->wh_dst_ofs, info->wh_src_ofs))
+ return -EINVAL;
+ }
+
expected_length += ebt_mac_wormhash_size(wh_src);
if (em->match_size != EBT_ALIGN(expected_length)) {