Linux 3.14.59
Greg KH
maintainerI'm announcing the release of the 3.14.59 kernel.
All users of the 3.14 kernel series must upgrade.
The updated 3.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.14.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 drivers/firewire/ohci.c | 5 drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 7 drivers/net/ethernet/renesas/sh_eth.c | 4 drivers/net/phy/broadcom.c | 2 drivers/net/ppp/pptp.c | 6 drivers/net/usb/qmi_wwan.c | 1 drivers/usb/class/cdc-acm.c | 5 drivers/usb/core/config.c | 3 drivers/usb/core/hub.c | 7 drivers/usb/core/quirks.c | 6 drivers/usb/host/whci/qset.c | 4 drivers/usb/serial/cp210x.c | 1 drivers/usb/serial/usb-serial-simple.c | 1 fs/btrfs/file.c | 16 + fs/btrfs/inode.c | 10 - fs/ext4/ext4_jbd2.c | 6 fs/ext4/super.c | 12 + fs/jbd2/journal.c | 6 fs/nfs/inode.c | 6 fs/nfs/nfs4client.c | 2 fs/ocfs2/namei.c | 2 include/linux/jbd2.h | 1 include/linux/usb/quirks.h | 3 include/net/af_unix.h | 1 include/net/ip6_tunnel.h | 3 include/net/ip_tunnels.h | 3 include/net/ipv6.h | 1 include/net/sock.h | 3 net/ax25/af_ax25.c | 3 net/bluetooth/sco.c | 3 net/core/scm.c | 2 net/core/skbuff.c | 3 net/core/sock.c | 2 net/decnet/af_decnet.c | 3 net/ipv4/af_inet.c | 3 net/ipv4/ipmr.c | 15 - net/ipv4/tcp_input.c | 1 net/ipv4/tcp_ipv4.c | 3 net/ipv6/af_inet6.c | 3 net/ipv6/ip6_gre.c | 8 net/ipv6/ip6mr.c | 15 - net/ipv6/mcast.c | 2 net/ipv6/netfilter/nf_conntrack_reasm.c | 5 net/ipv6/reassembly.c | 10 - net/irda/af_irda.c | 3 net/packet/af_packet.c | 19 +- net/sctp/auth.c | 4 net/sctp/ipv6.c | 8 net/sctp/sm_make_chunk.c | 4 net/sctp/socket.c | 12 + net/unix/af_unix.c | 196 ++++++++++++++++++++---- security/keys/gc.c | 10 - security/keys/keyctl.c | 18 +- security/keys/process_keys.c | 1 tools/net/Makefile | 7 56 files changed, 381 insertions(+), 111 deletions(-)
Aaro Koskinen (1):
broadcom: fix PHY_ID_BCM5481 entry in the id table
Alan Stern (1):
USB: add quirk for devices with broken LPM
Alexey Khoroshilov (1):
USB: whci-hcd: add check for dma mapping error
Ben Hutchings (1):
usb: Use the USB_SS_MULT() macro to decode burst multiplier for log message
Benjamin Coddington (1):
nfs4: start callback_ident at idr 1
Bjørn Mork (1):
net: qmi_wwan: add XS Stick W100-2 from 4G Systems
Daeho Jeong (1):
ext4, jbd2: ensure entering into panic after recording an error in superblock
Daniel Borkmann (4):
packet: do skb_probe_transport_header when we actually have data
packet: always probe for transport header
packet: infer protocol from ethernet header if unset net, scm: fix PaX detected msg_controllen overflow in scm_detach_fds
David Howells (3):
KEYS: Fix race between key destruction and finding a keyring by name
KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring
KEYS: Fix race between read and revoke
David S. Miller (1):
bluetooth: Validate socket address length in sco_sock_bind().
Eric Dumazet (4):
tcp: md5: fix lockdep annotation
tcp: initialize tp->copied_seq in case of cross SYN connection
ipv6: sctp: implement sctp_v6_destroy_sock()
ipv6: sctp: clone options to avoid use after free
Filipe Manana (2):
Btrfs: fix race leading to incorrect item deletion when dropping extents
Btrfs: fix race leading to BUG_ON when running delalloc for nodatacow
Greg Kroah-Hartman (1):
Linux 3.14.59
Hannes Frederic Sowa (1):
net: add validation for the socket syscall protocol argument
Jason A. Donenfeld (1):
ip_tunnel: disable preemption when updating per-cpu tstats
Jeff Layton (1):
nfs: if we have no valid attrs, then don't declare the attribute cache valid
Jonas Jonsson (2):
USB: cdc_acm: Ignore Infineon Flash Loader utility
USB: serial: Another Infineon flash loader USB ID
Junxiao Bi (1):
ocfs2: fix umask ignored issue
Kamal Mostafa (1):
tools/net: Use include/uapi with __EXPORTED_HEADERS__
Konstantin Shkolnyy (1):
USB: cp210x: Remove CP2110 ID from compatibility list
Lukas Czerner (1):
ext4: fix potential use after free in __ext4_journal_stop
Marcelo Ricardo Leitner (2):
sctp: use the same clock as if sock source timestamps were on
sctp: update the netstamp_needed counter when copying sockets
Michal Kubeček (1):
ipv6: distinguish frag queues by device for multicast and link-local packets
Neil Horman (1):
snmp: Remove duplicate OUTMCAST stat increment
Nicolas Dichtel (1):
gre6: allow to update all parameters via rtnl
Nikolay Aleksandrov (2):
net: ipmr: fix static mfc/dev leaks on table destruction
net: ip6mr: fix static mfc/dev leaks on table destruction
Pavel Machek (1):
atl1c: Improve driver not to do order 4 GFP_ATOMIC allocation
Rainer Weikusat (2):
unix: avoid use-after-free in ep_remove_wait_queue
af_unix: Revert 'lock_interruptible' in stream receive code
Sergei Shtylyov (1):
sh_eth: fix kernel oops in skb_put()
Stefan Richter (1):
firewire: ohci: fix JMicron JMB38x IT context discovery
Vlad Yasevich (2):
vlan: Fix untag operations of stacked vlans with REORDER_HEADER off
skbuff: Fix offset error in skb_reorder_vlan_header
WANG Cong (1):
pptp: verify sockaddr_len in pptp_bind() and pptp_connect()
Yevgeny Pats (1):
KEYS: Fix keyring ref leak in join_session_keyring()
lucien (1):
sctp: translate host order to network order when setting a hmacid
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 14 -SUBLEVEL = 58 +SUBLEVEL = 59 EXTRAVERSION = NAME = Remembering Coco
drivers/firewire/ohci.c +5 -0
@@ -3675,6 +3675,11 @@ static int pci_probe(struct pci_dev *dev,reg_write (ohci, OHCI1394_IsoXmitIntMaskSet, ~0 ); ohci->it_context_support =reg_read (ohci, OHCI1394_IsoXmitIntMaskSet); +/* JMicron JMB38x often shows 0 at first read, just ignore it */ +if (!ohci->it_context_support) { +ohci_notice (ohci,"overriding IsoXmitIntMask\n" ); + ohci->it_context_support =0xf ; + }reg_write (ohci, OHCI1394_IsoXmitIntMaskClear, ~0 ); ohci->it_context_mask = ohci->it_context_support; ohci->n_it =hweight32 (ohci->it_context_mask);
drivers/net/ethernet/atheros/atl1c/atl1c_main.c +3 -4
@@ -1018,13 +1018,12 @@ static int atl1c_setup_ring_resources(struct atl1c_adapter *adapter)sizeof (struct atl1c_recv_ret_status ) * rx_desc_count +8 *4 ; - ring_header->desc =pci_alloc_consistent (pdev, ring_header->size, - &ring_header->dma); + ring_header->desc =dma_zalloc_coherent (&pdev->dev, ring_header->size, + &ring_header->dma,GFP_KERNEL );if (unlikely (!ring_header->desc)) { -dev_err (&pdev->dev,"pci_alloc_consistend failed\n" ); +dev_err (&pdev->dev,"could not get memory for DMA buffer\n" ); goto err_nomem; } -memset (ring_header->desc,0 , ring_header->size);/* init TPD ring */ tpd_ring[0 ].dma =roundup (ring_header->dma,8 );
drivers/net/ethernet/renesas/sh_eth.c +2 -2
@@ -1424,6 +1424,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)if (mdp->cd->shift_rd0) desc_status >>=16 ; + skb = mdp->rx_skbuff[entry];if (desc_status & (RD_RFS1 |RD_RFS2 |RD_RFS3 |RD_RFS4 |RD_RFS5 |RD_RFS6 |RD_RFS10 )) { ndev->stats.rx_errors++;
@@ -1439,12 +1440,11 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota) ndev->stats.rx_missed_errors++;if (desc_status &RD_RFS10 ) ndev->stats.rx_over_errors++; - }else { + }else if (skb) {if (!mdp->cd->hw_swap)sh_eth_soft_swap (phys_to_virt (ALIGN (rxdesc->addr,4 )), pkt_len +2 ); - skb = mdp->rx_skbuff[entry]; mdp->rx_skbuff[entry] =NULL ;if (mdp->cd->rpadir)skb_reserve (skb,NET_IP_ALIGN );
drivers/net/phy/broadcom.c +1 -1
@@ -848,7 +848,7 @@ static struct mdio_device_id __maybe_unused broadcom_tbl[] = { { PHY_ID_BCM5421, 0xfffffff0 }, { PHY_ID_BCM5461, 0xfffffff0 }, { PHY_ID_BCM5464, 0xfffffff0 }, - { PHY_ID_BCM5482, 0xfffffff0 }, + { PHY_ID_BCM5481, 0xfffffff0 }, { PHY_ID_BCM5482, 0xfffffff0 }, { PHY_ID_BCM50610, 0xfffffff0 }, { PHY_ID_BCM50610M, 0xfffffff0 },
drivers/net/ppp/pptp.c +6 -0
@@ -420,6 +420,9 @@ static int pptp_bind(struct socket *sock, struct sockaddr *uservaddr,struct pptp_opt *opt = &po->proto.pptp;int error =0 ; +if (sockaddr_len <sizeof (struct sockaddr_pppox )) +return -EINVAL ; +lock_sock (sk); opt->src_addr = sp->sa_addr.pptp;
@@ -441,6 +444,9 @@ static int pptp_connect(struct socket *sock, struct sockaddr *uservaddr,struct flowi4 fl4;int error =0 ; +if (sockaddr_len <sizeof (struct sockaddr_pppox )) +return -EINVAL ; +if (sp->sa_protocol !=PX_PROTO_PPTP )return -EINVAL ;
drivers/net/usb/qmi_wwan.c +1 -0
@@ -755,6 +755,7 @@ static const struct usb_device_id products[] = { {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ {QMI_FIXED_INTF(0x1bc7, 0x1201, 2)}, /* Telit LE920 */ + {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */ {QMI_FIXED_INTF(0x0b3c, 0xc000, 4)}, /* Olivetti Olicard 100 */ {QMI_FIXED_INTF(0x0b3c, 0xc001, 4)}, /* Olivetti Olicard 120 */ {QMI_FIXED_INTF(0x0b3c, 0xc002, 4)}, /* Olivetti Olicard 140 */
drivers/usb/class/cdc-acm.c +5 -0
@@ -1810,6 +1810,11 @@ static const struct usb_device_id acm_ids[] = { },#endif +/* Exclude Infineon Flash Loader utility */ + { USB_DEVICE(0x058b, 0x0041), + .driver_info =IGNORE_DEVICE , + }, + /* control interfaces without any protocol set */ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, USB_CDC_PROTO_NONE) },
drivers/usb/core/config.c +2 -1
@@ -116,7 +116,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, USB_SS_MULT(desc->bmAttributes) > 3) {dev_warn (ddev,"Isoc endpoint has Mult of %d in " "config %d interface %d altsetting %d ep %d: " -"setting to 3\n" , desc->bmAttributes +1 , +"setting to 3\n" , +USB_SS_MULT (desc->bmAttributes), cfgno, inum, asnum, ep->desc.bEndpointAddress); ep->ss_ep_comp.bmAttributes =2 ; }
drivers/usb/core/hub.c +6 -1
@@ -130,6 +130,10 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)static int usb_device_supports_lpm (struct usb_device *udev) { +/* Some devices have trouble with LPM */ +if (udev->quirks &USB_QUIRK_NO_LPM ) +return 0 ; +/* USB 2.1 (and greater) devices indicate LPM support through * their USB 2.0 Extended Capabilities BOS descriptor. */
@@ -4350,6 +4354,8 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, goto fail; } +usb_detect_quirks (udev); +if (udev->wusb ==0 &&le16_to_cpu (udev->descriptor.bcdUSB) >=0x0201 ) { retval =usb_get_bos_descriptor (udev);if (!retval) {
@@ -4595,7 +4601,6 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,if (status <0 ) goto loop; -usb_detect_quirks (udev);if (udev->quirks &USB_QUIRK_DELAY_INIT )msleep (1000 );
drivers/usb/core/quirks.c +6 -0
@@ -205,6 +205,12 @@ static const struct usb_device_id usb_amd_resume_quirk_list[] = {/* Logitech Optical Mouse M90/M100 */ { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME }, + /* Blackmagic Design Intensity Shuttle */ + { USB_DEVICE(0x1edb, 0xbd3b), .driver_info = USB_QUIRK_NO_LPM }, + + /* Blackmagic Design UltraStudio SDI */ + { USB_DEVICE(0x1edb, 0xbd4f), .driver_info = USB_QUIRK_NO_LPM }, + { } /* terminating entry must be last */ };
drivers/usb/host/whci/qset.c +4 -0
@@ -377,6 +377,10 @@ static int qset_fill_page_list(struct whc *whc, struct whc_std *std, gfp_t mem_fif (std->pl_virt ==NULL )return -ENOMEM ; std->dma_addr =dma_map_single (whc->wusbhc.dev, std->pl_virt, pl_len,DMA_TO_DEVICE ); +if (dma_mapping_error (whc->wusbhc.dev, std->dma_addr)) { +kfree (std->pl_virt); +return -EFAULT ; + }for (p =0 ; p < std->num_pointers; p++) { std->pl_virt[p].buf_ptr =cpu_to_le64 (dma_addr);
drivers/usb/serial/cp210x.c +0 -1
@@ -132,7 +132,6 @@ static const struct usb_device_id id_table[] = { { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */ - { USB_DEVICE(0x10C4, 0xEA80) }, /* Silicon Labs factory default */ { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */ { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */
drivers/usb/serial/usb-serial-simple.c +1 -0
@@ -47,6 +47,7 @@ DEVICE(funsoft, FUNSOFT_IDS);/* Infineon Flashloader driver */ #define FLASHLOADER_IDS () \ + { USB_DEVICE_INTERFACE_CLASS(0x058b, 0x0041, USB_CLASS_CDC_DATA) }, \ { USB_DEVICE(0x8087, 0x0716) }DEVICE (flashloader,FLASHLOADER_IDS );
fs/btrfs/file.c +12 -4
@@ -751,8 +751,16 @@ next_slot: }btrfs_item_key_to_cpu (leaf, &key, path->slots[0 ]); -if (key.objectid > ino || - key.type >BTRFS_EXTENT_DATA_KEY || key.offset >= end) + +if (key.objectid > ino) +break ; +if (WARN_ON_ONCE (key.objectid < ino) || + key.type <BTRFS_EXTENT_DATA_KEY ) { +ASSERT (del_nr ==0 ); + path->slots[0 ]++; + goto next_slot; + } +if (key.type >BTRFS_EXTENT_DATA_KEY || key.offset >= end)break ; fi = btrfs_item_ptr(leaf, path->slots[0],
@@ -771,8 +779,8 @@ next_slot:btrfs_file_extent_inline_len (leaf, path->slots[0 ], fi); }else { -WARN_ON (1 ); - extent_end = search_start; +/* can't happen */ +BUG (); }if (extent_end <= search_start) {
fs/btrfs/inode.c +8 -2
@@ -1238,8 +1238,14 @@ next_slot: num_bytes =0 ;btrfs_item_key_to_cpu (leaf, &found_key, path->slots[0 ]); -if (found_key.objectid > ino || - found_key.type >BTRFS_EXTENT_DATA_KEY || +if (found_key.objectid > ino) +break ; +if (WARN_ON_ONCE (found_key.objectid < ino) || + found_key.type <BTRFS_EXTENT_DATA_KEY ) { + path->slots[0 ]++; + goto next_slot; + } +if (found_key.type >BTRFS_EXTENT_DATA_KEY || found_key.offset > end)break ;
fs/ext4/ext4_jbd2.c +3 -3
@@ -88,13 +88,13 @@ int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle)return 0 ; } + err = handle->h_err;if (!handle->h_transaction) { - err =jbd2_journal_stop (handle); -return handle->h_err ? handle->h_err : err; + rc =jbd2_journal_stop (handle); +return err ? err : rc; } sb = handle->h_transaction->t_journal->j_private; - err = handle->h_err; rc =jbd2_journal_stop (handle);if (!err)
fs/ext4/super.c +10 -2
@@ -404,9 +404,13 @@ static void ext4_handle_error(struct super_block *sb)smp_wmb (); sb->s_flags |=MS_RDONLY ; } -if (test_opt (sb,ERRORS_PANIC )) +if (test_opt (sb,ERRORS_PANIC )) { +if (EXT4_SB (sb)->s_journal && + !(EXT4_SB (sb)->s_journal->j_flags &JBD2_REC_ERR )) +return ;panic ("EXT4-fs (device %s): panic forced after error\n" , sb->s_id); + } }#define ext4_error_ratelimit (sb) \
@@ -595,8 +599,12 @@ void __ext4_abort(struct super_block *sb, const char *function,jbd2_journal_abort (EXT4_SB (sb)->s_journal, -EIO );save_error_info (sb, function, line); } -if (test_opt (sb,ERRORS_PANIC )) +if (test_opt (sb,ERRORS_PANIC )) { +if (EXT4_SB (sb)->s_journal && + !(EXT4_SB (sb)->s_journal->j_flags &JBD2_REC_ERR )) +return ;panic ("EXT4-fs panic from previous error\n" ); + } } void __ext4_msg(struct super_block *sb,
fs/jbd2/journal.c +5 -1
@@ -2088,8 +2088,12 @@ static void __journal_abort_soft (journal_t *journal, int errno)__jbd2_journal_abort_hard (journal); -if (errno) +if (errno) {jbd2_journal_update_sb_errno (journal); +write_lock (&journal->j_state_lock); + journal->j_flags |=JBD2_REC_ERR ; +write_unlock (&journal->j_state_lock); + } }/**
fs/nfs/inode.c +5 -1
@@ -1675,7 +1675,11 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) nfsi->attrtimeo_timestamp = now; } } - invalid &= ~NFS_INO_INVALID_ATTR ; + +/* Don't declare attrcache up to date if there were no attrs! */ +if (fattr->valid !=0 ) + invalid &= ~NFS_INO_INVALID_ATTR ; +/* Don't invalidate the data if we were to blame */ if (!(S_ISREG (inode->i_mode) ||S_ISDIR (inode->i_mode) ||S_ISLNK (inode->i_mode)))
fs/nfs/nfs4client.c +1 -1
@@ -33,7 +33,7 @@ static int nfs_get_cb_ident_idr(struct nfs_client *clp, int minorversion)return ret;idr_preload (GFP_KERNEL );spin_lock (&nn->nfs_client_lock); - ret =idr_alloc (&nn->cb_ident_idr, clp,0 ,0 ,GFP_NOWAIT ); + ret =idr_alloc (&nn->cb_ident_idr, clp,1 ,0 ,GFP_NOWAIT );if (ret >=0 ) clp->cl_cb_ident = ret;spin_unlock (&nn->nfs_client_lock);
fs/ocfs2/namei.c +2 -0
@@ -345,6 +345,8 @@ static int ocfs2_mknod(struct inode *dir,mlog_errno (status); goto leave; } +/* update inode->i_mode after mask with "umask". */ + inode->i_mode = mode; handle = ocfs2_start_trans(osb, ocfs2_mknod_credits(osb->sb, S_ISDIR(mode),
include/linux/jbd2.h +1 -0
@@ -1007,6 +1007,7 @@ struct journal_s#define JBD2_ABORT_ON_SYNCDATA_ERR 0x040/* Abort the journal on file * data write error in ordered * mode */ +#define JBD2_REC_ERR 0x080/* The errno in the sb has been recorded */ /* * Function declarations for the journaling transaction and buffer
include/linux/usb/quirks.h +3 -0
@@ -36,4 +36,7 @@/* device can't handle device_qualifier descriptor requests */ #define USB_QUIRK_DEVICE_QUALIFIER 0x00000100 +/* device can't handle Link Power Management */ +#define USB_QUIRK_NO_LPM BIT(10) +#endif /* __LINUX_USB_QUIRKS_H */
include/net/af_unix.h +1 -0
@@ -63,6 +63,7 @@ struct unix_sock {#define UNIX_GC_CANDIDATE 0#define UNIX_GC_MAYBE_CYCLE 1struct socket_wq peer_wq; +wait_queue_t peer_wake; };static inline struct unix_sock *unix_sk (struct sock *sk)
include/net/ip6_tunnel.h +2 -1
@@ -79,11 +79,12 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) err =ip6_local_out (skb);if (net_xmit_eval (err) ==0 ) { -struct pcpu_sw_netstats *tstats =this_cpu_ptr (dev->tstats); +struct pcpu_sw_netstats *tstats =get_cpu_ptr (dev->tstats);u64_stats_update_begin (&tstats->syncp); tstats->tx_bytes += pkt_len; tstats->tx_packets++;u64_stats_update_end (&tstats->syncp); +put_cpu_ptr (tstats); }else { stats->tx_errors++; stats->tx_aborted_errors++;
include/net/ip_tunnels.h +2 -1
@@ -166,12 +166,13 @@ static inline void iptunnel_xmit_stats(int err, struct pcpu_sw_netstats __percpu *stats) {if (err >0 ) { -struct pcpu_sw_netstats *tstats =this_cpu_ptr (stats); +struct pcpu_sw_netstats *tstats =get_cpu_ptr (stats);u64_stats_update_begin (&tstats->syncp); tstats->tx_bytes += err; tstats->tx_packets++;u64_stats_update_end (&tstats->syncp); +put_cpu_ptr (tstats); }else if (err <0 ) { err_stats->tx_errors++; err_stats->tx_aborted_errors++;
include/net/ipv6.h +1 -0
@@ -489,6 +489,7 @@ struct ip6_create_arg {u32 user;const struct in6_addr *src;const struct in6_addr *dst; +int iif;u8 ecn; };
include/net/sock.h +3 -0
@@ -374,6 +374,7 @@ struct sock { sk_no_check : 2, sk_userlocks : 4, sk_protocol : 8, +#define SK_PROTOCOL_MAX U8_MAX sk_type :16 ;kmemcheck_bitfield_end (flags);int sk_wmem_queued;
@@ -700,6 +701,8 @@ enum sock_flags { SOCK_SELECT_ERR_QUEUE, /* Wake select on error queue */ }; +#define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) +static inline void sock_copy_flags (struct sock *nsk,struct sock *osk) { nsk->sk_flags = osk->sk_flags;
net/ax25/af_ax25.c +3 -0
@@ -806,6 +806,9 @@ static int ax25_create(struct net *net, struct socket *sock, int protocol,struct sock *sk;ax25_cb *ax25; +if (protocol <0 || protocol >SK_PROTOCOL_MAX ) +return -EINVAL ; +if (!net_eq (net, &init_net))return -EAFNOSUPPORT ;
net/bluetooth/sco.c +3 -0
@@ -459,6 +459,9 @@ static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_leif (!addr || addr->sa_family !=AF_BLUETOOTH )return -EINVAL ; +if (addr_len <sizeof (struct sockaddr_sco )) +return -EINVAL ; +lock_sock (sk);if (sk->sk_state !=BT_OPEN ) {
net/core/scm.c +2 -0
@@ -306,6 +306,8 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm) err =put_user (cmlen, &cm->cmsg_len);if (!err) { cmlen =CMSG_SPACE (i*sizeof (int )); +if (msg->msg_controllen < cmlen) + cmlen = msg->msg_controllen; msg->msg_control += cmlen; msg->msg_controllen -= cmlen; }
net/core/skbuff.c +2 -1
@@ -3997,7 +3997,8 @@ static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb)return NULL ; } -memmove (skb->data -ETH_HLEN , skb->data -VLAN_ETH_HLEN ,2 *ETH_ALEN ); +memmove (skb->data -ETH_HLEN , skb->data - skb->mac_len -VLAN_HLEN , +2 *ETH_ALEN ); skb->mac_header +=VLAN_HLEN ;return skb; }
net/core/sock.c +0 -2
@@ -422,8 +422,6 @@ static void sock_warn_obsolete_bsdism(const char *name) } } -#define SK_FLAGS_TIMESTAMP ((1UL << SOCK_TIMESTAMP) | (1UL << SOCK_TIMESTAMPING_RX_SOFTWARE)) -static void sock_disable_timestamp (struct sock *sk,unsigned long flags) {if (sk->sk_flags & flags) {
net/decnet/af_decnet.c +3 -0
@@ -677,6 +677,9 @@ static int dn_create(struct net *net, struct socket *sock, int protocol, {struct sock *sk; +if (protocol <0 || protocol >SK_PROTOCOL_MAX ) +return -EINVAL ; +if (!net_eq (net, &init_net))return -EAFNOSUPPORT ;
net/ipv4/af_inet.c +3 -0
@@ -260,6 +260,9 @@ static int inet_create(struct net *net, struct socket *sock, int protocol,int try_loading_module =0 ;int err; +if (protocol <0 || protocol >=IPPROTO_MAX ) +return -EINVAL ; + sock->state =SS_UNCONNECTED ;/* Look for the requested type/protocol pair. */
net/ipv4/ipmr.c +8 -7
@@ -136,7 +136,7 @@ static int __ipmr_fill_mroute(struct mr_table *mrt, struct sk_buff *skb, struct mfc_cache *c, struct rtmsg *rtm);static void mroute_netlink_event (struct mr_table *mrt,struct mfc_cache *mfc,int cmd); -static void mroute_clean_tables (struct mr_table *mrt); +static void mroute_clean_tables (struct mr_table *mrt,bool all);static void ipmr_expire_process (unsigned long arg);#ifdef CONFIG_IP_MROUTE_MULTIPLE_TABLES
@@ -348,7 +348,7 @@ static struct mr_table *ipmr_new_table(struct net *net, u32 id)static void ipmr_free_table (struct mr_table *mrt) {del_timer_sync (&mrt->ipmr_expire_timer); -mroute_clean_tables (mrt); +mroute_clean_tables (mrt, true);kfree (mrt); }
@@ -1201,7 +1201,7 @@ static int ipmr_mfc_add(struct net *net, struct mr_table *mrt,* Close the multicast socket, and clear the vif tables etc */ -static void mroute_clean_tables (struct mr_table *mrt) +static void mroute_clean_tables (struct mr_table *mrt,bool all) {int i;LIST_HEAD (list);
@@ -1210,8 +1210,9 @@ static void mroute_clean_tables(struct mr_table *mrt)/* Shut down all active vif entries */ for (i =0 ; i < mrt->maxvif; i++) { -if (!(mrt->vif_table[i].flags &VIFF_STATIC )) -vif_delete (mrt, i,0 , &list); +if (!all && (mrt->vif_table[i].flags &VIFF_STATIC )) +continue ; +vif_delete (mrt, i,0 , &list); }unregister_netdevice_many (&list);
@@ -1219,7 +1220,7 @@ static void mroute_clean_tables(struct mr_table *mrt)for (i =0 ; i <MFC_LINES ; i++) {list_for_each_entry_safe (c, next, &mrt->mfc_cache_array[i], list) { -if (c->mfc_flags &MFC_STATIC ) +if (!all && (c->mfc_flags &MFC_STATIC ))continue ;list_del_rcu (&c->list);mroute_netlink_event (mrt, c,RTM_DELROUTE );
@@ -1254,7 +1255,7 @@ static void mrtsock_destruct(struct sock *sk)NETCONFA_IFINDEX_ALL , net->ipv4.devconf_all);RCU_INIT_POINTER (mrt->mroute_sk,NULL ); -mroute_clean_tables (mrt); +mroute_clean_tables (mrt, false); } }rtnl_unlock ();
net/ipv4/tcp_input.c +1 -0
@@ -5577,6 +5577,7 @@ discard: } tp->rcv_nxt =TCP_SKB_CB (skb)->seq +1 ; + tp->copied_seq = tp->rcv_nxt; tp->rcv_wup =TCP_SKB_CB (skb)->seq +1 ;/* RFC1323: The window in SYN & SYN/ACK segments is
net/ipv4/tcp_ipv4.c +2 -1
@@ -998,7 +998,8 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr, } md5sig =rcu_dereference_protected (tp->md5sig_info, -sock_owned_by_user (sk)); +sock_owned_by_user (sk) || +lockdep_is_held (&sk->sk_lock.slock));if (!md5sig) { md5sig =kmalloc (sizeof (*md5sig), gfp);if (!md5sig)
net/ipv6/af_inet6.c +3 -0
@@ -110,6 +110,9 @@ static int inet6_create(struct net *net, struct socket *sock, int protocol,int try_loading_module =0 ;int err; +if (protocol <0 || protocol >=IPPROTO_MAX ) +return -EINVAL ; +/* Look for the requested type/protocol pair. */ lookup_protocol: err = -ESOCKTNOSUPPORT ;
net/ipv6/ip6_gre.c +3 -5
@@ -1558,13 +1558,11 @@ static int ip6gre_changelink(struct net_device *dev, struct nlattr *tb[],return -EEXIST ; }else { t = nt; - -ip6gre_tunnel_unlink (ign, t); -ip6gre_tnl_change (t, &p, !tb[IFLA_MTU ]); -ip6gre_tunnel_link (ign, t); -netdev_state_change (dev); } +ip6gre_tunnel_unlink (ign, t); +ip6gre_tnl_change (t, &p, !tb[IFLA_MTU ]); +ip6gre_tunnel_link (ign, t);return 0 ; }
net/ipv6/ip6mr.c +8 -7
@@ -120,7 +120,7 @@ static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc, int cmd);static int ip6mr_rtm_dumproute (struct sk_buff *skb,struct netlink_callback *cb); -static void mroute_clean_tables (struct mr6_table *mrt); +static void mroute_clean_tables (struct mr6_table *mrt,bool all);static void ipmr_expire_process (unsigned long arg);#ifdef CONFIG_IPV6_MROUTE_MULTIPLE_TABLES
@@ -337,7 +337,7 @@ static struct mr6_table *ip6mr_new_table(struct net *net, u32 id)static void ip6mr_free_table (struct mr6_table *mrt) {del_timer (&mrt->ipmr_expire_timer); -mroute_clean_tables (mrt); +mroute_clean_tables (mrt, true);kfree (mrt); }
@@ -1536,7 +1536,7 @@ static int ip6mr_mfc_add(struct net *net, struct mr6_table *mrt,* Close the multicast socket, and clear the vif tables etc */ -static void mroute_clean_tables (struct mr6_table *mrt) +static void mroute_clean_tables (struct mr6_table *mrt,bool all) {int i;LIST_HEAD (list);
@@ -1546,8 +1546,9 @@ static void mroute_clean_tables(struct mr6_table *mrt)* Shut down all active vif entries */ for (i =0 ; i < mrt->maxvif; i++) { -if (!(mrt->vif6_table[i].flags &VIFF_STATIC )) -mif6_delete (mrt, i, &list); +if (!all && (mrt->vif6_table[i].flags &VIFF_STATIC )) +continue ; +mif6_delete (mrt, i, &list); }unregister_netdevice_many (&list);
@@ -1556,7 +1557,7 @@ static void mroute_clean_tables(struct mr6_table *mrt)*/ for (i =0 ; i <MFC6_LINES ; i++) {list_for_each_entry_safe (c, next, &mrt->mfc6_cache_array[i], list) { -if (c->mfc_flags &MFC_STATIC ) +if (!all && (c->mfc_flags &MFC_STATIC ))continue ;write_lock_bh (&mrt_lock);list_del (&c->list);
@@ -1619,7 +1620,7 @@ int ip6mr_sk_done(struct sock *sk) net->ipv6.devconf_all);write_unlock_bh (&mrt_lock); -mroute_clean_tables (mrt); +mroute_clean_tables (mrt, false); err =0 ;break ; }
net/ipv6/mcast.c +0 -2
@@ -1636,7 +1636,6 @@ out:if (!err) {ICMP6MSGOUT_INC_STATS (net, idev,ICMPV6_MLD2_REPORT );ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); -IP6_UPD_PO_STATS (net, idev,IPSTATS_MIB_OUTMCAST , payload_len); }else {IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTDISCARDS ); }
@@ -2000,7 +1999,6 @@ out:if (!err) {ICMP6MSGOUT_INC_STATS (net, idev, type);ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); -IP6_UPD_PO_STATS (net, idev,IPSTATS_MIB_OUTMCAST , full_len); }else IP6_INC_STATS (net, idev,IPSTATS_MIB_OUTDISCARDS );
net/ipv6/netfilter/nf_conntrack_reasm.c +3 -2
@@ -184,7 +184,7 @@ static void nf_ct_frag6_expire(unsigned long data)/* Creation primitives. */ static inline struct frag_queue *fq_find (struct net *net,__be32 id,u32 user,struct in6_addr *src, -struct in6_addr *dst,u8 ecn) +struct in6_addr *dst,int iif,u8 ecn) {struct inet_frag_queue *q;struct ip6_create_arg arg;
@@ -194,6 +194,7 @@ static inline struct frag_queue *fq_find(struct net *net, __be32 id, arg.user = user; arg.src = src; arg.dst = dst; + arg.iif = iif; arg.ecn = ecn;read_lock_bh (&nf_frags.lock);
@@ -602,7 +603,7 @@ struct sk_buff *nf_ct_frag6_gather(struct sk_buff *skb, u32 user)local_bh_enable (); fq =fq_find (net, fhdr->identification, user, &hdr->saddr, &hdr->daddr, -ip6_frag_ecn (hdr)); + skb->dev ? skb->dev->ifindex :0 ,ip6_frag_ecn (hdr));if (fq ==NULL ) {pr_debug ("Can't find and can't create new queue\n" ); goto ret_orig;
net/ipv6/reassembly.c +7 -3
@@ -111,7 +111,10 @@ bool ip6_frag_match(struct inet_frag_queue *q, void *a)return fq->id == arg->id && fq->user == arg->user &&ipv6_addr_equal (&fq->saddr, arg->src) && -ipv6_addr_equal (&fq->daddr, arg->dst); +ipv6_addr_equal (&fq->daddr, arg->dst) && + (arg->iif == fq->iif || + !(ipv6_addr_type (arg->dst) & (IPV6_ADDR_MULTICAST | +IPV6_ADDR_LINKLOCAL ))); }EXPORT_SYMBOL (ip6_frag_match);
@@ -180,7 +183,7 @@ static void ip6_frag_expire(unsigned long data)static __inline__struct frag_queue *fq_find (struct net *net,__be32 id,const struct in6_addr *src, -const struct in6_addr *dst,u8 ecn) +const struct in6_addr *dst,int iif,u8 ecn) {struct inet_frag_queue *q;struct ip6_create_arg arg;
@@ -190,6 +193,7 @@ fq_find(struct net *net, __be32 id, const struct in6_addr *src, arg.user =IP6_DEFRAG_LOCAL_DELIVER ; arg.src = src; arg.dst = dst; + arg.iif = iif; arg.ecn = ecn;read_lock (&ip6_frags.lock);
@@ -558,7 +562,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) IPSTATS_MIB_REASMFAILS, evicted); fq =fq_find (net, fhdr->identification, &hdr->saddr, &hdr->daddr, -ip6_frag_ecn (hdr)); + skb->dev ? skb->dev->ifindex :0 ,ip6_frag_ecn (hdr));if (fq !=NULL ) {int ret;
net/irda/af_irda.c +3 -0
@@ -1103,6 +1103,9 @@ static int irda_create(struct net *net, struct socket *sock, int protocol,IRDA_DEBUG (2 ,"%s()\n" , __func__); +if (protocol <0 || protocol >SK_PROTOCOL_MAX ) +return -EINVAL ; +if (net != &init_net)return -EAFNOSUPPORT ;
net/packet/af_packet.c +15 -4
@@ -2091,6 +2091,15 @@ static void tpacket_destruct_skb(struct sk_buff *skb)sock_wfree (skb); } +static void tpacket_set_protocol (const struct net_device *dev, +struct sk_buff *skb) +{ +if (dev->type ==ARPHRD_ETHER ) { +skb_reset_mac_header (skb); + skb->protocol =eth_hdr (skb)->h_proto; + } +} +static int tpacket_fill_skb (struct packet_sock *po,struct sk_buff *skb,void *frame,struct net_device *dev,int size_max,__be16 proto,unsigned char *addr,int hlen)
@@ -2127,8 +2136,6 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb,skb_reserve (skb, hlen);skb_reset_network_header (skb); -if (!packet_use_direct_xmit (po)) -skb_probe_transport_header (skb,0 );if (unlikely (po->tp_tx_has_off)) {int off_min, off_max, off; off_min = po->tp_hdrlen -sizeof (struct sockaddr_ll );
@@ -2178,6 +2185,8 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, dev->hard_header_len);if (unlikely (err))return err; +if (!skb->protocol) +tpacket_set_protocol (dev, skb); data += dev->hard_header_len; to_write -= dev->hard_header_len;
@@ -2212,6 +2221,8 @@ static int tpacket_fill_skb(struct packet_sock *po, struct sk_buff *skb, len = ((to_write > len_max) ? len_max : to_write); } +skb_probe_transport_header (skb,0 ); +return tp_len; }
@@ -2537,8 +2548,8 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) len += vnet_hdr_len; } -if (!packet_use_direct_xmit (po)) -skb_probe_transport_header (skb, reserve); +skb_probe_transport_header (skb, reserve); +if (unlikely (extra_len ==4 )) skb->no_fcs =1 ;
net/sctp/auth.c +2 -2
@@ -800,8 +800,8 @@ int sctp_auth_ep_set_hmacs(struct sctp_endpoint *ep,if (!has_sha1)return -EINVAL ; -memcpy (ep->auth_hmacs_list->hmac_ids, &hmacs->shmac_idents[0 ], - hmacs->shmac_num_idents *sizeof (__u16)); +for (i =0 ; i < hmacs->shmac_num_idents; i++) + ep->auth_hmacs_list->hmac_ids[i] =htons (hmacs->shmac_idents[i]); ep->auth_hmacs_list->param_hdr.length =htons (sizeof (sctp_paramhdr_t) + hmacs->shmac_num_idents *sizeof (__u16));return 0 ;
net/sctp/ipv6.c +8 -0
@@ -638,6 +638,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,struct sock *newsk;struct ipv6_pinfo *newnp, *np =inet6_sk (sk);struct sctp6_sock *newsctp6sk; +struct ipv6_txoptions *opt; newsk =sk_alloc (sock_net (sk),PF_INET6 ,GFP_KERNEL , sk->sk_prot);if (!newsk)
@@ -657,6 +658,13 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,memcpy (newnp, np,sizeof (struct ipv6_pinfo )); +rcu_read_lock (); + opt =rcu_dereference (np->opt); +if (opt) + opt =ipv6_dup_options (newsk, opt); +RCU_INIT_POINTER (newnp->opt, opt); +rcu_read_unlock (); +/* Initialize sk's sport, dport, rcv_saddr and daddr for getsockname() * and getpeername(). */
net/sctp/sm_make_chunk.c +2 -2
@@ -1652,7 +1652,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,/* Set an expiration time for the cookie. */ cookie->c.expiration =ktime_add (asoc->cookie_life, -ktime_get ()); +ktime_get_real ());/* Copy the peer's init packet. */ memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr,
@@ -1780,7 +1780,7 @@ no_hmac:if (sock_flag (ep->base.sk,SOCK_TIMESTAMP )) kt =skb_get_ktime (skb);else - kt =ktime_get (); + kt =ktime_get_real ();if (!asoc &&ktime_compare (bear_cookie->expiration, kt) <0 ) {/*
net/sctp/socket.c +11 -1
@@ -6985,6 +6985,9 @@ void sctp_copy_sock(struct sock *newsk, struct sock *sk, newinet->mc_ttl =1 ; newinet->mc_index =0 ; newinet->mc_list =NULL ; + +if (newsk->sk_flags &SK_FLAGS_TIMESTAMP ) +net_enable_timestamp (); } static inline void sctp_copy_descendant(struct sock *sk_to,
@@ -7165,6 +7168,13 @@ struct proto sctp_prot = {#if IS_ENABLED (CONFIG_IPV6 ) +#include <net/transp_v6.h> +static void sctp_v6_destroy_sock (struct sock *sk) +{ +sctp_destroy_sock (sk); +inet6_destroy_sock (sk); +} +struct proto sctpv6_prot = { .name ="SCTPv6" , .owner = THIS_MODULE,
@@ -7174,7 +7184,7 @@ struct proto sctpv6_prot = { .accept = sctp_accept, .ioctl = sctp_ioctl, .init = sctp_init_sock, - .destroy = sctp_destroy_sock, + .destroy = sctp_v6_destroy_sock, .shutdown = sctp_shutdown, .setsockopt = sctp_setsockopt, .getsockopt = sctp_getsockopt,
net/unix/af_unix.c +167 -29
286 lines not on this page · raw message
security/keys/gc.c +6 -4
@@ -143,6 +143,12 @@ static noinline void key_gc_unused_keys(struct list_head *keys)kdebug ("- %u" , key->serial);key_check (key); +/* Throw away the key data if the key is instantiated */ +if (test_bit (KEY_FLAG_INSTANTIATED , &key->flags) && + !test_bit (KEY_FLAG_NEGATIVE , &key->flags) && + key->type->destroy) + key->type->destroy (key); +security_key_free (key);/* deal with the user's key tracking and quota */
@@ -157,10 +163,6 @@ static noinline void key_gc_unused_keys(struct list_head *keys)if (test_bit (KEY_FLAG_INSTANTIATED , &key->flags))atomic_dec (&key->user->nikeys); -/* now throw away the key memory */ -if (key->type->destroy) - key->type->destroy (key); -key_user_put (key->user);kfree (key->description);
security/keys/keyctl.c +9 -9
@@ -744,16 +744,16 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)/* the key is probably readable - now try to read it */ can_read_key: - ret =key_validate (key); -if (ret ==0 ) { - ret = -EOPNOTSUPP ; -if (key->type->read) { -/* read the data with the semaphore held (since we -* might sleep) */ -down_read (&key->sem); + ret = -EOPNOTSUPP ; +if (key->type->read) { +/* Read the data with the semaphore held (since we might sleep) +* to protect against the key being updated or revoked. +*/ +down_read (&key->sem); + ret =key_validate (key); +if (ret ==0 ) ret = key->type->read (key, buffer, buflen); -up_read (&key->sem); - } +up_read (&key->sem); } error2:
security/keys/process_keys.c +1 -0
@@ -793,6 +793,7 @@ long join_session_keyring(const char *name) ret =PTR_ERR (keyring); goto error2; }else if (keyring == new->session_keyring) { +key_put (keyring); ret =0 ; goto error2; }
tools/net/Makefile +4 -3
@@ -4,6 +4,9 @@ CC = gcc LEX = flex YACC = bison +CFLAGS += -Wall -O2 +CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include + %.yacc.c: %.y $(YACC) -o $@ -d $<
@@ -12,15 +15,13 @@ YACC = bison all : bpf_jit_disasm bpf_dbg bpf_asm -bpf_jit_disasm : CFLAGS = -Wall -O2 -DPACKAGE='bpf_jit_disasm' +bpf_jit_disasm : CFLAGS += -DPACKAGE='bpf_jit_disasm' bpf_jit_disasm : LDLIBS = -lopcodes -lbfd -ldl bpf_jit_disasm : bpf_jit_disasm.o -bpf_dbg : CFLAGS = -Wall -O2 bpf_dbg : LDLIBS = -lreadline bpf_dbg : bpf_dbg.o -bpf_asm : CFLAGS = -Wall -O2 -I. bpf_asm : LDLIBS = bpf_asm : bpf_asm.o bpf_exp.yacc.o bpf_exp.lex.o bpf_exp.lex.o : bpf_exp.yacc.c