Linux 3.10.53
Greg KH
maintainerI'm announcing the release of the 3.10.53 kernel.
All users of the 3.10 kernel series must upgrade.
The updated 3.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.10.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
------------
Makefile | 2 arch/sparc/include/asm/pgtable_64.h | 6 - arch/sparc/include/asm/tlbflush_64.h | 12 -- arch/sparc/kernel/ldc.c | 2 arch/sparc/kernel/smp_64.c | 6 - arch/sparc/kernel/sys32.S | 2 arch/sparc/kernel/unaligned_64.c | 12 ++ arch/sparc/lib/NG2memcpy.S | 1 arch/sparc/math-emu/math_32.c | 2 arch/sparc/mm/fault_64.c | 102 ++++++++++++------------ arch/sparc/mm/init_64.c | 27 ++++++ arch/sparc/mm/tsb.c | 14 +++ drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 9 ++ drivers/net/macvlan.c | 1 drivers/net/ppp/pptp.c | 2 drivers/net/vxlan.c | 2 drivers/sbus/char/bbc_envctrl.c | 6 + drivers/sbus/char/bbc_i2c.c | 11 +- drivers/tty/serial/sunsab.c | 9 ++ include/net/inetpeer.h | 16 --- include/net/ip.h | 31 +++---- include/net/ipv6.h | 11 +- include/net/secure_seq.h | 2 net/compat.c | 9 +- net/core/iovec.c | 10 +- net/core/secure_seq.c | 25 ----- net/core/skbuff.c | 2 net/ipv4/igmp.c | 4 net/ipv4/inetpeer.c | 18 ---- net/ipv4/ip_output.c | 7 - net/ipv4/ip_tunnel.c | 2 net/ipv4/ipmr.c | 2 net/ipv4/raw.c | 2 net/ipv4/route.c | 69 ++++++++++------ net/ipv4/tcp_vegas.c | 3 net/ipv4/tcp_veno.c | 2 net/ipv4/xfrm4_mode_tunnel.c | 2 net/ipv6/ip6_output.c | 17 ++++ net/ipv6/output_core.c | 23 ----- net/ipv6/sit.c | 2 net/netfilter/ipvs/ip_vs_xmit.c | 2 net/sctp/associola.c | 1 net/sctp/output.c | 2 44 files changed, 269 insertions(+), 224 deletions(-)
Andrey Ryabinin (1):
net: sendmsg: fix NULL pointer dereference
Andrey Utkin (1):
arch/sparc/math-emu/math_32.c: drop stray break operator
Christoph Paasch (2):
tcp: Fix integer-overflows in TCP veno
tcp: Fix integer-overflow in TCP vegas
Christopher Alexander Tobias Schulze (2):
bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000
sunsab: Fix detection of BREAK on sunsab serial console
Daniel Borkmann (1):
net: sctp: inherit auth_capable on INIT collisions
David S. Miller (8):
sparc64: Fix argument sign extension for compat_sys_futex().
sparc64: Handle 32-bit tasks properly in compute_effective_address().
sparc64: Fix top-level fault handling bugs.
sparc64: Don't bark so loudly about 32-bit tasks generating 64-bit fault addresses.
sparc64: Fix huge TSB mapping on pre-UltraSPARC-III cpus.
sparc64: Add membar to Niagara2 memcpy code.
sparc64: Do not insert non-valid PTEs into the TSB hash table.
sparc64: Guard against flushing openfirmware mappings.
Dmitry Kravkov (1):
bnx2x: fix crash during TSO tunneling
Eric Dumazet (3):
inetpeer: get rid of ip_id_count
ip: make IP identifiers less predictable
sctp: fix possible seqlock seadlock in sctp_packet_transmit()
Greg Kroah-Hartman (1):
Linux 3.10.53
Kirill Tkhai (1):
sparc64: Make itc_sync_lock raw
Sasha Levin (1):
iovec: make sure the caller actually wants anything in memcpy_fromiovecend
Sowmini Varadhan (1):
sparc64: ldc_connect() should not return EINVAL when handshake is in progress.
Vlad Yasevich (2):
macvlan: Initialize vlan_features to turn on offload support.
net: Correctly set segment mac_len in skb_segment().
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 52 +SUBLEVEL = 53 EXTRAVERSION = NAME = TOSSUG Baby Fish
arch/sparc/include/asm/pgtable_64.h +4 -2
@@ -24,7 +24,8 @@/* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB). * The page copy blockops can use 0x6000000 to 0x8000000. -* The TSB is mapped in the 0x8000000 to 0xa000000 range. +* The 8K TSB is mapped in the 0x8000000 to 0x8400000 range. +* The 4M TSB is mapped in the 0x8400000 to 0x8800000 range. * The PROM resides in an area spanning 0xf0000000 to 0x100000000. * The vmalloc area spans 0x100000000 to 0x200000000. * Since modules need to be in the lowest 32-bits of the address space,
@@ -33,7 +34,8 @@* 0x400000000. */ #define TLBTEMP_BASE _AC(0x0000000006000000,UL) -#define TSBMAP_BASE _AC(0x0000000008000000,UL) +#define TSBMAP_8K_BASE _AC(0x0000000008000000,UL) +#define TSBMAP_4M_BASE _AC(0x0000000008400000,UL)#define MODULES_VADDR _AC(0x0000000010000000,UL)#define MODULES_LEN _AC(0x00000000e0000000,UL)#define MODULES_END _AC(0x00000000f0000000,UL)
arch/sparc/include/asm/tlbflush_64.h +2 -10
@@ -35,6 +35,8 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, { } +void flush_tlb_kernel_range (unsigned long start,unsigned long end); +#define __HAVE_ARCH_ENTER_LAZY_MMU_MODEextern void flush_tlb_pending (void );
@@ -49,11 +51,6 @@ extern void __flush_tlb_kernel_range(unsigned long start, unsigned long end);#ifndef CONFIG_SMP -#define flush_tlb_kernel_range (start,end) \ -do { flush_tsb_kernel_range(start,end); \ - __flush_tlb_kernel_range(start,end); \ -} while (0) -static inline void global_flush_tlb_page (struct mm_struct *mm,unsigned long vaddr) {__flush_tlb_page (CTX_HWBITS (mm->context), vaddr);
@@ -64,11 +61,6 @@ static inline void global_flush_tlb_page(struct mm_struct *mm, unsigned long vadextern void smp_flush_tlb_kernel_range (unsigned long start,unsigned long end);extern void smp_flush_tlb_page (struct mm_struct *mm,unsigned long vaddr); -#define flush_tlb_kernel_range (start, end) \ -do { flush_tsb_kernel_range(start,end); \ - smp_flush_tlb_kernel_range(start, end); \ -} while (0) -#define global_flush_tlb_page (mm, vaddr) \ smp_flush_tlb_page(mm, vaddr)
arch/sparc/kernel/ldc.c +1 -1
@@ -1336,7 +1336,7 @@ int ldc_connect(struct ldc_channel *lp)if (!(lp->flags &LDC_FLAG_ALLOCED_QUEUES ) || !(lp->flags &LDC_FLAG_REGISTERED_QUEUES ) || lp->hs_state !=LDC_HS_OPEN ) - err = -EINVAL ; + err = ((lp->hs_state >LDC_HS_OPEN ) ?0 : -EINVAL );else err =start_handshake (lp);
arch/sparc/kernel/smp_64.c +3 -3
@@ -150,7 +150,7 @@ void cpu_panic(void)#define NUM_ROUNDS 64/* magic value */ #define NUM_ITERS 5/* likewise */ -static DEFINE_SPINLOCK (itc_sync_lock); +static DEFINE_RAW_SPINLOCK (itc_sync_lock);static unsigned long go[SLAVE +1 ];#define DEBUG_TICK_SYNC 0
@@ -258,7 +258,7 @@ static void smp_synchronize_one_tick(int cpu) go[MASTER ] =0 ;membar_safe ("#StoreLoad" ); -spin_lock_irqsave (&itc_sync_lock, flags); +raw_spin_lock_irqsave (&itc_sync_lock, flags); {for (i =0 ; i <NUM_ROUNDS *NUM_ITERS ; i++) {while (!go[MASTER ])
@@ -269,7 +269,7 @@ static void smp_synchronize_one_tick(int cpu)membar_safe ("#StoreLoad" ); } } -spin_unlock_irqrestore (&itc_sync_lock, flags); +raw_spin_unlock_irqrestore (&itc_sync_lock, flags); }#if defined(CONFIG_SUN_LDOMS ) && defined(CONFIG_HOTPLUG_CPU )
arch/sparc/kernel/sys32.S +1 -1
@@ -44,7 +44,7 @@ SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) SIGN1(sys32_mq_open, compat_sys_mq_open, %o1) SIGN1(sys32_select, compat_sys_select, %o0) -SIGN3(sys32_futex, compat_sys_futex, %o1, %o2, %o5) +SIGN1(sys32_futex, compat_sys_futex, %o1) SIGN1(sys32_recvfrom, compat_sys_recvfrom, %o0) SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0) SIGN1(sys32_sendmsg, compat_sys_sendmsg, %o0)
arch/sparc/kernel/unaligned_64.c +9 -3
@@ -163,17 +163,23 @@ static unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs)unsigned long compute_effective_address (struct pt_regs *regs,unsigned int insn,unsigned int rd) { +int from_kernel = (regs->tstate &TSTATE_PRIV ) !=0 ;unsigned int rs1 = (insn >>14 ) &0x1f ;unsigned int rs2 = insn &0x1f ; -int from_kernel = (regs->tstate &TSTATE_PRIV ) !=0 ; +unsigned long addr;if (insn &0x2000 ) {maybe_flush_windows (rs1,0 , rd, from_kernel); -return (fetch_reg (rs1, regs) +sign_extend_imm13 (insn)); + addr = (fetch_reg (rs1, regs) +sign_extend_imm13 (insn)); }else {maybe_flush_windows (rs1, rs2, rd, from_kernel); -return (fetch_reg (rs1, regs) +fetch_reg (rs2, regs)); + addr = (fetch_reg (rs1, regs) +fetch_reg (rs2, regs)); } + +if (!from_kernel &&test_thread_flag (TIF_32BIT )) + addr &=0xffffffff ; + +return addr; }/* This is just to make gcc think die_if_kernel does return... */
arch/sparc/lib/NG2memcpy.S +1 -0
@@ -236,6 +236,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ */ VISEntryHalf + membar #Sync alignaddr %o1, %g0, %g0 add %o1, (64 - 1), %o4
arch/sparc/math-emu/math_32.c +1 -1
@@ -499,7 +499,7 @@ static int do_one_mathemu(u32 insn, unsigned long *pfsr, unsigned long *fregs)case 0 : fsr = *pfsr;if (IR ==-1 )IR =2 ;/* fcc is always fcc0 */ - fsr &= ~0xc00 ; fsr |= (IR <<10 );break ; + fsr &= ~0xc00 ; fsr |= (IR <<10 ); *pfsr = fsr;break ;case 1 : rd->s =IR ;break ;
arch/sparc/mm/fault_64.c +55 -47
152 lines not on this page · raw message
arch/sparc/mm/init_64.c +27 -0
@@ -350,6 +350,10 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t * mm = vma->vm_mm; +/* Don't insert a non-valid PTE into the TSB, we'll deadlock. */ +if (!pte_accessible (mm, pte)) +return ; +spin_lock_irqsave (&mm->context.lock, flags);#if defined(CONFIG_HUGETLB_PAGE ) || defined(CONFIG_TRANSPARENT_HUGEPAGE )
@@ -2764,3 +2768,26 @@ void hugetlb_setup(struct pt_regs *regs) } }#endif + +#ifdef CONFIG_SMP +#define do_flush_tlb_kernel_range smp_flush_tlb_kernel_range +#else +#define do_flush_tlb_kernel_range __flush_tlb_kernel_range +#endif + +void flush_tlb_kernel_range (unsigned long start,unsigned long end) +{ +if (start <HI_OBP_ADDRESS && end >LOW_OBP_ADDRESS ) { +if (start <LOW_OBP_ADDRESS ) { +flush_tsb_kernel_range (start,LOW_OBP_ADDRESS ); +do_flush_tlb_kernel_range (start,LOW_OBP_ADDRESS ); + } +if (end >HI_OBP_ADDRESS ) { +flush_tsb_kernel_range (end,HI_OBP_ADDRESS ); +do_flush_tlb_kernel_range (end,HI_OBP_ADDRESS ); + } + }else { +flush_tsb_kernel_range (start, end); +do_flush_tlb_kernel_range (start, end); + } +}
arch/sparc/mm/tsb.c +13 -1
@@ -133,7 +133,19 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign mm->context.tsb_block[tsb_idx].tsb_nentries = tsb_bytes /sizeof (struct tsb ); - base =TSBMAP_BASE ; +switch (tsb_idx) { +case MM_TSB_BASE : + base =TSBMAP_8K_BASE ; +break ; +#if defined(CONFIG_HUGETLB_PAGE ) || defined(CONFIG_TRANSPARENT_HUGEPAGE ) +case MM_TSB_HUGE : + base =TSBMAP_4M_BASE ; +break ; +#endif +default : +BUG (); + } + tte =pgprot_val (PAGE_KERNEL_LOCKED ); tsb_paddr =__pa (mm->context.tsb_block[tsb_idx].tsb);BUG_ON (tsb_paddr & (tsb_bytes -1UL ));
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 -0
@@ -312,6 +312,7 @@ struct sw_tx_bd {u8 flags;/* Set on the first BD descriptor when there is a split BD */ #define BNX2X_TSO_SPLIT_BD (1<<0) +#define BNX2X_HAS_SECOND_PBD (1<<1) };struct sw_rx_page {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +9 -0
@@ -180,6 +180,12 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata, --nbd; bd_idx =TX_BD (NEXT_TX_IDX (bd_idx)); +if (tx_buf->flags &BNX2X_HAS_SECOND_PBD ) { +/* Skip second parse bd... */ + --nbd; + bd_idx =TX_BD (NEXT_TX_IDX (bd_idx)); + } +/* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */ if (tx_buf->flags &BNX2X_TSO_SPLIT_BD ) { tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd;
@@ -3755,6 +3761,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)/* set encapsulation flag in start BD */ SET_FLAG (tx_start_bd->general_data,ETH_TX_START_BD_TUNNEL_EXIST ,1 ); + + tx_buf->flags |=BNX2X_HAS_SECOND_PBD ; + nbd++; }else if (xmit_type &XMIT_CSUM ) {/* Set PBD in checksum offload case w/o encapsulation */
drivers/net/macvlan.c +1 -0
@@ -500,6 +500,7 @@ static int macvlan_init(struct net_device *dev) (lowerdev->state &MACVLAN_STATE_MASK ); dev->features = lowerdev->features &MACVLAN_FEATURES ; dev->features |=NETIF_F_LLTX ; + dev->vlan_features = lowerdev->vlan_features &MACVLAN_FEATURES ; dev->gso_max_size = lowerdev->gso_max_size; dev->iflink = lowerdev->ifindex; dev->hard_header_len = lowerdev->hard_header_len;
drivers/net/ppp/pptp.c +1 -1
@@ -281,7 +281,7 @@ static int pptp_xmit(struct ppp_channel *chan, struct sk_buff *skb)nf_reset (skb); skb->ip_summed =CHECKSUM_NONE ; -ip_select_ident (skb, &rt->dst,NULL ); +ip_select_ident (skb,NULL );ip_send_check (iph);ip_local_out (skb);
drivers/net/vxlan.c +1 -1
@@ -1093,7 +1093,7 @@ static netdev_tx_t vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, iph->daddr = dst; iph->saddr = fl4.saddr; iph->ttl = ttl ? :ip4_dst_hoplimit (&rt->dst); -__ip_select_ident (iph, &rt->dst, (skb_shinfo (skb)->gso_segs ?:1 ) -1 ); +__ip_select_ident (iph,skb_shinfo (skb)->gso_segs ?:1 );nf_reset (skb);
drivers/sbus/char/bbc_envctrl.c +6 -0
@@ -452,6 +452,9 @@ static void attach_one_temp(struct bbc_i2c_bus *bp, struct platform_device *op,if (!tp)return ; +INIT_LIST_HEAD (&tp->bp_list); +INIT_LIST_HEAD (&tp->glob_list); + tp->client =bbc_i2c_attach (bp, op);if (!tp->client) {kfree (tp);
@@ -497,6 +500,9 @@ static void attach_one_fan(struct bbc_i2c_bus *bp, struct platform_device *op,if (!fp)return ; +INIT_LIST_HEAD (&fp->bp_list); +INIT_LIST_HEAD (&fp->glob_list); + fp->client =bbc_i2c_attach (bp, op);if (!fp->client) {kfree (fp);
drivers/sbus/char/bbc_i2c.c +8 -3
@@ -301,13 +301,18 @@ static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int indexif (!bp)return NULL ; +INIT_LIST_HEAD (&bp->temps); +INIT_LIST_HEAD (&bp->fans); + bp->i2c_control_regs =of_ioremap (&op->resource[0 ],0 ,0x2 ,"bbc_i2c_regs" );if (!bp->i2c_control_regs) goto fail; - bp->i2c_bussel_reg =of_ioremap (&op->resource[1 ],0 ,0x1 ,"bbc_i2c_bussel" ); -if (!bp->i2c_bussel_reg) - goto fail; +if (op->num_resources ==2 ) { + bp->i2c_bussel_reg =of_ioremap (&op->resource[1 ],0 ,0x1 ,"bbc_i2c_bussel" ); +if (!bp->i2c_bussel_reg) + goto fail; + } bp->waiting =0 ;init_waitqueue_head (&bp->wq);
drivers/tty/serial/sunsab.c +9 -0
@@ -157,6 +157,15 @@ receive_chars(struct uart_sunsab_port *up, (up->port.line == up->port.cons->index)) saw_console_brk =1 ; +if (count ==0 ) { +if (unlikely (stat->sreg.isr1 &SAB82532_ISR1_BRK )) { + stat->sreg.isr0 &= ~(SAB82532_ISR0_PERR | +SAB82532_ISR0_FERR ); + up->port.icount.brk++; +uart_handle_break (&up->port); + } + } +for (i =0 ; i < count; i++) {unsigned char ch = buf[i], flag;
include/net/inetpeer.h +3 -13
@@ -41,14 +41,13 @@ struct inet_peer {struct rcu_head gc_rcu; };/* -* Once inet_peer is queued for deletion (refcnt == -1), following fields -* are not available: rid, ip_id_count +* Once inet_peer is queued for deletion (refcnt == -1), following field +* is not available: rid * We can share memory with rcu_head to help keep inet_peer small. */ union {struct {atomic_t rid;/* Frag reception counter */ -atomic_t ip_id_count;/* IP ID for the next packet */ };struct rcu_head rcu;struct inet_peer *gc_next;
@@ -166,7 +165,7 @@ extern void inetpeer_invalidate_tree(struct inet_peer_base *);extern void inetpeer_invalidate_family (int family);/* -* temporary check to make sure we dont access rid, ip_id_count, tcp_ts, +* temporary check to make sure we dont access rid, tcp_ts, * tcp_ts_stamp if no refcount is taken on inet_peer */ static inline void inet_peer_refcheck (const struct inet_peer *p)
@@ -174,13 +173,4 @@ static inline void inet_peer_refcheck(const struct inet_peer *p) WARN_ON_ONCE(atomic_read(&p->refcnt) <= 0); } - -/* can be called with or without local BH being disabled */ -static inline int inet_getid (struct inet_peer *p,int more) -{ - more++; -inet_peer_refcheck (p); -return atomic_add_return (more, &p->ip_id_count) - more; -} -#endif /* _NET_INETPEER_H */
include/net/ip.h +14 -17
@@ -252,9 +252,10 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) !(dst_metric_locked(dst, RTAX_MTU))); } -extern void __ip_select_ident (struct iphdr *iph,struct dst_entry *dst,int more); +u32 ip_idents_reserve (u32 hash,int segs); +void __ip_select_ident (struct iphdr *iph,int segs); -static inline void ip_select_ident (struct sk_buff *skb,struct dst_entry *dst,struct sock *sk) +static inline void ip_select_ident_segs (struct sk_buff *skb,struct sock *sk,int segs) {struct iphdr *iph =ip_hdr (skb);
@@ -264,24 +265,20 @@ static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, s* does not change, they drop every other packet in * a TCP stream using header compression. */ - iph->id = (sk &&inet_sk (sk)->inet_daddr) ? -htons (inet_sk (sk)->inet_id++) :0 ; - }else -__ip_select_ident (iph, dst,0 ); -} - -static inline void ip_select_ident_more (struct sk_buff *skb,struct dst_entry *dst,struct sock *sk,int more) -{ -struct iphdr *iph =ip_hdr (skb); - -if ((iph->frag_off &htons (IP_DF )) && !skb->local_df) {if (sk &&inet_sk (sk)->inet_daddr) { iph->id =htons (inet_sk (sk)->inet_id); -inet_sk (sk)->inet_id +=1 + more; - }else +inet_sk (sk)->inet_id += segs; + }else { iph->id =0 ; - }else -__ip_select_ident (iph, dst, more); + } + }else { +__ip_select_ident (iph, segs); + } +} + +static inline void ip_select_ident (struct sk_buff *skb,struct sock *sk) +{ +ip_select_ident_segs (skb, sk,1 ); }/*
include/net/ipv6.h +7 -4
@@ -530,14 +530,19 @@ static inline u32 ipv6_addr_hash(const struct in6_addr *a) }/* more secured version of ipv6_addr_hash() */ -static inline u32 ipv6_addr_jhash (const struct in6_addr *a) +static inline u32 __ipv6_addr_jhash (const struct in6_addr *a,const u32 initval) {u32 v = (__force u32 )a->s6_addr32[0 ] ^ (__force u32 )a->s6_addr32[1 ];return jhash_3words (v, (__force u32 )a->s6_addr32[2 ], (__force u32 )a->s6_addr32[3 ], - ipv6_hash_secret); + initval); +} + +static inline u32 ipv6_addr_jhash (const struct in6_addr *a) +{ +return __ipv6_addr_jhash (a, ipv6_hash_secret); }static inline bool ipv6_addr_loopback (const struct in6_addr *a)
@@ -649,8 +654,6 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addreturn __ipv6_addr_diff (a1, a2,sizeof (struct in6_addr )); } -extern void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt); -/* * Header manipulation */
include/net/secure_seq.h +0 -2
@@ -3,8 +3,6 @@#include <linux/types.h> -extern __u32 secure_ip_id (__be32 daddr); -extern __u32 secure_ipv6_id (const __be32 daddr[4 ]);extern u32 secure_ipv4_port_ephemeral (__be32 saddr,__be32 daddr,__be16 dport);extern u32 secure_ipv6_port_ephemeral (const __be32 *saddr,const __be32 *daddr,__be16 dport);
net/compat.c +5 -4
@@ -85,7 +85,7 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov, {int tot_len; -if (kern_msg->msg_namelen) { +if (kern_msg->msg_name && kern_msg->msg_namelen) {if (mode ==VERIFY_READ ) { int err = move_addr_to_kernel(kern_msg->msg_name, kern_msg->msg_namelen,
@@ -93,10 +93,11 @@ int verify_compat_iovec(struct msghdr *kern_msg, struct iovec *kern_iov,if (err <0 )return err; } -if (kern_msg->msg_name) - kern_msg->msg_name = kern_address; - }else + kern_msg->msg_name = kern_address; + }else { kern_msg->msg_name =NULL ; + kern_msg->msg_namelen =0 ; + } tot_len = iov_from_user_compat_to_kern(kern_iov, (struct compat_iovec __user *)kern_msg->msg_iov,
net/core/iovec.c +7 -3
@@ -39,7 +39,7 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *a {int size, ct, err; -if (m->msg_namelen) { +if (m->msg_name && m->msg_namelen) {if (mode ==VERIFY_READ ) {void __user *namep; namep = (void __user __force *) m->msg_name;
@@ -48,10 +48,10 @@ int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *aif (err <0 )return err; } -if (m->msg_name) - m->msg_name = address; + m->msg_name = address; }else { m->msg_name =NULL ; + m->msg_namelen =0 ; } size = m->msg_iovlen *sizeof (struct iovec );
@@ -107,6 +107,10 @@ EXPORT_SYMBOL(memcpy_toiovecend);int memcpy_fromiovecend (unsigned char *kdata,const struct iovec *iov,int offset,int len) { +/* No data? Done! */ +if (len ==0 ) +return 0 ; +/* Skip over the finished iovecs */ while (offset >= iov->iov_len) { offset -= iov->iov_len;
net/core/secure_seq.c +0 -25
@@ -95,31 +95,6 @@ EXPORT_SYMBOL(secure_ipv6_port_ephemeral);#endif #ifdef CONFIG_INET -__u32 secure_ip_id (__be32 daddr) -{ -u32 hash[MD5_DIGEST_WORDS ]; - -net_secret_init (); - hash[0 ] = (__force __u32 ) daddr; - hash[1 ] = net_secret[13 ]; - hash[2 ] = net_secret[14 ]; - hash[3 ] = net_secret[15 ]; - -md5_transform (hash, net_secret); - -return hash[0 ]; -} - -__u32 secure_ipv6_id (const __be32 daddr[4 ]) -{ -__u32 hash[4 ]; - -net_secret_init (); -memcpy (hash, daddr,16 ); -md5_transform (hash, net_secret); - -return hash[0 ]; -}__u32 secure_tcp_sequence_number (__be32 saddr,__be32 daddr,__be16 sport,__be16 dport)
net/core/skbuff.c +1 -1
@@ -2810,7 +2810,6 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features) tail = nskb;__copy_skb_header (nskb, skb); - nskb->mac_len = skb->mac_len;/* nskb and skb might have different headroom */ if (nskb->ip_summed ==CHECKSUM_PARTIAL )
@@ -2820,6 +2819,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)skb_set_network_header (nskb, skb->mac_len); nskb->transport_header = (nskb->network_header +skb_network_header_len (skb)); +skb_reset_mac_len (nskb); skb_copy_from_linear_data_offset(skb, -tnl_hlen, nskb->data - tnl_hlen,
net/ipv4/igmp.c +2 -2
@@ -343,7 +343,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) pip->saddr = fl4.saddr; pip->protocol =IPPROTO_IGMP ; pip->tot_len =0 ;/* filled in later */ -ip_select_ident (skb, &rt->dst,NULL ); +ip_select_ident (skb,NULL ); ((u8 *)&pip[1 ])[0 ] =IPOPT_RA ; ((u8 *)&pip[1 ])[1 ] =4 ; ((u8 *)&pip[1 ])[2 ] =0 ;
@@ -687,7 +687,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc, iph->daddr = dst; iph->saddr = fl4.saddr; iph->protocol =IPPROTO_IGMP ; -ip_select_ident (skb, &rt->dst,NULL ); +ip_select_ident (skb,NULL ); ((u8 *)&iph[1 ])[0 ] =IPOPT_RA ; ((u8 *)&iph[1 ])[1 ] =4 ; ((u8 *)&iph[1 ])[2 ] =0 ;
net/ipv4/inetpeer.c +0 -18
@@ -26,20 +26,7 @@* Theory of operations. * We keep one entry for each peer IP address. The nodes contains long-living * information about the peer which doesn't depend on routes. -* At this moment this information consists only of ID field for the next -* outgoing IP packet. This field is incremented with each packet as encoded -* in inet_getid() function (include/net/inetpeer.h). -* At the moment of writing this notes identifier of IP packets is generated -* to be unpredictable using this code only for packets subjected -* (actually or potentially) to defragmentation. I.e. DF packets less than -* PMTU in size when local fragmentation is disabled use a constant ID and do -* not use this code (see ip_select_ident() in include/net/ip.h). * -* Route cache entries hold references to our nodes. -* New cache entries get references via lookup by destination IP address in -* the avl tree. The reference is grabbed only when it's needed i.e. only -* when we try to output IP packet which needs an unpredictable ID (see -* __ip_select_ident() in net/ipv4/route.c). * Nodes are removed only when reference counter goes to 0. * When it's happened the node may be removed when a sufficient amount of * time has been passed since its last use. The less-recently-used entry can
@@ -62,7 +49,6 @@* refcnt: atomically against modifications on other CPU; * usually under some other lock to prevent node disappearing * daddr: unchangeable -* ip_id_count: atomic value (no lock needed) */ static struct kmem_cache *peer_cachep__read_mostly ;
@@ -504,10 +490,6 @@ relookup: p->daddr = *daddr;atomic_set (&p->refcnt,1 );atomic_set (&p->rid,0 ); -atomic_set (&p->ip_id_count, - (daddr->family ==AF_INET ) ? -secure_ip_id (daddr->addr.a4) : -secure_ipv6_id (daddr->addr.a6)); p->metrics[RTAX_LOCK -1 ] =INETPEER_METRICS_NEW ; p->rate_tokens =0 ;/* 60*HZ is arbitrary, but chosen enough high so that the first
net/ipv4/ip_output.c +3 -4
@@ -148,7 +148,7 @@ int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr); iph->saddr = saddr; iph->protocol = sk->sk_protocol; -ip_select_ident (skb, &rt->dst, sk); +ip_select_ident (skb, sk);if (opt && opt->opt.optlen) { iph->ihl += opt->opt.optlen>>2 ;
@@ -394,8 +394,7 @@ packet_routed:ip_options_build (skb, &inet_opt->opt, inet->inet_daddr, rt,0 ); } -ip_select_ident_more (skb, &rt->dst, sk, - (skb_shinfo (skb)->gso_segs ?:1 ) -1 ); +ip_select_ident_segs (skb, sk,skb_shinfo (skb)->gso_segs ?:1 ); skb->priority = sk->sk_priority; skb->mark = sk->sk_mark;
@@ -1332,7 +1331,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk, iph->ttl = ttl; iph->protocol = sk->sk_protocol;ip_copy_addrs (iph, fl4); -ip_select_ident (skb, &rt->dst, sk); +ip_select_ident (skb, sk);if (opt) { iph->ihl += opt->optlen>>2 ;
net/ipv4/ip_tunnel.c +1 -1
@@ -691,7 +691,7 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, iph->daddr = fl4.daddr; iph->saddr = fl4.saddr; iph->ttl = ttl; -__ip_select_ident (iph, &rt->dst, (skb_shinfo (skb)->gso_segs ?:1 ) -1 ); +__ip_select_ident (iph,skb_shinfo (skb)->gso_segs ?:1 );iptunnel_xmit (skb, dev);return ;
net/ipv4/ipmr.c +1 -1
@@ -1661,7 +1661,7 @@ static void ip_encap(struct sk_buff *skb, __be32 saddr, __be32 daddr) iph->protocol =IPPROTO_IPIP ; iph->ihl =5 ; iph->tot_len =htons (skb->len); -ip_select_ident (skb,skb_dst (skb),NULL ); +ip_select_ident (skb,NULL );ip_send_check (iph);memset (&(IPCB (skb)->opt),0 ,sizeof (IPCB (skb)->opt));
net/ipv4/raw.c +1 -1
@@ -387,7 +387,7 @@ static int raw_send_hdrinc(struct sock *sk, struct flowi4 *fl4, iph->check =0 ; iph->tot_len =htons (length);if (!iph->id) -ip_select_ident (skb, &rt->dst,NULL ); +ip_select_ident (skb,NULL ); iph->check =ip_fast_csum ((unsigned char *)iph, iph->ihl); }
net/ipv4/route.c +45 -24
96 lines not on this page · raw message
net/ipv4/tcp_vegas.c +2 -1
@@ -218,7 +218,8 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)* This is: * (actual rate in segments) * baseRTT */ - target_cwnd = tp->snd_cwnd * vegas->baseRTT / rtt; + target_cwnd = (u64 )tp->snd_cwnd * vegas->baseRTT; +do_div (target_cwnd, rtt);/* Calculate the difference between the window we had, * and the window we would like to have. This quantity
net/ipv4/tcp_veno.c +1 -1
@@ -144,7 +144,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight) rtt = veno->minrtt; - target_cwnd = (tp->snd_cwnd * veno->basertt); + target_cwnd = (u64 )tp->snd_cwnd * veno->basertt; target_cwnd <<=V_PARAM_SHIFT ;do_div (target_cwnd, rtt);
net/ipv4/xfrm4_mode_tunnel.c +1 -1
@@ -117,12 +117,12 @@ static int xfrm4_mode_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) top_iph->frag_off = (flags &XFRM_STATE_NOPMTUDISC ) ?0 : (XFRM_MODE_SKB_CB (skb)->frag_off &htons (IP_DF )); -ip_select_ident (skb, dst->child,NULL ); top_iph->ttl =ip4_dst_hoplimit (dst->child); top_iph->saddr = x->props.saddr.a4; top_iph->daddr = x->id.daddr.a4; +ip_select_ident (skb,NULL );return 0 ; }
net/ipv6/ip6_output.c +17 -0
@@ -540,6 +540,23 @@ static void ip6_copy_metadata(struct sk_buff *to, struct sk_buff *from)skb_copy_secmark (to, from); } +static void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt) +{ +static u32 ip6_idents_hashrnd__read_mostly ; +static bool hashrnd_initialized = false; +u32 hash, id; + +if (unlikely (!hashrnd_initialized)) { + hashrnd_initialized = true; +get_random_bytes (&ip6_idents_hashrnd,sizeof (ip6_idents_hashrnd)); + } + hash =__ipv6_addr_jhash (&rt->rt6i_dst.addr, ip6_idents_hashrnd); + hash =__ipv6_addr_jhash (&rt->rt6i_src.addr, hash); + + id =ip_idents_reserve (hash,1 ); + fhdr->identification =htonl (id); +} +int ip6_fragment (struct sk_buff *skb,int (*output)(struct sk_buff *)) {struct sk_buff *frag;
net/ipv6/output_core.c +0 -23
@@ -6,29 +6,6 @@#include <net/ipv6.h> #include <net/ip6_fib.h> -void ipv6_select_ident (struct frag_hdr *fhdr,struct rt6_info *rt) -{ -static atomic_t ipv6_fragmentation_id; -int ident; - -#if IS_ENABLED (CONFIG_IPV6 ) -if (rt && !(rt->dst.flags &DST_NOPEER )) { -struct inet_peer *peer; -struct net *net; - - net =dev_net (rt->dst.dev); - peer =inet_getpeer_v6 (net->ipv6.peers, &rt->rt6i_dst.addr,1 ); -if (peer) { - fhdr->identification =htonl (inet_getid (peer,0 )); -inet_putpeer (peer); -return ; - } - } -#endif - ident =atomic_inc_return (&ipv6_fragmentation_id); - fhdr->identification =htonl (ident); -} -EXPORT_SYMBOL (ipv6_select_ident);int ip6_find_1stfragopt (struct sk_buff *skb,u8 **nexthdr) {
net/ipv6/sit.c +1 -1
@@ -919,7 +919,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, iph->ttl = iph6->hop_limit; skb->ip_summed =CHECKSUM_NONE ; -ip_select_ident (skb,skb_dst (skb),NULL ); +ip_select_ident (skb,NULL );iptunnel_xmit (skb, dev);return NETDEV_TX_OK ;
net/netfilter/ipvs/ip_vs_xmit.c +1 -1
@@ -883,7 +883,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, iph->daddr = cp->daddr.ip; iph->saddr = saddr; iph->ttl = old_iph->ttl; -ip_select_ident (skb, &rt->dst,NULL ); +ip_select_ident (skb,NULL );/* Another hack: avoid icmp_send in ip_fragment */ skb->local_df =1 ;
net/sctp/associola.c +1 -0
@@ -1213,6 +1213,7 @@ void sctp_assoc_update(struct sctp_association *asoc, asoc->c = new->c; asoc->peer.rwnd = new->peer.rwnd; asoc->peer.sack_needed = new->peer.sack_needed; + asoc->peer.auth_capable = new->peer.auth_capable; asoc->peer.i = new->peer.i;sctp_tsnmap_init (&asoc->peer.tsn_map,SCTP_TSN_MAP_INITIAL , asoc->peer.i.initial_tsn,GFP_ATOMIC );
net/sctp/output.c +1 -1
@@ -618,7 +618,7 @@ out:return err; no_route:kfree_skb (nskb); -IP_INC_STATS_BH (sock_net (asoc->base.sk),IPSTATS_MIB_OUTNOROUTES ); +IP_INC_STATS (sock_net (asoc->base.sk),IPSTATS_MIB_OUTNOROUTES );/* FIXME: Returning the 'err' will effect all the associations * associated with a socket, although only one of the paths of the