Linux 3.12.8
Greg KH
maintainerI'm announcing the release of the 3.12.8 kernel.
All users of the 3.12 kernel series must upgrade.
The updated 3.12.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.12.y
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/devicetree/bindings/clock/exynos5250-clock.txt | 2 Documentation/networking/packet_mmap.txt | 10 Makefile | 2 arch/arm/boot/dts/exynos5250.dtsi | 2 arch/arm/kernel/traps.c | 8 arch/arm/mach-footbridge/dc21285-timer.c | 5 arch/arm/mach-shmobile/board-armadillo800eva.c | 4 arch/arm/mach-shmobile/board-kzm9g.c | 2 arch/arm/mach-shmobile/board-mackerel.c | 4 arch/arm/mm/flush.c | 6 arch/parisc/include/asm/cacheflush.h | 12 - arch/parisc/include/asm/page.h | 5 arch/parisc/kernel/cache.c | 35 --- arch/x86/include/asm/fpu-internal.h | 13 - drivers/acpi/battery.c | 21 + drivers/ata/ahci.c | 3 drivers/char/tpm/tpm_ppi.c | 15 - drivers/clk/clk-divider.c | 2 drivers/clk/samsung/clk-exynos4.c | 2 drivers/clk/samsung/clk-exynos5250.c | 14 - drivers/cpufreq/intel_pstate.c | 3 drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 6 drivers/leds/leds-lp5521.c | 12 - drivers/leds/leds-lp5523.c | 12 - drivers/mfd/rtsx_pcr.c | 10 drivers/net/ethernet/arc/emac_main.c | 4 drivers/net/ethernet/broadcom/tg3.c | 3 drivers/net/ethernet/freescale/fec_main.c | 4 drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 drivers/net/ethernet/sfc/efx.c | 8 drivers/net/ethernet/sfc/mcdi.c | 39 ++- drivers/net/ethernet/sfc/net_driver.h | 3 drivers/net/ethernet/sfc/nic.h | 2 drivers/net/ethernet/sfc/ptp.c | 66 +++++- drivers/net/ethernet/sfc/rx.c | 6 drivers/net/ethernet/tehuti/tehuti.c | 1 drivers/net/ethernet/xilinx/ll_temac_main.c | 2 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 drivers/net/hamradio/hdlcdrv.c | 2 drivers/net/hamradio/yam.c | 1 drivers/net/hyperv/netvsc_drv.c | 1 drivers/net/macvtap.c | 23 -- drivers/net/tun.c | 18 + drivers/net/virtio_net.c | 119 +++++++---- drivers/net/vxlan.c | 2 drivers/scsi/sd.c | 5 include/linux/net.h | 2 include/linux/netdevice.h | 22 ++ include/linux/skbuff.h | 5 kernel/sched/core.c | 9 kernel/sched/fair.c | 48 +++- kernel/sched/sched.h | 3 net/8021q/vlan_dev.c | 19 + net/bridge/br_multicast.c | 4 net/bridge/br_private.h | 10 net/bridge/br_stp_bpdu.c | 2 net/core/drop_monitor.c | 1 net/core/neighbour.c | 2 net/core/netpoll.c | 11 - net/core/skbuff.c | 1 net/core/sock.c | 2 net/ipv4/fib_rules.c | 5 net/ipv4/gre_offload.c | 11 - net/ipv4/inet_diag.c | 16 + net/ipv4/ip_gre.c | 1 net/ipv4/udp.c | 6 net/ipv4/udp_offload.c | 37 +-- net/ipv6/fib6_rules.c | 6 net/ipv6/route.c | 34 +-- net/ipv6/udp_offload.c | 2 net/llc/af_llc.c | 5 net/mac80211/tx.c | 23 +- net/netfilter/nf_conntrack_seqadj.c | 4 net/netfilter/nf_nat_irc.c | 32 ++ net/packet/af_packet.c | 65 +++--- net/rds/ib.c | 3 net/rds/ib_send.c | 5 net/rose/af_rose.c | 16 - net/unix/af_unix.c | 16 + 79 files changed, 624 insertions(+), 327 deletions(-)
Abhilash Kesavan (4):
ARM: dts: exynos5250: Fix MDMA0 clock number
clk: samsung: exynos5250: Fix ACP gate register offset
clk: samsung: exynos5250: Add MDMA0 clocks
clk: samsung: exynos5250: Add CLK_IGNORE_UNUSED flag for the sysreg clock
Alexandre Rames (1):
sfc: Stop/re-start PTP when stopping/starting the datapath.
Andrew Bresticker (1):
clk: exynos5250: fix sysmmu_mfc{l,r} gate clocks
Andrew Rybchenko (1):
sfc: RX buffer allocation takes prefix size into account in IP header alignment
Andrey Vagin (1):
virtio: delete napi structures from netdev before releasing memory
Ben Hutchings (3):
sfc: Add length checks to efx_xmit_with_hwtstamp() and efx_ptp_is_ptp_tx()
sfc: Rate-limit log message for PTP packets without a matching timestamp event
sfc: Maintain current frequency adjustment when applying a time offset
Ben Segall (3):
sched: Fix race on toggling cfs_bandwidth_used
sched: Fix cfs_bandwidth misuse of hrtimer_expires_remaining
sched: Fix hrtimer_cancel()/rq->lock deadlock
Bernd Schubert (1):
SCSI: sd: Reduce buffer size for vpd request
Changli Gao (1):
net: drop_monitor: fix the value of maxattr
Curt Brune (1):
bridge: use spin_lock_bh() in br_multicast_set_hash_max
Daniel Borkmann (4):
packet: fix send path when running with proto == 0
net: inet_diag: zero out uninitialized idiag_{src,dst} fields
net: llc: fix use after free in llc_ui_recvmsg
netfilter: nf_nat: fix access to uninitialized buffer in IRC NAT helper
David S. Miller (2):
vlan: Fix header ops passthru when doing TX VLAN offload.
netpoll: Fix missing TXQ unlock and and OOPS.
Dirk Brandewie (1):
intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters.
Eric Dumazet (3):
net: do not pretend FRAGLIST support
net: fec: fix potential use after free
arc_emac: fix potential use after free
Fan Du (1):
vxlan: release rt when found circular route
Felix Fietkau (1):
mac80211: move "bufferable MMPDU" check to fix AP mode scan
Florian Westphal (1):
net: rose: restore old recvmsg behavior
Greg Kroah-Hartman (1):
Linux 3.12.8
Hannes Frederic Sowa (3):
net: clear local_df when passing skb between namespaces
ipv6: don't count addrconf generated routes against gc limit
ipv6: fix illegal mac_header comparison on 32bit
Ilia Mirkin (1):
drm/nouveau/bios: make jump conditional
James Hogan (1):
clk: clk-divider: fix divisor > 255 bug
Jason Wang (4):
tun: unbreak truncated packet signalling
macvtap: signal truncated packets
netvsc: don't flush peers notifying work during setting mtu
virtio-net: fix refill races during restore
Jiang Liu (1):
ACPI / TPM: fix memory leak when walking ACPI namespace
Jiri Pirko (1):
br: fix use of ->rx_handler_data in code executed on non-rx_handler path
John David Anglin (1):
parisc: Ensure full cache coherency for kmap/kunmap
Kamala R (1):
IPv6: Fixed support for blackhole and prohibit routes
Lan Tianyu (1):
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
Laurence Evans (1):
sfc: PTP: Moderate log message on event queue overflow
Laurent Pinchart (3):
ARM: shmobile: kzm9g: Fix coherent DMA mask
ARM: shmobile: armadillo: Fix coherent DMA mask
ARM: shmobile: mackerel: Fix coherent DMA mask
Li RongQing (1):
ipv6: always set the new created dst's from in ip6_rt_copy
Linus Torvalds (1):
x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
Michael S. Tsirkin (3):
virtio_net: fix error handling for mergeable buffers
virtio-net: make all RX paths handle errors consistently
virtio_net: don't leak memory or block when too many frags
Milo Kim (1):
leds: lp5521/5523: Remove duplicate mutex
Nat Gurumoorthy (1):
tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
Paul Turner (1):
sched: Guarantee new group-entities always have weight
Phil Oester (1):
netfilter: fix wrong byte order in nf_ct_seqadj_set internal information
Robert Stonehouse (2):
sfc: Refactor efx_mcdi_poll() by introducing efx_mcdi_poll_once()
sfc: Poll for MCDI completion once before timeout occurs
Russell King (2):
ARM: fix footbridge clockevent device
ARM: fix "bad mode in ... handler" message for undefined instructions
Salva Peiró (1):
hamradio/yam: fix info leak in ioctl
Sasha Levin (3):
net: unix: allow set_peek_off to fail
net: unix: allow bind to fail on mutex lock
rds: prevent dereference of a NULL device
Seung-Woo Kim (1):
clk: samsung: exynos4: Correct SRC_MFC register
Simon Guinot (1):
ahci: add PCI ID for Marvell 88SE9170 SATA controller
Stefan Tomanek (1):
inet: fix NULL pointer Oops in fib(6)_rule_suppress
Steven Capper (1):
ARM: 7923/1: mm: fix dcache flush logic for compound high pages
Thomas Gleixner (1):
mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
Timo Teräs (1):
ip_gre: fix msg_name parsing for recvfrom/recvmsg
Venkat Venkatsubra (1):
rds: prevent BUG_ON triggered on congestion update to loopback
Vlad Yasevich (1):
macvtap: Do not double-count received packets
Wei-Chun Chao (1):
ipv4: fix tunneled VM traffic over hw VXLAN/GRE GSO NIC
Wenliang Fan (1):
drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
Zhi Yong Wu (2):
macvtap: update file current position
tun: update file current position
Greg KH
maintainerDocumentation/devicetree/bindings/clock/exynos5250-clock.txt +2 -0
@@ -159,6 +159,8 @@ clock which they consume. mixer 343 hdmi 344 g2d 345 + mdma0 346 + smmu_mdma0 347 [Clock Muxes]
Documentation/networking/packet_mmap.txt +10 -0
@@ -123,6 +123,16 @@ Transmission process is similar to capture as shown below. [shutdown] close() --------> destruction of the transmission socket and deallocation of all associated resources. +Socket creation and destruction is also straight forward, and is done +the same way as in capturing described in the previous paragraph: + + int fd = socket(PF_PACKET, mode, 0); + +The protocol can optionally be 0 in case we only want to transmit +via this socket, which avoids an expensive call to packet_rcv(). +In this case, you also need to bind(2) the TX_RING with sll_protocol = 0 +set. Otherwise, htons(ETH_P_ALL) or any other protocol, for example. + Binding the socket to your network interface is mandatory (with zero copy) to know the header size of frames used in the circular buffer.
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 12 -SUBLEVEL = 7 +SUBLEVEL = 8 EXTRAVERSION = NAME = One Giant Leap for Frogkind
arch/arm/boot/dts/exynos5250.dtsi +1 -1
@@ -556,7 +556,7 @@ compatible = "arm,pl330", "arm,primecell"; reg = <0x10800000 0x1000>; interrupts = <0 33 0>; - clocks = <&clock 271>; + clocks = <&clock 346>; clock-names = "apb_pclk"; #dma-cells = <1>; #dma-channels = <8>;
arch/arm/kernel/traps.c +7 -1
@@ -35,7 +35,13 @@#include <asm/tls.h> #include <asm/system_misc.h> -static const char *handler[]= {"prefetch abort" ,"data abort" ,"address exception" ,"interrupt" }; +static const char *handler[]= { +"prefetch abort" , +"data abort" , +"address exception" , +"interrupt" , +"undefined instruction" , +};void *vectors_page;
arch/arm/mach-footbridge/dc21285-timer.c +3 -2
@@ -96,11 +96,12 @@ static struct irqaction footbridge_timer_irq = {void __init footbridge_timer_init (void ) {struct clock_event_device *ce = &ckevt_dc21285; +unsigned rate =DIV_ROUND_CLOSEST (mem_fclk_21285,16 ); -clocksource_register_hz (&cksrc_dc21285, (mem_fclk_21285 +8 ) /16 ); +clocksource_register_hz (&cksrc_dc21285, rate);setup_irq (ce->irq, &footbridge_timer_irq); ce->cpumask =cpumask_of (smp_processor_id ()); -clockevents_config_and_register (ce, mem_fclk_21285,0x4 ,0xffffff ); +clockevents_config_and_register (ce, rate,0x4 ,0xffffff ); }
arch/arm/mach-shmobile/board-armadillo800eva.c +2 -2
@@ -482,7 +482,7 @@ static struct platform_device lcdc0_device = { .id = 0, .dev = { .platform_data = &lcdc0_info, - .coherent_dma_mask = ~0, + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
@@ -579,7 +579,7 @@ static struct platform_device hdmi_lcdc_device = { .id = 1, .dev = { .platform_data = &hdmi_lcdc_info, - .coherent_dma_mask = ~0, + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
arch/arm/mach-shmobile/board-kzm9g.c +1 -1
@@ -334,7 +334,7 @@ static struct platform_device lcdc_device = { .resource = lcdc_resources, .dev = { .platform_data = &lcdc_info, - .coherent_dma_mask = ~0, + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
arch/arm/mach-shmobile/board-mackerel.c +2 -2
@@ -409,7 +409,7 @@ static struct platform_device lcdc_device = { .resource = lcdc_resources, .dev = { .platform_data = &lcdc_info, - .coherent_dma_mask = ~0, + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
@@ -499,7 +499,7 @@ static struct platform_device hdmi_lcdc_device = { .id = 1, .dev = { .platform_data = &hdmi_lcdc_info, - .coherent_dma_mask = ~0, + .coherent_dma_mask = DMA_BIT_MASK(32), }, };
arch/arm/mm/flush.c +3 -3
@@ -175,16 +175,16 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)unsigned long i;if (cache_is_vipt_nonaliasing ()) {for (i =0 ; i < (1 <<compound_order (page)); i++) { -void *addr =kmap_atomic (page); +void *addr =kmap_atomic (page + i);__cpuc_flush_dcache_area (addr,PAGE_SIZE );kunmap_atomic (addr); } }else {for (i =0 ; i < (1 <<compound_order (page)); i++) { -void *addr =kmap_high_get (page); +void *addr =kmap_high_get (page + i);if (addr) {__cpuc_flush_dcache_area (addr,PAGE_SIZE ); -kunmap_high (page); +kunmap_high (page + i); } } }
arch/parisc/include/asm/cacheflush.h +4 -8
@@ -125,42 +125,38 @@ flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmavoid mark_rodata_ro (void );#endif -#ifdef CONFIG_PA8X00 -/* Only pa8800, pa8900 needs this */ -#include <asm/kmap_types.h> #define ARCH_HAS_KMAP -void kunmap_parisc (void *addr); -static inline void *kmap (struct page *page) {might_sleep (); +flush_dcache_page (page);return page_address (page); }static inline void kunmap (struct page *page) { -kunmap_parisc (page_address (page)); +flush_kernel_dcache_page_addr (page_address (page)); }static inline void *kmap_atomic (struct page *page) {pagefault_disable (); +flush_dcache_page (page);return page_address (page); }static inline void __kunmap_atomic (void *addr) { -kunmap_parisc (addr); +flush_kernel_dcache_page_addr (addr);pagefault_enable (); }#define kmap_atomic_prot (page, prot) kmap_atomic(page)#define kmap_atomic_pfn (pfn) kmap_atomic(pfn_to_page(pfn))#define kmap_atomic_to_page (ptr) virt_to_page(ptr) -#endif #endif /* _PARISC_CACHEFLUSH_H */
arch/parisc/include/asm/page.h +2 -3
@@ -28,9 +28,8 @@ struct page;void clear_page_asm (void *page);void copy_page_asm (void *to,void *from); -void clear_user_page (void *vto,unsigned long vaddr,struct page *pg); -void copy_user_page (void *vto,void *vfrom,unsigned long vaddr, -struct page *pg); +#define clear_user_page (vto, vaddr, page) clear_page_asm(vto) +#define copy_user_page (vto, vfrom, vaddr, page) copy_page_asm(vto, vfrom)/* #define CONFIG_PARISC_TMPALIAS */
arch/parisc/kernel/cache.c +0 -35
@@ -388,41 +388,6 @@ void flush_kernel_dcache_page_addr(void *addr) }EXPORT_SYMBOL (flush_kernel_dcache_page_addr); -void clear_user_page (void *vto,unsigned long vaddr,struct page *page) -{ -clear_page_asm (vto); -if (!parisc_requires_coherency ()) -flush_kernel_dcache_page_asm (vto); -} -EXPORT_SYMBOL (clear_user_page); - -void copy_user_page (void *vto,void *vfrom,unsigned long vaddr, -struct page *pg) -{ -/* Copy using kernel mapping. No coherency is needed -(all in kmap/kunmap) on machines that don't support -non-equivalent aliasing. However, the `from' page -needs to be flushed before it can be accessed through -the kernel mapping. */ -preempt_disable (); -flush_dcache_page_asm (__pa (vfrom), vaddr); -preempt_enable (); -copy_page_asm (vto, vfrom); -if (!parisc_requires_coherency ()) -flush_kernel_dcache_page_asm (vto); -} -EXPORT_SYMBOL (copy_user_page); - -#ifdef CONFIG_PA8X00 - -void kunmap_parisc (void *addr) -{ -if (parisc_requires_coherency ()) -flush_kernel_dcache_page_addr (addr); -} -EXPORT_SYMBOL (kunmap_parisc); -#endif -void purge_tlb_entries (struct mm_struct *mm,unsigned long addr) {unsigned long flags;
arch/x86/include/asm/fpu-internal.h +7 -6
@@ -293,12 +293,13 @@ static inline int restore_fpu_checking(struct task_struct *tsk)/* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is pending. Clear the x87 state here by setting it to fixed values. "m" is a random variable that should be in L1 */ - alternative_input( - ASM_NOP8 ASM_NOP2, -"emms\n\t" /* clear stack tags */ -"fildl %P[addr]" ,/* set F?P to defined value */ - X86_FEATURE_FXSAVE_LEAK, - [addr] "m" (tsk->thread.fpu.has_fpu)); +if (unlikely (static_cpu_has (X86_FEATURE_FXSAVE_LEAK ))) { + asmvolatile ( +"fnclex\n\t" +"emms\n\t" +"fildl %P[addr]" /* set F?P to defined value */ + : : [addr]"m" (tsk->thread.fpu.has_fpu)); + }return fpu_restore_checking (&tsk->thread.fpu); }
drivers/acpi/battery.c +20 -1
@@ -68,6 +68,7 @@ MODULE_AUTHOR("Alexey Starikovskiy <[email protected]>");MODULE_DESCRIPTION ("ACPI Battery Driver" );MODULE_LICENSE ("GPL" ); +static int battery_bix_broken_package;static unsigned int cache_time =1000 ;module_param (cache_time, uint,0644 );MODULE_PARM_DESC (cache_time,"cache time in milliseconds" );
@@ -443,7 +444,12 @@ static int acpi_battery_get_info(struct acpi_battery *battery)ACPI_EXCEPTION ((AE_INFO , status,"Evaluating %s" , name));return -ENODEV ; } -if (test_bit (ACPI_BATTERY_XINFO_PRESENT , &battery->flags)) + +if (battery_bix_broken_package) + result =extract_package (battery, buffer.pointer, + extended_info_offsets +1 , +ARRAY_SIZE (extended_info_offsets) -1 ); +else if (test_bit (ACPI_BATTERY_XINFO_PRESENT , &battery->flags)) result =extract_package (battery, buffer.pointer, extended_info_offsets,ARRAY_SIZE (extended_info_offsets));
@@ -1054,6 +1060,17 @@ static int battery_notify(struct notifier_block *nb,return 0 ; } +static struct dmi_system_id bat_dmi_table[] = { + { + .ident ="NEC LZ750/LS" , + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"NEC" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"PC-LZ750LS" ), + }, + }, + {}, +}; +static int acpi_battery_add (struct acpi_device *device) {int result =0 ;
@@ -1163,6 +1180,8 @@ static void __init acpi_battery_init_async(void *unused, async_cookie_t cookie)if (!acpi_battery_dir)return ;#endif +if (dmi_check_system (bat_dmi_table)) + battery_bix_broken_package =1 ;if (acpi_bus_register_driver (&acpi_battery_driver) <0 ) {#ifdef CONFIG_ACPI_PROCFS_POWER acpi_unlock_battery_dir (acpi_battery_dir);
drivers/ata/ahci.c +3 -0
@@ -427,6 +427,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9125), .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_MARVELL_EXT, 0x9178, + PCI_VENDOR_ID_MARVELL_EXT, 0x9170), + .driver_data = board_ahci_yes_fbs }, /* 88se9170 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a), .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172),
drivers/char/tpm/tpm_ppi.c +9 -6
@@ -27,15 +27,18 @@ static char *tpm_device_name = "TPM";static acpi_status ppi_callback (acpi_handle handle,u32 level,void *context,void **return_value) { -acpi_status status; +acpi_status status =AE_OK ;struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER ,NULL }; - status =acpi_get_name (handle,ACPI_FULL_PATHNAME , &buffer); -if (strstr (buffer.pointer, context) !=NULL ) { - *return_value = handle; + +if (ACPI_SUCCESS (acpi_get_name (handle,ACPI_FULL_PATHNAME , &buffer))) { +if (strstr (buffer.pointer, context) !=NULL ) { + *return_value = handle; + status =AE_CTRL_TERMINATE ; + }kfree (buffer.pointer); -return AE_CTRL_TERMINATE ; } -return AE_OK ; + +return status; } static inline void ppi_assign_params(union acpi_object params[4],
drivers/clk/clk-divider.c +1 -1
@@ -87,7 +87,7 @@ static unsigned int _get_table_val(const struct clk_div_table *table,return 0 ; } -static unsigned int _get_val (struct clk_divider *divider,u8 div) +static unsigned int _get_val (struct clk_divider *divider,unsigned int div) {if (divider->flags &CLK_DIVIDER_ONE_BASED )return div;
drivers/clk/samsung/clk-exynos4.c +1 -1
@@ -39,7 +39,7 @@#define SRC_TOP1 0xc214#define SRC_CAM 0xc220#define SRC_TV 0xc224 -#define SRC_MFC 0xcc28 +#define SRC_MFC 0xc228#define SRC_G3D 0xc22c#define E4210_SRC_IMAGE 0xc230#define SRC_LCD0 0xc234
drivers/clk/samsung/clk-exynos5250.c +9 -5
@@ -25,6 +25,7 @@#define MPLL_LOCK 0x4000#define MPLL_CON0 0x4100#define SRC_CORE1 0x4204 +#define GATE_IP_ACP 0x8800#define CPLL_LOCK 0x10020#define EPLL_LOCK 0x10030#define VPLL_LOCK 0x10040
@@ -75,7 +76,6 @@#define SRC_CDREX 0x20200#define PLL_DIV2_SEL 0x20a24#define GATE_IP_DISP1 0x10928 -#define GATE_IP_ACP 0x10000/* list of PLLs to be registered */ enum exynos5250_plls {
@@ -120,7 +120,8 @@ enum exynos5250_clks { spi2, i2s1, i2s2, pcm1, pcm2, pwm, spdif, ac97, hsi2c0, hsi2c1, hsi2c2, hsi2c3, chipid, sysreg, pmu, cmu_top, cmu_core, cmu_mem, tzpc0, tzpc1, tzpc2, tzpc3, tzpc4, tzpc5, tzpc6, tzpc7, tzpc8, tzpc9, hdmi_cec, mct, - wdt, rtc, tmu, fimd1, mie1, dsim0, dp, mixer, hdmi, g2d, + wdt, rtc, tmu, fimd1, mie1, dsim0, dp, mixer, hdmi, g2d, mdma0, + smmu_mdma0,/* mux clocks */ mout_hdmi = 1024,
@@ -354,8 +355,8 @@ static struct samsung_gate_clock exynos5250_gate_clks[] __initdata = {GATE (smmu_gscl2,"smmu_gscl2" ,"aclk266" ,GATE_IP_GSCL ,9 ,0 ,0 ),GATE (smmu_gscl3,"smmu_gscl3" ,"aclk266" ,GATE_IP_GSCL ,10 ,0 ,0 ),GATE (mfc,"mfc" ,"aclk333" ,GATE_IP_MFC ,0 ,0 ,0 ), -GATE (smmu_mfcl,"smmu_mfcl" ,"aclk333" ,GATE_IP_MFC ,1 ,0 ,0 ), -GATE (smmu_mfcr,"smmu_mfcr" ,"aclk333" ,GATE_IP_MFC ,2 ,0 ,0 ), +GATE (smmu_mfcl,"smmu_mfcl" ,"aclk333" ,GATE_IP_MFC ,2 ,0 ,0 ), +GATE (smmu_mfcr,"smmu_mfcr" ,"aclk333" ,GATE_IP_MFC ,1 ,0 ,0 ),GATE (rotator,"rotator" ,"aclk266" ,GATE_IP_GEN ,1 ,0 ,0 ),GATE (jpeg,"jpeg" ,"aclk166" ,GATE_IP_GEN ,2 ,0 ,0 ), GATE(mdma1, "mdma1", "aclk266", GATE_IP_GEN, 4, 0, 0),
@@ -406,7 +407,8 @@ static struct samsung_gate_clock exynos5250_gate_clks[] __initdata = {GATE (hsi2c2,"hsi2c2" ,"aclk66" ,GATE_IP_PERIC ,30 ,0 ,0 ),GATE (hsi2c3,"hsi2c3" ,"aclk66" ,GATE_IP_PERIC ,31 ,0 ,0 ),GATE (chipid,"chipid" ,"aclk66" ,GATE_IP_PERIS ,0 ,0 ,0 ), -GATE (sysreg,"sysreg" ,"aclk66" ,GATE_IP_PERIS ,1 ,0 ,0 ), +GATE (sysreg,"sysreg" ,"aclk66" , +GATE_IP_PERIS ,1 ,CLK_IGNORE_UNUSED ,0 ),GATE (pmu,"pmu" ,"aclk66" ,GATE_IP_PERIS ,2 ,CLK_IGNORE_UNUSED ,0 ),GATE (tzpc0,"tzpc0" ,"aclk66" ,GATE_IP_PERIS ,6 ,0 ,0 ), GATE(tzpc1, "tzpc1", "aclk66", GATE_IP_PERIS, 7, 0, 0),
@@ -492,6 +494,8 @@ static struct samsung_gate_clock exynos5250_gate_clks[] __initdata = {GATE (mixer,"mixer" ,"mout_aclk200_disp1" ,GATE_IP_DISP1 ,5 ,0 ,0 ),GATE (hdmi,"hdmi" ,"mout_aclk200_disp1" ,GATE_IP_DISP1 ,6 ,0 ,0 ),GATE (g2d,"g2d" ,"aclk200" ,GATE_IP_ACP ,3 ,0 ,0 ), +GATE (mdma0,"mdma0" ,"aclk266" ,GATE_IP_ACP ,1 ,0 ,0 ), + GATE(smmu_mdma0, "smmu_mdma0", "aclk266", GATE_IP_ACP, 5, 0, 0), }; static struct samsung_pll_rate_table vpll_24mhz_tbl[] __initdata = {
drivers/cpufreq/intel_pstate.c +2 -1
@@ -518,7 +518,8 @@ static void intel_pstate_timer_func(unsigned long __data) }#define ICPU (model, policy) \ - { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&policy } + { X86_VENDOR_INTEL, 6, model, X86_FEATURE_APERFMPERF,\ + (unsigned long)&policy }static const struct x86_cpu_id intel_pstate_cpu_ids[] = {ICPU (0x2a , default_policy),
drivers/gpu/drm/nouveau/core/subdev/bios/init.c +5 -1
@@ -1294,7 +1294,11 @@ init_jump(struct nvbios_init *init)u16 offset =nv_ro16 (bios, init->offset +1 );trace ("JUMP\t0x%04x\n" , offset); - init->offset = offset; + +if (init_exec (init)) + init->offset = offset; +else + init->offset +=3 ; }/**
drivers/leds/leds-lp5521.c +4 -8
@@ -244,18 +244,12 @@ static int lp5521_update_program_memory(struct lp55xx_chip *chip,if (i %2 ) goto err; -mutex_lock (&chip->lock); -for (i =0 ; i <LP5521_PROGRAM_LENGTH ; i++) { ret =lp55xx_write (chip, addr[idx] + i, pattern[i]); -if (ret) { -mutex_unlock (&chip->lock); +if (ret)return -EINVAL ; - } } -mutex_unlock (&chip->lock); -return size; err:
@@ -427,15 +421,17 @@ static ssize_t store_engine_load(struct device *dev, {struct lp55xx_led *led =i2c_get_clientdata (to_i2c_client (dev));struct lp55xx_chip *chip = led->chip; +int ret;mutex_lock (&chip->lock); chip->engine_idx = nr;lp5521_load_engine (chip); + ret =lp5521_update_program_memory (chip, buf, len);mutex_unlock (&chip->lock); -return lp5521_update_program_memory (chip, buf, len); +return ret; } store_load(1)store_load (2 )
drivers/leds/leds-lp5523.c +4 -8
@@ -336,18 +336,12 @@ static int lp5523_update_program_memory(struct lp55xx_chip *chip,if (i %2 ) goto err; -mutex_lock (&chip->lock); -for (i =0 ; i <LP5523_PROGRAM_LENGTH ; i++) { ret =lp55xx_write (chip,LP5523_REG_PROG_MEM + i, pattern[i]); -if (ret) { -mutex_unlock (&chip->lock); +if (ret)return -EINVAL ; - } } -mutex_unlock (&chip->lock); -return size; err:
@@ -547,15 +541,17 @@ static ssize_t store_engine_load(struct device *dev, {struct lp55xx_led *led =i2c_get_clientdata (to_i2c_client (dev));struct lp55xx_chip *chip = led->chip; +int ret;mutex_lock (&chip->lock); chip->engine_idx = nr;lp5523_load_engine_and_select_page (chip); + ret =lp5523_update_program_memory (chip, buf, len);mutex_unlock (&chip->lock); -return lp5523_update_program_memory (chip, buf, len); +return ret; } store_load(1)store_load (2 )
drivers/mfd/rtsx_pcr.c +8 -2
@@ -1230,8 +1230,14 @@ static void rtsx_pci_remove(struct pci_dev *pcidev) pcr->remove_pci = true; -cancel_delayed_work (&pcr->carddet_work); -cancel_delayed_work (&pcr->idle_work); +/* Disable interrupts at the pcr level */ +spin_lock_irq (&pcr->lock); +rtsx_pci_writel (pcr,RTSX_BIER ,0 ); + pcr->bier =0 ; +spin_unlock_irq (&pcr->lock); + +cancel_delayed_work_sync (&pcr->carddet_work); +cancel_delayed_work_sync (&pcr->idle_work);mfd_remove_devices (&pcidev->dev);
drivers/net/ethernet/arc/emac_main.c +2 -2
@@ -565,6 +565,8 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)/* Make sure pointer to data buffer is set */ wmb (); +skb_tx_timestamp (skb); + *info =cpu_to_le32 (FOR_EMAC |FIRST_OR_LAST_MASK | len);/* Increment index to point to the next BD */
@@ -579,8 +581,6 @@ static int arc_emac_tx(struct sk_buff *skb, struct net_device *ndev)arc_reg_set (priv,R_STATUS ,TXPL_MASK ); -skb_tx_timestamp (skb); -return NETDEV_TX_OK ; }
drivers/net/ethernet/broadcom/tg3.c +3 -0
@@ -16485,6 +16485,9 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)/* Clear this out for sanity. */ tw32 (TG3PCI_MEM_WIN_BASE_ADDR ,0 ); +/* Clear TG3PCI_REG_BASE_ADDR to prevent hangs. */ +tw32 (TG3PCI_REG_BASE_ADDR ,0 ); +pci_read_config_dword (tp->pdev,TG3PCI_PCISTATE , &pci_state_reg); if ((pci_state_reg & PCISTATE_CONV_PCI_MODE) == 0 &&
drivers/net/ethernet/freescale/fec_main.c +2 -2
@@ -425,6 +425,8 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)/* If this was the last BD in the ring, start at the beginning again. */ bdp =fec_enet_get_nextdesc (bdp, fep); +skb_tx_timestamp (skb); + fep->cur_tx = bdp;if (fep->cur_tx == fep->dirty_tx)
@@ -433,8 +435,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)/* Trigger transmission start */ writel (0 , fep->hwp +FEC_X_DES_ACTIVE ); -skb_tx_timestamp (skb); -return NETDEV_TX_OK ; }
drivers/net/ethernet/ibm/ehea/ehea_main.c +1 -1
@@ -3033,7 +3033,7 @@ static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, dev->hw_features =NETIF_F_SG |NETIF_F_TSO |NETIF_F_IP_CSUM |NETIF_F_HW_VLAN_CTAG_TX ; - dev->features =NETIF_F_SG |NETIF_F_FRAGLIST |NETIF_F_TSO | + dev->features =NETIF_F_SG |NETIF_F_TSO |NETIF_F_HIGHDMA |NETIF_F_IP_CSUM |NETIF_F_HW_VLAN_CTAG_TX |NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_CTAG_FILTER |NETIF_F_RXCSUM ;
drivers/net/ethernet/sfc/efx.c +7 -1
@@ -585,7 +585,7 @@ static void efx_start_datapath(struct efx_nic *efx)EFX_MAX_FRAME_LEN (efx->net_dev->mtu) + efx->type->rx_buffer_padding); rx_buf_len = (sizeof (struct efx_rx_page_state ) + -NET_IP_ALIGN + efx->rx_dma_len); + efx->rx_ip_align + efx->rx_dma_len);if (rx_buf_len <=PAGE_SIZE ) { efx->rx_scatter = efx->type->always_rx_scatter; efx->rx_buffer_order =0 ;
@@ -645,6 +645,8 @@ static void efx_start_datapath(struct efx_nic *efx)WARN_ON (channel->rx_pkt_n_frags); } +efx_ptp_start_datapath (efx); +if (netif_device_present (efx->net_dev))netif_tx_wake_all_queues (efx->net_dev); }
@@ -659,6 +661,8 @@ static void efx_stop_datapath(struct efx_nic *efx)EFX_ASSERT_RESET_SERIALISED (efx);BUG_ON (efx->port_enabled); +efx_ptp_stop_datapath (efx); +/* Stop RX refill */ efx_for_each_channel (channel, efx) {efx_for_each_channel_rx_queue (rx_queue, channel)
@@ -2550,6 +2554,8 @@ static int efx_init_struct(struct efx_nic *efx, efx->net_dev = net_dev; efx->rx_prefix_size = efx->type->rx_prefix_size; + efx->rx_ip_align = +NET_IP_ALIGN ? (efx->rx_prefix_size +NET_IP_ALIGN ) %4 :0 ; efx->rx_packet_hash_offset = efx->type->rx_hash_offset - efx->type->rx_prefix_size;spin_lock_init (&efx->stats_lock);
drivers/net/ethernet/sfc/mcdi.c +29 -10
@@ -50,6 +50,7 @@ struct efx_mcdi_async_param {static void efx_mcdi_timeout_async (unsigned long context);static int efx_mcdi_drv_attach (struct efx_nic *efx,bool driver_operating,bool *was_attached_out); +static bool efx_mcdi_poll_once (struct efx_nic *efx);static inline struct efx_mcdi_iface *efx_mcdi (struct efx_nic *efx) {
@@ -237,6 +238,21 @@ static void efx_mcdi_read_response_header(struct efx_nic *efx) } } +static bool efx_mcdi_poll_once (struct efx_nic *efx) +{ +struct efx_mcdi_iface *mcdi =efx_mcdi (efx); + +rmb (); +if (!efx->type->mcdi_poll_response (efx)) +return false; + +spin_lock_bh (&mcdi->iface_lock); +efx_mcdi_read_response_header (efx); +spin_unlock_bh (&mcdi->iface_lock); + +return true; +} +static int efx_mcdi_poll (struct efx_nic *efx) {struct efx_mcdi_iface *mcdi =efx_mcdi (efx);
@@ -272,18 +288,13 @@ static int efx_mcdi_poll(struct efx_nic *efx) time = jiffies; -rmb (); -if (efx->type->mcdi_poll_response (efx)) +if (efx_mcdi_poll_once (efx))break ;if (time_after (time, finish))return -ETIMEDOUT ; } -spin_lock_bh (&mcdi->iface_lock); -efx_mcdi_read_response_header (efx); -spin_unlock_bh (&mcdi->iface_lock); -/* Return rc=0 like wait_event_timeout() */ return 0 ; }
@@ -619,6 +630,16 @@ int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, rc =efx_mcdi_await_completion (efx);if (rc !=0 ) { +netif_err (efx, hw, efx->net_dev, +"MC command 0x%x inlen %d mode %d timed out\n" , + cmd, (int )inlen, mcdi->mode); + +if (mcdi->mode ==MCDI_MODE_EVENTS &&efx_mcdi_poll_once (efx)) { +netif_err (efx, hw, efx->net_dev, +"MCDI request was completed without an event\n" ); + rc =0 ; + } +/* Close the race with efx_mcdi_ev_cpl() executing just too late * and completing a request we've just cancelled, by ensuring * that the seqno check therein fails.
@@ -627,11 +648,9 @@ int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, ++mcdi->seqno; ++mcdi->credits;spin_unlock_bh (&mcdi->iface_lock); + } -netif_err (efx, hw, efx->net_dev, -"MC command 0x%x inlen %d mode %d timed out\n" , - cmd, (int )inlen, mcdi->mode); - }else { +if (rc ==0 ) {size_t hdr_len, data_len;/* At the very least we need a memory barrier here to ensure
drivers/net/ethernet/sfc/net_driver.h +3 -0
@@ -673,6 +673,8 @@ struct vfdi_status;* @n_channels: Number of channels in use * @n_rx_channels: Number of channels used for RX (= number of RX queues) * @n_tx_channels: Number of channels used for TX +* @rx_ip_align: RX DMA address offset to have IP header aligned in +* in accordance with NET_IP_ALIGN * @rx_dma_len: Current maximum RX DMA length * @rx_buffer_order: Order (log2) of number of pages for each RX buffer * @rx_buffer_truesize: Amortised allocation size of an RX buffer,
@@ -806,6 +808,7 @@ struct efx_nic {unsigned rss_spread;unsigned tx_channel_offset;unsigned n_tx_channels; +unsigned int rx_ip_align;unsigned int rx_dma_len;unsigned int rx_buffer_order;unsigned int rx_buffer_truesize;
drivers/net/ethernet/sfc/nic.h +2 -0
@@ -528,6 +528,8 @@ extern void efx_ptp_get_ts_info(struct efx_nic *efx,extern bool efx_ptp_is_ptp_tx (struct efx_nic *efx,struct sk_buff *skb);extern int efx_ptp_tx (struct efx_nic *efx,struct sk_buff *skb);extern void efx_ptp_event (struct efx_nic *efx,efx_qword_t *ev); +void efx_ptp_start_datapath (struct efx_nic *efx); +void efx_ptp_stop_datapath (struct efx_nic *efx);extern const struct efx_nic_type falcon_a1_nic_type;extern const struct efx_nic_type falcon_b0_nic_type;
drivers/net/ethernet/sfc/ptp.c +57 -9
161 lines not on this page · raw message
drivers/net/ethernet/sfc/rx.c +3 -3
@@ -93,7 +93,7 @@ static inline void efx_sync_rx_buffer(struct efx_nic *efx,void efx_rx_config_page_split (struct efx_nic *efx) { - efx->rx_page_buf_step =ALIGN (efx->rx_dma_len +NET_IP_ALIGN , + efx->rx_page_buf_step =ALIGN (efx->rx_dma_len + efx->rx_ip_align,EFX_RX_BUF_ALIGNMENT ); efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 : ((PAGE_SIZE - sizeof(struct efx_rx_page_state)) /
@@ -188,9 +188,9 @@ static int efx_init_rx_buffers(struct efx_rx_queue *rx_queue) do { index = rx_queue->added_count & rx_queue->ptr_mask; rx_buf = efx_rx_buffer(rx_queue, index); - rx_buf->dma_addr = dma_addr + NET_IP_ALIGN; + rx_buf->dma_addr = dma_addr + efx->rx_ip_align; rx_buf->page = page; - rx_buf->page_offset = page_offset + NET_IP_ALIGN; + rx_buf->page_offset = page_offset + efx->rx_ip_align; rx_buf->len = efx->rx_dma_len; rx_buf->flags = 0; ++rx_queue->added_count;
drivers/net/ethernet/tehuti/tehuti.c +0 -1
@@ -2019,7 +2019,6 @@ bdx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ndev->features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO |NETIF_F_HW_VLAN_CTAG_TX |NETIF_F_HW_VLAN_CTAG_RX |NETIF_F_HW_VLAN_CTAG_FILTER |NETIF_F_RXCSUM -/*| NETIF_F_FRAGLIST */ ; ndev->hw_features =NETIF_F_IP_CSUM |NETIF_F_SG |NETIF_F_TSO |NETIF_F_HW_VLAN_CTAG_TX ;
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -1
@@ -1016,7 +1016,7 @@ static int temac_of_probe(struct platform_device *op)platform_set_drvdata (op, ndev);SET_NETDEV_DEV (ndev, &op->dev); ndev->flags &= ~IFF_MULTICAST ;/* clear multicast */ - ndev->features =NETIF_F_SG |NETIF_F_FRAGLIST ; + ndev->features =NETIF_F_SG ; ndev->netdev_ops = &temac_netdev_ops; ndev->ethtool_ops = &temac_ethtool_ops;#if 0
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -1
@@ -1486,7 +1486,7 @@ static int axienet_of_probe(struct platform_device *op)SET_NETDEV_DEV (ndev, &op->dev); ndev->flags &= ~IFF_MULTICAST ;/* clear multicast */ - ndev->features =NETIF_F_SG |NETIF_F_FRAGLIST ; + ndev->features =NETIF_F_SG ; ndev->netdev_ops = &axienet_netdev_ops; ndev->ethtool_ops = &axienet_ethtool_ops;
drivers/net/hamradio/hdlcdrv.c +2 -0
@@ -571,6 +571,8 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)case HDLCDRVCTL_CALIBRATE :if (!capable (CAP_SYS_RAWIO ))return -EPERM ; +if (bi.data.calibrate >INT_MAX / s->par.bitrate) +return -EINVAL ; s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate /16 ;return 0 ;
drivers/net/hamradio/yam.c +1 -0
@@ -1057,6 +1057,7 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)break ;case SIOCYAMGCFG : +memset (&yi,0 ,sizeof (yi)); yi.cfg.mask =0xffffffff ; yi.cfg.iobase = yp->iobase; yi.cfg.irq = yp->irq;
drivers/net/hyperv/netvsc_drv.c +0 -1
@@ -327,7 +327,6 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)return -EINVAL ; nvdev->start_remove = true; -cancel_delayed_work_sync (&ndevctx->dwork);cancel_work_sync (&ndevctx->work);netif_tx_disable (ndev);rndis_filter_device_remove (hdev);
drivers/net/macvtap.c +8 -15
@@ -767,11 +767,10 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,const struct sk_buff *skb, const struct iovec *iv, int len) { - struct macvlan_dev *vlan; int ret;int vnet_hdr_len =0 ;int vlan_offset =0 ; -int copied; +int copied, total;if (q->flags &IFF_VNET_HDR ) {struct virtio_net_hdr vnet_hdr;
@@ -786,7 +785,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,if (memcpy_toiovecend (iv, (void *)&vnet_hdr,0 ,sizeof (vnet_hdr)))return -EFAULT ; } - copied = vnet_hdr_len; + total = copied = vnet_hdr_len; + total += skb->len;if (!vlan_tx_tag_present (skb)) len =min_t (int, skb->len, len);
@@ -801,6 +801,7 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, vlan_offset = offsetof(struct vlan_ethhdr , h_vlan_proto); len =min_t (int, skb->len +VLAN_HLEN , len); + total +=VLAN_HLEN ; copy =min_t (int, vlan_offset, len); ret =skb_copy_datagram_const_iovec (skb,0 , iv, copied, copy);
@@ -818,19 +819,9 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, } ret =skb_copy_datagram_const_iovec (skb, vlan_offset, iv, copied, len); - copied += len; done: -rcu_read_lock (); - vlan =rcu_dereference (q->vlan); -if (vlan) { -preempt_disable (); -macvlan_count_rx (vlan, copied - vnet_hdr_len, ret ==0 ,0 ); -preempt_enable (); - } -rcu_read_unlock (); - -return ret ? ret : copied; +return ret ? ret : total; } static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
@@ -885,7 +876,9 @@ static ssize_t macvtap_aio_read(struct kiocb *iocb, const struct iovec *iv, } ret =macvtap_do_read (q, iocb, iv, len, file->f_flags &O_NONBLOCK ); - ret =min_t (ssize_t, ret, len);/* XXX copied from tun.c. Why? */ + ret =min_t (ssize_t, ret, len); +if (ret >0 ) + iocb->ki_pos = ret; out:return ret; }
drivers/net/tun.c +11 -7
@@ -1184,7 +1184,7 @@ static ssize_t tun_put_user(struct tun_struct *tun, {struct tun_pi pi = {0 , skb->protocol };ssize_t total =0 ; -int vlan_offset =0 ; +int vlan_offset =0 , copied;if (!(tun->flags &TUN_NO_PI )) {if ((len -=sizeof (pi)) <0 )
@@ -1248,6 +1248,8 @@ static ssize_t tun_put_user(struct tun_struct *tun, total += tun->vnet_hdr_sz; } + copied = total; + total += skb->len;if (!vlan_tx_tag_present (skb)) { len =min_t (int, skb->len, len); }else {
@@ -1262,24 +1264,24 @@ static ssize_t tun_put_user(struct tun_struct *tun, vlan_offset = offsetof(struct vlan_ethhdr , h_vlan_proto); len =min_t (int, skb->len +VLAN_HLEN , len); + total +=VLAN_HLEN ; copy =min_t (int, vlan_offset, len); - ret =skb_copy_datagram_const_iovec (skb,0 , iv, total, copy); + ret =skb_copy_datagram_const_iovec (skb,0 , iv, copied, copy); len -= copy; - total += copy; + copied += copy;if (ret || !len) goto done; copy =min_t (int,sizeof (veth), len); - ret =memcpy_toiovecend (iv, (void *)&veth, total, copy); + ret =memcpy_toiovecend (iv, (void *)&veth, copied, copy); len -= copy; - total += copy; + copied += copy;if (ret || !len) goto done; } -skb_copy_datagram_const_iovec (skb, vlan_offset, iv, total, len); - total += len; +skb_copy_datagram_const_iovec (skb, vlan_offset, iv, copied, len); done: tun->dev->stats.tx_packets++;
@@ -1356,6 +1358,8 @@ static ssize_t tun_chr_aio_read(struct kiocb *iocb, const struct iovec *iv, ret =tun_do_read (tun, tfile, iocb, iv, len, file->f_flags &O_NONBLOCK ); ret =min_t (ssize_t, ret, len); +if (ret >0 ) + iocb->ki_pos = ret; out:tun_put (tun);return ret;
drivers/net/virtio_net.c +84 -35
171 lines not on this page · raw message
drivers/net/vxlan.c +1 -1
@@ -1672,7 +1672,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,netdev_dbg (dev,"circular route to %pI4\n" , &dst->sin.sin_addr.s_addr); dev->stats.collisions++; - goto tx_error; + goto rt_tx_error; }/* Bypass encapsulation if the destination is local */
drivers/scsi/sd.c +4 -1
@@ -2645,13 +2645,16 @@ static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer) }if (scsi_report_opcode (sdev, buffer,SD_BUF_SIZE ,INQUIRY ) <0 ) { +/* too large values might cause issues with arcmsr */ +int vpd_buf_len =64 ; + sdev->no_report_opcodes =1 ;/* Disable WRITE SAME if REPORT SUPPORTED OPERATION * CODES is unsupported and the device has an ATA * Information VPD page (SAT). */ -if (!scsi_get_vpd_page (sdev,0x89 , buffer,SD_BUF_SIZE )) +if (!scsi_get_vpd_page (sdev,0x89 , buffer, vpd_buf_len)) sdev->no_write_same =1 ; }
include/linux/net.h +1 -1
@@ -180,7 +180,7 @@ struct proto_ops { int offset, size_t size, int flags);ssize_t (*splice_read)(struct socket *sock,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags); -void (*set_peek_off)(struct sock *sk,int val); +int (*set_peek_off)(struct sock *sk,int val); };#define DECLARE_SOCKADDR (type, dst, src) \
include/linux/netdevice.h +22 -0
@@ -1872,6 +1872,15 @@ static inline int dev_parse_header(const struct sk_buff *skb,return dev->header_ops->parse (skb, haddr); } +static inline int dev_rebuild_header (struct sk_buff *skb) +{ +const struct net_device *dev = skb->dev; + +if (!dev->header_ops || !dev->header_ops->rebuild) +return 0 ; +return dev->header_ops->rebuild (skb); +} +typedef int gifconf_func_t (struct net_device * dev,char __user * bufptr,int len);extern int register_gifconf (unsigned int family,gifconf_func_t * gifconf);static inline int unregister_gifconf (unsigned int family)
@@ -2945,6 +2954,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev, dev->gso_max_size = size; } +static inline void skb_gso_error_unwind (struct sk_buff *skb,__be16 protocol, +int pulled_hlen,u16 mac_offset, +int mac_len) +{ + skb->protocol = protocol; + skb->encapsulation =1 ; +skb_push (skb, pulled_hlen); +skb_reset_transport_header (skb); + skb->mac_header = mac_offset; + skb->network_header = skb->mac_header + mac_len; + skb->mac_len = mac_len; +} +static inline bool netif_is_bond_master (struct net_device *dev) {return dev->flags &IFF_MASTER && dev->priv_flags &IFF_BONDING ;
include/linux/skbuff.h +5 -0
@@ -1638,6 +1638,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) skb->mac_header += offset; } +static inline void skb_pop_mac_header (struct sk_buff *skb) +{ + skb->mac_header = skb->network_header; +} +static inline void skb_probe_transport_header (struct sk_buff *skb,const int offset_hint) {
kernel/sched/core.c +8 -1
@@ -7277,7 +7277,12 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota) runtime_enabled = quota !=RUNTIME_INF ; runtime_was_enabled = cfs_b->quota !=RUNTIME_INF ; -account_cfs_bandwidth_used (runtime_enabled, runtime_was_enabled); +/* +* If we need to toggle cfs_bandwidth_used, off->on must occur +* before making related changes, and on->off must occur afterwards +*/ +if (runtime_enabled && !runtime_was_enabled) +cfs_bandwidth_usage_inc ();raw_spin_lock_irq (&cfs_b->lock); cfs_b->period =ns_to_ktime (period); cfs_b->quota = quota;
@@ -7303,6 +7308,8 @@ static int tg_set_cfs_bandwidth(struct task_group *tg, u64 period, u64 quota)unthrottle_cfs_rq (cfs_rq);raw_spin_unlock_irq (&rq->lock); } +if (runtime_was_enabled && !runtime_enabled) +cfs_bandwidth_usage_dec (); out_unlock:mutex_unlock (&cfs_constraints_mutex);
kernel/sched/fair.c +33 -15
94 lines not on this page · raw message
kernel/sched/sched.h +2 -1
@@ -1305,7 +1305,8 @@ extern void print_rt_stats(struct seq_file *m, int cpu);extern void init_cfs_rq (struct cfs_rq *cfs_rq);extern void init_rt_rq (struct rt_rq *rt_rq,struct rq *rq); -extern void account_cfs_bandwidth_used (int enabled,int was_enabled); +extern void cfs_bandwidth_usage_inc (void ); +extern void cfs_bandwidth_usage_dec (void );#ifdef CONFIG_NO_HZ_COMMON enum rq_nohz_flag_bits {
net/8021q/vlan_dev.c +18 -1
@@ -549,6 +549,23 @@ static const struct header_ops vlan_header_ops = { .parse = eth_header_parse, }; +static int vlan_passthru_hard_header (struct sk_buff *skb,struct net_device *dev, +unsigned short type, +const void *daddr,const void *saddr, +unsigned int len) +{ +struct vlan_dev_priv *vlan =vlan_dev_priv (dev); +struct net_device *real_dev = vlan->real_dev; + +return dev_hard_header (skb, real_dev, type, daddr, saddr, len); +} + +static const struct header_ops vlan_passthru_header_ops = { + .create = vlan_passthru_hard_header, + .rebuild = dev_rebuild_header, + .parse = eth_header_parse, +}; +static struct device_type vlan_type = { .name ="vlan" , };
@@ -592,7 +609,7 @@ static int vlan_dev_init(struct net_device *dev) dev->needed_headroom = real_dev->needed_headroom;if (real_dev->features &NETIF_F_HW_VLAN_CTAG_TX ) { - dev->header_ops = real_dev->header_ops; + dev->header_ops = &vlan_passthru_header_ops; dev->hard_header_len = real_dev->hard_header_len; }else { dev->header_ops = &vlan_header_ops;
net/bridge/br_multicast.c +2 -2
@@ -2004,7 +2004,7 @@ int br_multicast_set_hash_max(struct net_bridge *br, unsigned long val)u32 old;struct net_bridge_mdb_htable *mdb; -spin_lock (&br->multicast_lock); +spin_lock_bh (&br->multicast_lock);if (!netif_running (br->dev)) goto unlock;
@@ -2036,7 +2036,7 @@ rollback: } unlock: -spin_unlock (&br->multicast_lock); +spin_unlock_bh (&br->multicast_lock);return err; }
net/bridge/br_private.h +10 -0
@@ -442,6 +442,16 @@ extern netdev_features_t br_features_recompute(struct net_bridge *br,extern int br_handle_frame_finish (struct sk_buff *skb);extern rx_handler_result_t br_handle_frame (struct sk_buff **pskb); +static inline bool br_rx_handler_check_rcu (const struct net_device *dev) +{ +return rcu_dereference (dev->rx_handler) == br_handle_frame; +} + +static inline struct net_bridge_port *br_port_get_check_rcu (const struct net_device *dev) +{ +return br_rx_handler_check_rcu (dev) ?br_port_get_rcu (dev) :NULL ; +} +/* br_ioctl.c */ extern int br_dev_ioctl (struct net_device *dev,struct ifreq *rq,int cmd);extern int br_ioctl_deviceless_stub (struct net *net,unsigned int cmd,void __user *arg);
net/bridge/br_stp_bpdu.c +1 -1
@@ -153,7 +153,7 @@ void br_stp_rcv(const struct stp_proto *proto, struct sk_buff *skb,if (buf[0 ] !=0 || buf[1 ] !=0 || buf[2 ] !=0 ) goto err; - p =br_port_get_rcu (dev); + p =br_port_get_check_rcu (dev);if (!p) goto err;
net/core/drop_monitor.c +0 -1
@@ -64,7 +64,6 @@ static struct genl_family net_drop_monitor_family = { .hdrsize = 0, .name = "NET_DM", .version = 2, - .maxattr = NET_DM_CMD_MAX, }; static DEFINE_PER_CPU(struct per_cpu_dm_data, dm_cpu_data);
net/core/neighbour.c +1 -1
@@ -1274,7 +1274,7 @@ int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb)if (dev_hard_header (skb, dev,ntohs (skb->protocol),NULL ,NULL , skb->len) <0 && - dev->header_ops->rebuild (skb)) +dev_rebuild_header (skb))return 0 ;return dev_queue_xmit (skb);
net/core/netpoll.c +9 -2
@@ -386,8 +386,14 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, !vlan_hw_offload_capable(netif_skb_features(skb), skb->vlan_proto)) { skb =__vlan_put_tag (skb, skb->vlan_proto,vlan_tx_tag_get (skb)); -if (unlikely (!skb)) -break ; +if (unlikely (!skb)) { +/* This is actually a packet drop, but we +* don't want the code at the end of this +* function to try and re-queue a NULL skb. +*/ + status =NETDEV_TX_OK ; + goto unlock_txq; + } skb->vlan_tci =0 ; }
@@ -395,6 +401,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,if (status ==NETDEV_TX_OK )txq_trans_update (txq); } + unlock_txq:__netif_tx_unlock (txq);if (status ==NETDEV_TX_OK )
net/core/skbuff.c +1 -0
@@ -3541,6 +3541,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) skb->tstamp.tv64 =0 ; skb->pkt_type =PACKET_HOST ; skb->skb_iif =0 ; + skb->local_df =0 ;skb_dst_drop (skb); skb->mark =0 ;secpath_reset (skb);
net/core/sock.c +1 -1
@@ -888,7 +888,7 @@ set_rcvbuf:case SO_PEEK_OFF :if (sock->ops->set_peek_off) - sock->ops->set_peek_off (sk, val); + ret = sock->ops->set_peek_off (sk, val);else ret = -EOPNOTSUPP ;break ;
net/ipv4/fib_rules.c +4 -1
@@ -104,7 +104,10 @@ errout:static bool fib4_rule_suppress (struct fib_rule *rule,struct fib_lookup_arg *arg) {struct fib_result *result = (struct fib_result *) arg->result; -struct net_device *dev = result->fi->fib_dev; +struct net_device *dev =NULL ; + +if (result->fi) + dev = result->fi->fib_dev;/* do not accept result if the route does * not meet the required prefix length
net/ipv4/gre_offload.c +7 -4
@@ -28,6 +28,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,netdev_features_t enc_features;int ghl =GRE_HEADER_SECTION ;struct gre_base_hdr *greh; +u16 mac_offset = skb->mac_header;int mac_len = skb->mac_len;__be16 protocol = skb->protocol;int tnl_hlen;
@@ -57,13 +58,13 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, }else csum = false; +if (unlikely (!pskb_may_pull (skb, ghl))) + goto out; +/* setup inner skb. */ skb->protocol = greh->protocol; skb->encapsulation =0 ; -if (unlikely (!pskb_may_pull (skb, ghl))) - goto out; -__skb_pull (skb, ghl);skb_reset_mac_header (skb);skb_set_network_header (skb,skb_inner_network_offset (skb));
@@ -72,8 +73,10 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,/* segment inner packet. */ enc_features = skb->dev->hw_enc_features &netif_skb_features (skb); segs =skb_mac_gso_segment (skb, enc_features); -if (!segs ||IS_ERR (segs)) +if (!segs ||IS_ERR (segs)) { +skb_gso_error_unwind (skb, protocol, ghl, mac_offset, mac_len); goto out; + } skb = segs; tnl_hlen =skb_tnl_header_len (skb);
net/ipv4/inet_diag.c +16 -0
@@ -106,6 +106,10 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, r->id.idiag_sport = inet->inet_sport; r->id.idiag_dport = inet->inet_dport; + +memset (&r->id.idiag_src,0 ,sizeof (r->id.idiag_src)); +memset (&r->id.idiag_dst,0 ,sizeof (r->id.idiag_dst)); + r->id.idiag_src[0 ] = inet->inet_rcv_saddr; r->id.idiag_dst[0 ] = inet->inet_daddr;
@@ -240,12 +244,19 @@ static int inet_twsk_diag_fill(struct inet_timewait_sock *tw, r->idiag_family = tw->tw_family; r->idiag_retrans =0 ; + r->id.idiag_if = tw->tw_bound_dev_if;sock_diag_save_cookie (tw, r->id.idiag_cookie); + r->id.idiag_sport = tw->tw_sport; r->id.idiag_dport = tw->tw_dport; + +memset (&r->id.idiag_src,0 ,sizeof (r->id.idiag_src)); +memset (&r->id.idiag_dst,0 ,sizeof (r->id.idiag_dst)); + r->id.idiag_src[0 ] = tw->tw_rcv_saddr; r->id.idiag_dst[0 ] = tw->tw_daddr; + r->idiag_state = tw->tw_substate; r->idiag_timer =3 ; r->idiag_expires =DIV_ROUND_UP (tmo *1000 ,HZ );
@@ -732,8 +743,13 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, r->id.idiag_sport = inet->inet_sport; r->id.idiag_dport = ireq->rmt_port; + +memset (&r->id.idiag_src,0 ,sizeof (r->id.idiag_src)); +memset (&r->id.idiag_dst,0 ,sizeof (r->id.idiag_dst)); + r->id.idiag_src[0 ] = ireq->loc_addr; r->id.idiag_dst[0 ] = ireq->rmt_addr; + r->idiag_expires =jiffies_to_msecs (tmo); r->idiag_rqueue =0 ; r->idiag_wqueue =0 ;
net/ipv4/ip_gre.c +1 -0
@@ -217,6 +217,7 @@ static int ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi) iph->saddr, iph->daddr, tpi->key);if (tunnel) { +skb_pop_mac_header (skb);ip_tunnel_rcv (tunnel, skb, tpi, log_ecn_error);return PACKET_RCVD ; }
net/ipv4/udp.c +5 -1
@@ -2294,6 +2294,7 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, netdev_features_t features) {struct sk_buff *segs =ERR_PTR (-EINVAL ); +u16 mac_offset = skb->mac_header;int mac_len = skb->mac_len;int tnl_hlen =skb_inner_mac_header (skb) -skb_transport_header (skb);__be16 protocol = skb->protocol;
@@ -2313,8 +2314,11 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,/* segment inner packet. */ enc_features = skb->dev->hw_enc_features &netif_skb_features (skb); segs =skb_mac_gso_segment (skb, enc_features); -if (!segs ||IS_ERR (segs)) +if (!segs ||IS_ERR (segs)) { +skb_gso_error_unwind (skb, protocol, tnl_hlen, mac_offset, + mac_len); goto out; + } outer_hlen =skb_tnl_header_len (skb); skb = segs;
net/ipv4/udp_offload.c +19 -18
@@ -41,6 +41,14 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, {struct sk_buff *segs =ERR_PTR (-EINVAL );unsigned int mss; +int offset; +__wsum csum; + +if (skb->encapsulation && +skb_shinfo (skb)->gso_type &SKB_GSO_UDP_TUNNEL ) { + segs =skb_udp_tunnel_segment (skb, features); + goto out; + } mss =skb_shinfo (skb)->gso_size;if (unlikely (skb->len <= mss))
@@ -62,27 +70,20 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, goto out; } +/* Do software UFO. Complete and fill in the UDP checksum as +* HW cannot do checksum of UDP packets sent as multiple +* IP fragments. +*/ + offset =skb_checksum_start_offset (skb); + csum =skb_checksum (skb, offset, skb->len - offset,0 ); + offset += skb->csum_offset; + *(__sum16 *)(skb->data + offset) =csum_fold (csum); + skb->ip_summed =CHECKSUM_NONE ; +/* Fragment the skb. IP headers of the fragments are updated in * inet_gso_segment() */ -if (skb->encapsulation &&skb_shinfo (skb)->gso_type &SKB_GSO_UDP_TUNNEL ) - segs =skb_udp_tunnel_segment (skb, features); -else { -int offset; -__wsum csum; - -/* Do software UFO. Complete and fill in the UDP checksum as -* HW cannot do checksum of UDP packets sent as multiple -* IP fragments. -*/ - offset =skb_checksum_start_offset (skb); - csum =skb_checksum (skb, offset, skb->len - offset,0 ); - offset += skb->csum_offset; - *(__sum16 *)(skb->data + offset) =csum_fold (csum); - skb->ip_summed =CHECKSUM_NONE ; - - segs =skb_segment (skb, features); - } + segs =skb_segment (skb, features); out:return segs; }
net/ipv6/fib6_rules.c +5 -1
@@ -122,7 +122,11 @@ out:static bool fib6_rule_suppress (struct fib_rule *rule,struct fib_lookup_arg *arg) {struct rt6_info *rt = (struct rt6_info *) arg->result; -struct net_device *dev = rt->rt6i_idev->dev; +struct net_device *dev =NULL ; + +if (rt->rt6i_idev) + dev = rt->rt6i_idev->dev; +/* do not accept result if the route does * not meet the required prefix length */
net/ipv6/route.c +14 -20
@@ -84,6 +84,8 @@ static int ip6_dst_gc(struct dst_ops *ops);static int ip6_pkt_discard (struct sk_buff *skb);static int ip6_pkt_discard_out (struct sk_buff *skb); +static int ip6_pkt_prohibit (struct sk_buff *skb); +static int ip6_pkt_prohibit_out (struct sk_buff *skb);static void ip6_link_failure (struct sk_buff *skb);static void ip6_rt_update_pmtu (struct dst_entry *dst,struct sock *sk,struct sk_buff *skb,u32 mtu);
@@ -234,9 +236,6 @@ static const struct rt6_info ip6_null_entry_template = { #ifdef CONFIG_IPV6_MULTIPLE_TABLES -static int ip6_pkt_prohibit(struct sk_buff *skb); -static int ip6_pkt_prohibit_out(struct sk_buff *skb); - static const struct rt6_info ip6_prohibit_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1),
@@ -1570,21 +1569,24 @@ int ip6_route_add(struct fib6_config *cfg) goto out; } } - rt->dst.output = ip6_pkt_discard_out; - rt->dst.input = ip6_pkt_discard; rt->rt6i_flags =RTF_REJECT |RTF_NONEXTHOP ;switch (cfg->fc_type) {case RTN_BLACKHOLE : rt->dst.error = -EINVAL ; + rt->dst.output = dst_discard; + rt->dst.input = dst_discard;break ;case RTN_PROHIBIT : rt->dst.error = -EACCES ; + rt->dst.output = ip6_pkt_prohibit_out; + rt->dst.input = ip6_pkt_prohibit;break ;case RTN_THROW : - rt->dst.error = -EAGAIN ; -break ;default : - rt->dst.error = -ENETUNREACH ; + rt->dst.error = (cfg->fc_type ==RTN_THROW ) ? -EAGAIN + : -ENETUNREACH ; + rt->dst.output = ip6_pkt_discard_out; + rt->dst.input = ip6_pkt_discard;break ; } goto install_route;
@@ -1908,9 +1910,7 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort,else rt->rt6i_gateway = *dest; rt->rt6i_flags = ort->rt6i_flags; -if ((ort->rt6i_flags & (RTF_DEFAULT |RTF_ADDRCONF )) == - (RTF_DEFAULT |RTF_ADDRCONF )) -rt6_set_from (rt, ort); +rt6_set_from (rt, ort); rt->rt6i_metric =0 ;#ifdef CONFIG_IPV6_SUBTREES
@@ -2149,8 +2149,6 @@ static int ip6_pkt_discard_out(struct sk_buff *skb)return ip6_pkt_drop (skb,ICMPV6_NOROUTE ,IPSTATS_MIB_OUTNOROUTES ); } -#ifdef CONFIG_IPV6_MULTIPLE_TABLES -static int ip6_pkt_prohibit (struct sk_buff *skb) {return ip6_pkt_drop (skb,ICMPV6_ADM_PROHIBITED ,IPSTATS_MIB_INNOROUTES );
@@ -2162,8 +2160,6 @@ static int ip6_pkt_prohibit_out(struct sk_buff *skb)return ip6_pkt_drop (skb,ICMPV6_ADM_PROHIBITED ,IPSTATS_MIB_OUTNOROUTES ); } -#endif -/* * Allocate a dst for local (unicast / anycast) address. */
@@ -2173,12 +2169,10 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, bool anycast) {struct net *net =dev_net (idev->dev); -struct rt6_info *rt =ip6_dst_alloc (net, net->loopback_dev,0 ,NULL ); - -if (!rt) { -net_warn_ratelimited ("Maximum number of routes reached, consider increasing route/max_size\n" ); +struct rt6_info *rt =ip6_dst_alloc (net, net->loopback_dev, +DST_NOCOUNT ,NULL ); +if (!rt)return ERR_PTR (-ENOMEM ); - }in6_dev_hold (idev);
net/ipv6/udp_offload.c +1 -1
@@ -88,7 +88,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,/* Check if there is enough headroom to insert fragment header. */ tnl_hlen =skb_tnl_header_len (skb); -if (skb->mac_header < (tnl_hlen + frag_hdr_sz)) { +if (skb_mac_header (skb) < skb->head + tnl_hlen + frag_hdr_sz) {if (gso_pskb_expand_head (skb, tnl_hlen + frag_hdr_sz)) goto out; }
net/llc/af_llc.c +3 -2
@@ -715,7 +715,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,unsigned long cpu_flags;size_t copied =0 ;u32 peek_seq =0 ; -u32 *seq; +u32 *seq, skb_len;unsigned long used;int target;/* Read at least this many bytes */ long timeo;
@@ -812,6 +812,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, }continue ; found_ok_skb: + skb_len = skb->len;/* Ok so how much can we use? */ used = skb->len - offset;if (len < used)
@@ -844,7 +845,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, }/* Partial read */ -if (used + offset < skb->len) +if (used + offset < skb_len)continue ; }while (len >0 );
net/mac80211/tx.c +13 -10
@@ -463,7 +463,6 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) {struct sta_info *sta = tx->sta;struct ieee80211_tx_info *info =IEEE80211_SKB_CB (tx->skb); -struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;struct ieee80211_local *local = tx->local;if (unlikely (!sta))
@@ -474,15 +473,6 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) !(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {int ac =skb_get_queue_mapping (tx->skb); -/* only deauth, disassoc and action are bufferable MMPDUs */ -if (ieee80211_is_mgmt (hdr->frame_control) && - !ieee80211_is_deauth (hdr->frame_control) && - !ieee80211_is_disassoc (hdr->frame_control) && - !ieee80211_is_action (hdr->frame_control)) { - info->flags |=IEEE80211_TX_CTL_NO_PS_BUFFER ; -return TX_CONTINUE ; - } -ps_dbg (sta->sdata,"STA %pM aid %d: PS buffer for AC %d\n" , sta->sta.addr, sta->sta.aid, ac);if (tx->local->total_ps_buffered >=TOTAL_MAX_TX_BUFFER )
@@ -525,9 +515,22 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) static ieee80211_tx_result debug_noinlineieee80211_tx_h_ps_buf (struct ieee80211_tx_data *tx) { +struct ieee80211_tx_info *info =IEEE80211_SKB_CB (tx->skb); +struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; +if (unlikely (tx->flags &IEEE80211_TX_PS_BUFFERED ))return TX_CONTINUE ; +/* only deauth, disassoc and action are bufferable MMPDUs */ +if (ieee80211_is_mgmt (hdr->frame_control) && + !ieee80211_is_deauth (hdr->frame_control) && + !ieee80211_is_disassoc (hdr->frame_control) && + !ieee80211_is_action (hdr->frame_control)) { +if (tx->flags &IEEE80211_TX_UNICAST ) + info->flags |=IEEE80211_TX_CTL_NO_PS_BUFFER ; +return TX_CONTINUE ; + } +if (tx->flags &IEEE80211_TX_UNICAST )return ieee80211_tx_h_unicast_ps_buf (tx);else
net/netfilter/nf_conntrack_seqadj.c +2 -2
@@ -41,8 +41,8 @@ int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,spin_lock_bh (&ct->lock); this_way = &seqadj->seq[dir];if (this_way->offset_before == this_way->offset_after || -before (this_way->correction_pos, seq)) { - this_way->correction_pos = seq; +before (this_way->correction_pos,ntohl (seq))) { + this_way->correction_pos =ntohl (seq); this_way->offset_before = this_way->offset_after; this_way->offset_after += off; }
net/netfilter/nf_nat_irc.c +27 -5
@@ -34,10 +34,14 @@ static unsigned int help(struct sk_buff *skb, struct nf_conntrack_expect *exp) {char buffer[sizeof ("4294967296 65635" )]; +struct nf_conn *ct = exp->master; +union nf_inet_addr newaddr;u_int16_t port;unsigned int ret;/* Reply comes from server. */ + newaddr = ct->tuplehash[IP_CT_DIR_REPLY ].tuple.dst.u3; + exp->saved_proto.tcp.port = exp->tuple.dst.u.tcp.port; exp->dir =IP_CT_DIR_REPLY ; exp->expectfn = nf_nat_follow_master;
@@ -57,17 +61,35 @@ static unsigned int help(struct sk_buff *skb, }if (port ==0 ) { -nf_ct_helper_log (skb, exp->master,"all ports in use" ); +nf_ct_helper_log (skb, ct,"all ports in use" );return NF_DROP ; } - ret =nf_nat_mangle_tcp_packet (skb, exp->master, ctinfo, - protoff, matchoff, matchlen, buffer, -strlen (buffer)); +/* strlen("\1DCC CHAT chat AAAAAAAA P\1\n")=27 +* strlen("\1DCC SCHAT chat AAAAAAAA P\1\n")=28 +* strlen("\1DCC SEND F AAAAAAAA P S\1\n")=26 +* strlen("\1DCC MOVE F AAAAAAAA P S\1\n")=26 +* strlen("\1DCC TSEND F AAAAAAAA P S\1\n")=27 +* +* AAAAAAAAA: bound addr (1.0.0.0==16777216, min 8 digits, +* 255.255.255.255==4294967296, 10 digits) +* P: bound port (min 1 d, max 5d (65635)) +* F: filename (min 1 d ) +* S: size (min 1 d ) +* 0x01, \n: terminators +*/ +/* AAA = "us", ie. where server normally talks to. */ +snprintf (buffer,sizeof (buffer),"%u %u" ,ntohl (newaddr.ip), port); +pr_debug ("nf_nat_irc: inserting '%s' == %pI4, port %u\n" , + buffer, &newaddr.ip, port); + + ret =nf_nat_mangle_tcp_packet (skb, ct, ctinfo, protoff, matchoff, + matchlen, buffer,strlen (buffer));if (ret !=NF_ACCEPT ) { -nf_ct_helper_log (skb, exp->master,"cannot mangle packet" ); +nf_ct_helper_log (skb, ct,"cannot mangle packet" );nf_ct_unexpect_related (exp); } +return ret; }
net/packet/af_packet.c +40 -25
136 lines not on this page · raw message
net/rds/ib.c +2 -1
@@ -338,7 +338,8 @@ static int rds_ib_laddr_check(__be32 addr) ret =rdma_bind_addr (cm_id, (struct sockaddr *)&sin);/* due to this, we will claim to support iWARP devices unless we check node_type. */ -if (ret || cm_id->device->node_type !=RDMA_NODE_IB_CA ) +if (ret || !cm_id->device || + cm_id->device->node_type !=RDMA_NODE_IB_CA ) ret = -EADDRNOTAVAIL ; rdsdebug("addr %pI4 ret %d node type %d\n",
net/rds/ib_send.c +2 -3
@@ -552,9 +552,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, && rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {rds_cong_map_updated (conn->c_fcong, ~(u64 )0 ); scat = &rm->data.op_sg[sg]; - ret =sizeof (struct rds_header ) +RDS_CONG_MAP_BYTES ; - ret =min_t (int, ret, scat->length - conn->c_xmit_data_off); -return ret; + ret =max_t (int,RDS_CONG_MAP_BYTES , scat->length); +return sizeof (struct rds_header ) + ret; }/* FIXME we may overallocate here */
net/rose/af_rose.c +4 -12
@@ -1253,6 +1253,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,if (msg->msg_name) {struct sockaddr_rose *srose; +struct full_sockaddr_rose *full_srose = msg->msg_name;memset (msg->msg_name,0 ,sizeof (struct full_sockaddr_rose )); srose = msg->msg_name;
@@ -1260,18 +1261,9 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, srose->srose_addr = rose->dest_addr; srose->srose_call = rose->dest_call; srose->srose_ndigis = rose->dest_ndigis; -if (msg->msg_namelen >=sizeof (struct full_sockaddr_rose )) { -struct full_sockaddr_rose *full_srose = (struct full_sockaddr_rose *)msg->msg_name; -for (n =0 ; n < rose->dest_ndigis ; n++) - full_srose->srose_digis[n] = rose->dest_digis[n]; - msg->msg_namelen =sizeof (struct full_sockaddr_rose ); - }else { -if (rose->dest_ndigis >=1 ) { - srose->srose_ndigis =1 ; - srose->srose_digi = rose->dest_digis[0 ]; - } - msg->msg_namelen =sizeof (struct sockaddr_rose ); - } +for (n =0 ; n < rose->dest_ndigis ; n++) + full_srose->srose_digis[n] = rose->dest_digis[n]; + msg->msg_namelen =sizeof (struct full_sockaddr_rose ); }skb_free_datagram (sk, skb);
net/unix/af_unix.c +12 -4
@@ -530,13 +530,17 @@ static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *,static int unix_seqpacket_recvmsg (struct kiocb *,struct socket *,struct msghdr *,size_t ,int ); -static void unix_set_peek_off (struct sock *sk,int val) +static int unix_set_peek_off (struct sock *sk,int val) {struct unix_sock *u =unix_sk (sk); -mutex_lock (&u->readlock); +if (mutex_lock_interruptible (&u->readlock)) +return -EINTR ; + sk->sk_peek_off = val;mutex_unlock (&u->readlock); + +return 0 ; }
@@ -714,7 +718,9 @@ static int unix_autobind(struct socket *sock)int err;unsigned int retries =0 ; -mutex_lock (&u->readlock); + err =mutex_lock_interruptible (&u->readlock); +if (err) +return err; err =0 ;if (u->addr)
@@ -873,7 +879,9 @@ static int unix_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) goto out; addr_len = err; -mutex_lock (&u->readlock); + err =mutex_lock_interruptible (&u->readlock); +if (err) + goto out; err = -EINVAL ;if (u->addr)