Linux 3.18.77
Greg KH
maintainerI'm announcing the release of the 3.18.77 kernel.
All users of the 3.18 kernel series must upgrade.
The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-3.18.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/x86/include/asm/tlbflush.h | 7 ++ block/bsg-lib.c | 1 crypto/Kconfig | 1 drivers/gpu/drm/drm_dp_mst_topology.c | 2 drivers/iio/adc/xilinx-xadc-core.c | 6 - drivers/irqchip/irq-crossbar.c | 3 drivers/isdn/i4l/isdn_ppp.c | 37 +++++++--- drivers/net/ethernet/mellanox/mlx4/main.c | 2 drivers/scsi/device_handler/scsi_dh_emc.c | 2 drivers/target/iscsi/iscsi_target_erl0.c | 6 - drivers/tty/goldfish.c | 2 drivers/watchdog/kempld_wdt.c | 9 ++ fs/btrfs/send.c | 5 + fs/ext4/inode.c | 2 fs/ext4/xattr.c | 19 +++-- fs/ocfs2/dlmglue.c | 105 +++++++++++++++++++++++++++++- fs/ocfs2/dlmglue.h | 18 +++++ fs/ocfs2/ocfs2.h | 1 include/net/sctp/ulpevent.h | 6 + include/uapi/linux/mroute6.h | 1 include/uapi/linux/rds.h | 3 kernel/bpf/verifier.c | 3 kernel/locking/lockdep.c | 11 ++- net/core/sock.c | 2 net/ipv4/ip_vti.c | 3 net/ipv6/ip6_vti.c | 3 net/l2tp/l2tp_core.c | 14 ++-- net/l2tp/l2tp_core.h | 5 + net/netfilter/nf_conntrack_expect.c | 4 - net/packet/af_packet.c | 23 ++++-- 31 files changed, 246 insertions(+), 62 deletions(-)
Alexey Kodanev (1):
vti: fix use after free in vti_tunnel_xmit/vti6_tnl_xmit
Arnd Bergmann (1):
watchdog: kempld: fix gcc-4.3 build
Christoph Paasch (1):
net: Set sk_prot_creator when cloning sockets to the right proto
Christophe JAILLET (1):
iio: adc: xilinx: Fix error handling
Dan Carpenter (2):
sctp: potential read out of bounds in sctp_ulpevent_type_enabled()
scsi: scsi_dh_emc: return success in clariion_std_inquiry()
Dmitry V. Levin (2):
uapi: fix linux/rds.h userspace compilation errors
uapi: fix linux/mroute6.h userspace compilation errors
Edward Cree (1):
bpf/verifier: reject BPF_ALU64|BPF_END
Eric Ren (1):
ocfs2/dlmglue: prepare tracking logic to avoid recursive cluster lock
Franck Demathieu (1):
irqchip/crossbar: Fix incorrect type of local variables
Greg Kroah-Hartman (3):
Revert "bsg-lib: don't free job in bsg_prepare_job" Revert "tty: goldfish: Fix a parameter of a call to free_irq" Linux 3.18.77
Harry Wentland (1):
drm/dp/mst: save vcpi with payloads
Jan Kara (1):
ext4: avoid deadlock when expanding inode size
Jarno Rajahalme (1):
netfilter: nf_ct_expect: Change __nf_ct_expect_check() return value.
Majd Dibbiny (1):
net/mlx4_core: Fix VF overwrite of module param which disables DMFS on new probed PFs
Meng Xu (1):
isdn/i4l: fetch the ppp_write buffer in one shot
Milan Broz (1):
crypto: xts - Add ECB dependency
Peter Zijlstra (1):
locking/lockdep: Add nest_lock integrity test
Ridge Kennedy (1):
l2tp: Avoid schedule while atomic in exit_net
Robbie Ko (1):
Btrfs: send, fix failure to rename top level inode due to name collision
Sabrina Dubroca (1):
l2tp: fix race condition in l2tp_tunnel_delete
Sebastian Andrzej Siewior (1):
x86/mm: Disable preemption during CR3 read+write
Varun Prakash (1):
target/iscsi: Fix unsolicited data seq_end_offset calculation
Willem de Bruijn (2):
packet: hold bind lock when rebinding to fanout hook
packet: in packet_do_bind, test fanout with bind_lock held
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 18 -SUBLEVEL = 76 +SUBLEVEL = 77 EXTRAVERSION = NAME = Diseased Newt
arch/x86/include/asm/tlbflush.h +7 -0
@@ -86,7 +86,14 @@ static inline void cr4_set_bits_and_update_boot(unsigned long mask)static inline void __native_flush_tlb (void ) { +/* +* If current->mm == NULL then we borrow a mm which may change during a +* task switch and therefore we must not be preempted while we write CR3 +* back: +*/ +preempt_disable ();native_write_cr3 (native_read_cr3 ()); +preempt_enable (); }static inline void __native_flush_tlb_global_irq_disabled (void )
block/bsg-lib.c +1 -0
@@ -147,6 +147,7 @@ static int bsg_create_job(struct device *dev, struct request *req) failjob_rls_rqst_payload:kfree (job->request_payload.sg_list); failjob_rls_job: +kfree (job);return -ENOMEM ; }
crypto/Kconfig +1 -0
@@ -290,6 +290,7 @@ config CRYPTO_XTS select CRYPTO_BLKCIPHER select CRYPTO_MANAGER select CRYPTO_GF128MUL + select CRYPTO_ECB help XTS: IEEE1619/D16 narrow block cipher use with aes-xts-plain, key size 256, 384 or 512 bits. This implementation currently
drivers/gpu/drm/drm_dp_mst_topology.c +2 -0
@@ -1707,6 +1707,7 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr)return -EINVAL ; } req_payload.num_slots = mgr->proposed_vcpis[i]->num_slots; + req_payload.vcpi = mgr->proposed_vcpis[i]->vcpi; }else { port =NULL ; req_payload.num_slots =0 ;
@@ -1722,6 +1723,7 @@ int drm_dp_update_payload_part1(struct drm_dp_mst_topology_mgr *mgr)if (req_payload.num_slots) {drm_dp_create_payload_step1 (mgr, mgr->proposed_vcpis[i]->vcpi, &req_payload); mgr->payloads[i].num_slots = req_payload.num_slots; + mgr->payloads[i].vcpi = req_payload.vcpi; }else if (mgr->payloads[i].num_slots) { mgr->payloads[i].num_slots =0 ;drm_dp_destroy_payload_step1 (mgr, port, port->vcpi.vcpi, &mgr->payloads[i]);
drivers/iio/adc/xilinx-xadc-core.c +3 -3
@@ -1223,7 +1223,7 @@ static int xadc_probe(struct platform_device *pdev) ret = xadc->ops->setup (pdev, indio_dev, irq);if (ret) - goto err_free_samplerate_trigger; + goto err_clk_disable_unprepare; ret = request_threaded_irq(irq, xadc->ops->interrupt_handler, xadc->ops->threaded_interrupt_handler,
@@ -1284,6 +1284,8 @@ static int xadc_probe(struct platform_device *pdev) err_free_irq:free_irq (irq, indio_dev); +err_clk_disable_unprepare: +clk_disable_unprepare (xadc->clk); err_free_samplerate_trigger:if (xadc->ops->flags &XADC_FLAGS_BUFFERED )iio_trigger_free (xadc->samplerate_trigger);
@@ -1293,8 +1295,6 @@ err_free_convst_trigger: err_triggered_buffer_cleanup:if (xadc->ops->flags &XADC_FLAGS_BUFFERED )iio_triggered_buffer_cleanup (indio_dev); -err_clk_disable_unprepare: -clk_disable_unprepare (xadc->clk); err_device_free:kfree (indio_dev->channels);
drivers/irqchip/irq-crossbar.c +2 -1
@@ -175,7 +175,8 @@ static const struct irq_domain_ops routable_irq_domain_ops = {static int __init crossbar_of_init (struct device_node *node) { -int i, size, max =0 , reserved =0 , entry; +int i, size, reserved =0 ; +u32 max =0 , entry;const __be32 *irqsr;int ret = -ENOMEM ;
drivers/isdn/i4l/isdn_ppp.c +25 -12
@@ -828,7 +828,6 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)isdn_net_local *lp;struct ippp_struct *is;int proto; -unsigned char protobuf[4 ]; is = file->private_data;
@@ -842,24 +841,28 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)if (!lp)printk (KERN_DEBUG "isdn_ppp_write: lp == NULL\n" );else { -/* -* Don't reset huptimer for -* LCP packets. (Echo requests). -*/ -if (copy_from_user (protobuf, buf,4 )) -return -EFAULT ; - proto =PPP_PROTOCOL (protobuf); -if (proto !=PPP_LCP ) - lp->huptimer =0 ; +if (lp->isdn_device <0 || lp->isdn_channel <0 ) { +unsigned char protobuf[4 ]; +/* +* Don't reset huptimer for +* LCP packets. (Echo requests). +*/ +if (copy_from_user (protobuf, buf,4 )) +return -EFAULT ; + + proto =PPP_PROTOCOL (protobuf); +if (proto !=PPP_LCP ) + lp->huptimer =0 ; -if (lp->isdn_device <0 || lp->isdn_channel <0 )return 0 ; + }if ((dev->drv[lp->isdn_device]->flags &DRV_FLAG_RUNNING ) && lp->dialstate ==0 && (lp->flags &ISDN_NET_CONNECTED )) {unsigned short hl;struct sk_buff *skb; +unsigned char *cpy_buf;/* * we need to reserve enough space in front of * sk_buff. old call to dev_alloc_skb only reserved
@@ -872,11 +875,21 @@ isdn_ppp_write(int min, struct file *file, const char __user *buf, int count)return count; }skb_reserve (skb, hl); -if (copy_from_user (skb_put (skb, count), buf, count)) + cpy_buf =skb_put (skb, count); +if (copy_from_user (cpy_buf, buf, count)) {kfree_skb (skb);return -EFAULT ; } + +/* +* Don't reset huptimer for +* LCP packets. (Echo requests). +*/ + proto =PPP_PROTOCOL (cpy_buf); +if (proto !=PPP_LCP ) + lp->huptimer =0 ; +if (is->debug &0x40 ) {printk (KERN_DEBUG "ppp xmit: len %d\n" , (int ) skb->len);isdn_ppp_frame_log ("xmit" , skb->data, skb->len,32 , is->unit, lp->ppp_slot);
drivers/net/ethernet/mellanox/mlx4/main.c +0 -2
@@ -648,8 +648,6 @@ static int mlx4_slave_cap(struct mlx4_dev *dev)return -ENOSYS ; } - mlx4_log_num_mgm_entry_size = hca_param.log_mc_entry_sz; - dev->caps.hca_core_clock = hca_param.hca_core_clock;memset (&dev_cap,0 ,sizeof (dev_cap));
drivers/scsi/device_handler/scsi_dh_emc.c +1 -1
@@ -464,7 +464,7 @@ static int clariion_prep_fn(struct scsi_device *sdev, struct request *req)static int clariion_std_inquiry (struct scsi_device *sdev,struct clariion_dh_data *csdev) { -int err; +int err =SCSI_DH_OK ;char *sp_model; err =send_inquiry_cmd (sdev,0 , csdev);
drivers/target/iscsi/iscsi_target_erl0.c +2 -4
@@ -45,10 +45,8 @@ void iscsit_set_dataout_sequence_values(*/ if (cmd->unsolicited_data) { cmd->seq_start_offset = cmd->write_data_done; - cmd->seq_end_offset = (cmd->write_data_done + - ((cmd->se_cmd.data_length > - conn->sess->sess_ops->FirstBurstLength) ? - conn->sess->sess_ops->FirstBurstLength : cmd->se_cmd.data_length)); + cmd->seq_end_offset =min (cmd->se_cmd.data_length, + conn->sess->sess_ops->FirstBurstLength);return ; }
drivers/tty/goldfish.c +1 -1
@@ -295,7 +295,7 @@ static int goldfish_tty_probe(struct platform_device *pdev)tty_unregister_device (goldfish_tty_driver, i); err_tty_register_device_failed: -free_irq (irq, qtty); +free_irq (irq, pdev); err_request_irq_failed: goldfish_tty_current_line_count--;if (goldfish_tty_current_line_count ==0 )
drivers/watchdog/kempld_wdt.c +8 -1
@@ -140,12 +140,19 @@ static int kempld_wdt_set_stage_timeout(struct kempld_wdt_data *wdt_data, unsigned int timeout) {struct kempld_device_data *pld = wdt_data->pld; -u32 prescaler = kempld_prescaler[PRESCALER_21 ]; +u32 prescaler;u64 stage_timeout64;u32 stage_timeout;u32 remainder;u8 stage_cfg; +#if GCC_VERSION <40400 +/* work around a bug compiling do_div() */ + prescaler =READ_ONCE (kempld_prescaler[PRESCALER_21 ]); +#else + prescaler = kempld_prescaler[PRESCALER_21 ]; +#endif +if (!stage)return -EINVAL ;
fs/btrfs/send.c +4 -1
@@ -1640,6 +1640,9 @@ static int is_inode_existent(struct send_ctx *sctx, u64 ino, u64 gen) {int ret; +if (ino ==BTRFS_FIRST_FREE_OBJECTID ) +return 1 ; + ret =get_cur_inode_state (sctx, ino, gen);if (ret <0 ) goto out;
@@ -1825,7 +1828,7 @@ static int will_overwrite_ref(struct send_ctx *sctx, u64 dir, u64 dir_gen,* not delted and then re-created, if it was then we have no overwrite * and we can just unlink this entry. */ -if (sctx->parent_root) { +if (sctx->parent_root && dir !=BTRFS_FIRST_FREE_OBJECTID ) { ret =get_inode_info (sctx->parent_root, dir,NULL , &gen,NULL ,NULL ,NULL ,NULL );if (ret <0 && ret != -ENOENT )
fs/ext4/inode.c +0 -2
@@ -4895,8 +4895,6 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode) sbi->s_want_extra_isize, iloc, handle);if (ret) { -ext4_set_inode_state (inode, -EXT4_STATE_NO_EXPAND );if (mnt_count !=le16_to_cpu (sbi->s_es->s_mnt_count)) { ext4_warning(inode->i_sb,
fs/ext4/xattr.c +13 -6
@@ -1291,11 +1291,13 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,int s_min_extra_isize =le16_to_cpu (EXT4_SB (inode->i_sb)->s_es->s_min_extra_isize);down_write (&EXT4_I (inode)->xattr_sem); +/* +* Set EXT4_STATE_NO_EXPAND to avoid recursion when marking inode dirty +*/ +ext4_set_inode_state (inode,EXT4_STATE_NO_EXPAND ); retry: -if (EXT4_I (inode)->i_extra_isize >= new_extra_isize) { -up_write (&EXT4_I (inode)->xattr_sem); -return 0 ; - } +if (EXT4_I (inode)->i_extra_isize >= new_extra_isize) + goto out; header =IHDR (inode, raw_inode); entry =IFIRST (header);
@@ -1324,8 +1326,7 @@ retry: (void *)header, total_ino, inode->i_sb->s_blocksize);EXT4_I (inode)->i_extra_isize = new_extra_isize; - error =0 ; - goto cleanup; + goto out; }/*
@@ -1485,6 +1486,8 @@ retry:kfree (bs); }brelse (bh); +out: +ext4_clear_inode_state (inode,EXT4_STATE_NO_EXPAND );up_write (&EXT4_I (inode)->xattr_sem);return 0 ;
@@ -1496,6 +1499,10 @@ cleanup:kfree (is);kfree (bs);brelse (bh); +/* +* We deliberately leave EXT4_STATE_NO_EXPAND set here since inode +* size expansion failed. +*/ up_write (&EXT4_I (inode)->xattr_sem);return error; }
fs/ocfs2/dlmglue.c +102 -3
135 lines not on this page · raw message
fs/ocfs2/dlmglue.h +18 -0
@@ -70,6 +70,11 @@ struct ocfs2_orphan_scan_lvb {__be32 lvb_os_seqno; }; +struct ocfs2_lock_holder { +struct list_head oh_list; +struct pid *oh_owner_pid; +}; +/* ocfs2_inode_lock_full() 'arg_flags' flags */ /* don't wait on recovery. */ #define OCFS2_META_LOCK_RECOVERY (0x01)
@@ -77,6 +82,8 @@ struct ocfs2_orphan_scan_lvb {#define OCFS2_META_LOCK_NOQUEUE (0x02)/* don't block waiting for the downconvert thread, instead return -EAGAIN */ #define OCFS2_LOCK_NONBLOCK (0x04) +/* just get back disk inode bh if we've got cluster lock. */ +#define OCFS2_META_LOCK_GETBH (0x08)/* Locking subclasses of inode cluster lock */ enum {
@@ -170,4 +177,15 @@ void ocfs2_put_dlm_debug(struct ocfs2_dlm_debug *dlm_debug);/* To set the locking protocol on module initialization */ void ocfs2_set_locking_protocol (void ); + +/* The _tracker pair is used to avoid cluster recursive locking */ +int ocfs2_inode_lock_tracker (struct inode *inode, +struct buffer_head **ret_bh, +int ex, +struct ocfs2_lock_holder *oh); +void ocfs2_inode_unlock_tracker (struct inode *inode, +int ex, +struct ocfs2_lock_holder *oh, +int had_lock); +#endif /* DLMGLUE_H */
fs/ocfs2/ocfs2.h +1 -0
@@ -166,6 +166,7 @@ struct ocfs2_lock_res {struct list_head l_blocked_list;struct list_head l_mask_waiters; +struct list_head l_holders;unsigned long l_flags;char l_name[OCFS2_LOCK_ID_MAX_LEN ];
include/net/sctp/ulpevent.h +5 -1
@@ -141,8 +141,12 @@ __u16 sctp_ulpevent_get_notification_type(const struct sctp_ulpevent *event);static inline int sctp_ulpevent_type_enabled (__u16 sn_type,struct sctp_event_subscribe *mask) { +int offset = sn_type -SCTP_SN_TYPE_BASE ;char *amask = (char *) mask; -return amask[sn_type -SCTP_SN_TYPE_BASE ]; + +if (offset >=sizeof (struct sctp_event_subscribe )) +return 0 ; +return amask[offset]; }/* Given an event subscription, is this event enabled? */
include/uapi/linux/mroute6.h +1 -0
@@ -3,6 +3,7 @@#include <linux/types.h> #include <linux/sockios.h> +#include <linux/in6.h> /* For struct sockaddr_in6. */ /* * Based on the MROUTING 3.5 defines primarily to keep
include/uapi/linux/rds.h +2 -1
@@ -35,6 +35,7 @@#define _LINUX_RDS_H#include <linux/types.h> +#include <linux/socket.h> /* For __kernel_sockaddr_storage. */ #define RDS_IB_ABI_VERSION 0x301
@@ -213,7 +214,7 @@ struct rds_get_mr_args { };struct rds_get_mr_for_dest_args { -struct sockaddr_storage dest_addr; +struct __kernel_sockaddr_storage dest_addr;struct rds_iovec vec;uint64_t cookie_addr;uint64_t flags;
kernel/bpf/verifier.c +2 -1
@@ -932,7 +932,8 @@ static int check_alu_op(struct reg_state *regs, struct bpf_insn *insn) } }else {if (insn->src_reg !=BPF_REG_0 || insn->off !=0 || - (insn->imm !=16 && insn->imm !=32 && insn->imm !=64 )) { + (insn->imm !=16 && insn->imm !=32 && insn->imm !=64 ) || +BPF_CLASS (insn->code) ==BPF_ALU64 ) {verbose ("BPF_END uses reserved fields\n" );return -EINVAL ; }
kernel/locking/lockdep.c +9 -2
@@ -3107,10 +3107,17 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,if (depth) { hlock = curr->held_locks + depth -1 ;if (hlock->class_idx == class_idx && nest_lock) { -if (hlock->references) +if (hlock->references) { +/* +* Check: unsigned int references:12, overflow. +*/ +if (DEBUG_LOCKS_WARN_ON (hlock->references == (1 <<12 )-1 )) +return 0 ; + hlock->references++; -else + }else { hlock->references =2 ; + }return 1 ; }
net/core/sock.c +2 -0
@@ -1488,6 +1488,8 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)sock_copy (newsk, sk); + newsk->sk_prot_creator = sk->sk_prot; +/* SANITY */ get_net (sock_net (newsk));sk_node_init (&newsk->sk_node);
net/ipv4/ip_vti.c +2 -1
@@ -156,6 +156,7 @@ static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev,struct ip_tunnel_parm *parms = &tunnel->parms;struct dst_entry *dst =skb_dst (skb);struct net_device *tdev;/* Device to other host */ +int pkt_len = skb->len;int err;if (!dst) {
@@ -199,7 +200,7 @@ static netdev_tx_t vti_xmit(struct sk_buff *skb, struct net_device *dev, err =dst_output (skb);if (net_xmit_eval (err) ==0 ) - err = skb->len; + err = pkt_len;iptunnel_xmit_stats (err, &dev->stats, dev->tstats);return NETDEV_TX_OK ;
net/ipv6/ip6_vti.c +2 -1
@@ -416,6 +416,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)struct net_device_stats *stats = &t->dev->stats;struct dst_entry *dst =skb_dst (skb);struct net_device *tdev; +int pkt_len = skb->len;int err =-1 ;if (!dst)
@@ -450,7 +451,7 @@ vti6_xmit(struct sk_buff *skb, struct net_device *dev, struct flowi *fl)struct pcpu_sw_netstats *tstats =this_cpu_ptr (dev->tstats);u64_stats_update_begin (&tstats->syncp); - tstats->tx_bytes += skb->len; + tstats->tx_bytes += pkt_len; tstats->tx_packets++;u64_stats_update_end (&tstats->syncp); }else {
net/l2tp/l2tp_core.c +7 -7
@@ -1317,6 +1317,9 @@ static void l2tp_tunnel_del_work(struct work_struct *work)struct sock *sk =NULL ; tunnel = container_of(work, struct l2tp_tunnel, del_work); + +l2tp_tunnel_closeall (tunnel); + sk =l2tp_tunnel_sock_lookup (tunnel);if (!sk) goto out;
@@ -1639,15 +1642,12 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);/* This function is used by the netlink TUNNEL_DELETE command. */ -int l2tp_tunnel_delete (struct l2tp_tunnel *tunnel) +void l2tp_tunnel_delete (struct l2tp_tunnel *tunnel) { -l2tp_tunnel_inc_refcount (tunnel); -l2tp_tunnel_closeall (tunnel); -if (false ==queue_work (l2tp_wq, &tunnel->del_work)) { -l2tp_tunnel_dec_refcount (tunnel); -return 1 ; +if (!test_and_set_bit (0 , &tunnel->dead)) { +l2tp_tunnel_inc_refcount (tunnel); +queue_work (l2tp_wq, &tunnel->del_work); } -return 0 ; }EXPORT_SYMBOL_GPL (l2tp_tunnel_delete);
net/l2tp/l2tp_core.h +4 -1
@@ -169,6 +169,9 @@ struct l2tp_tunnel_cfg {struct l2tp_tunnel {int magic;/* Should be L2TP_TUNNEL_MAGIC */ + +unsigned long dead; +struct rcu_head rcu;rwlock_t hlist_lock;/* protect session_hlist */ struct hlist_head session_hlist[L2TP_HASH_SIZE ];
@@ -252,7 +255,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 peer_tunnel_id, struct l2tp_tunnel_cfg *cfg, struct l2tp_tunnel **tunnelp);void l2tp_tunnel_closeall (struct l2tp_tunnel *tunnel); -int l2tp_tunnel_delete (struct l2tp_tunnel *tunnel); +void l2tp_tunnel_delete (struct l2tp_tunnel *tunnel); struct l2tp_session *l2tp_session_create(int priv_size, struct l2tp_tunnel *tunnel, u32 session_id, u32 peer_session_id,
net/netfilter/nf_conntrack_expect.c +2 -2
@@ -392,7 +392,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)struct net *net =nf_ct_exp_net (expect);struct hlist_node *next;unsigned int h; -int ret =1 ; +int ret =0 ;if (!master_help) { ret = -ESHUTDOWN ;
@@ -442,7 +442,7 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,spin_lock_bh (&nf_conntrack_expect_lock); ret =__nf_ct_expect_check (expect); -if (ret <=0 ) +if (ret <0 ) goto out; ret =nf_ct_expect_insert (expect);
net/packet/af_packet.c +16 -7
@@ -1429,9 +1429,6 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)return -EINVAL ; } -if (!po->running) -return -EINVAL ; -if (po->fanout)return -EALREADY ;
@@ -1469,7 +1466,10 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags)list_add (&match->list, &fanout_list); } err = -EINVAL ; -if (match->type == type && + +spin_lock (&po->bind_lock); +if (po->running && + match->type == type && match->prot_hook.type == po->prot_hook.type && match->prot_hook.dev == po->prot_hook.dev) { err = -ENOSPC ;
@@ -1481,6 +1481,13 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags) err =0 ; } } +spin_unlock (&po->bind_lock); + +if (err && !atomic_read (&match->sk_ref)) { +list_del (&match->list); +kfree (match); + } + out:mutex_unlock (&fanout_mutex);return err;
@@ -2655,13 +2662,15 @@ static int packet_do_bind(struct sock *sk, const char *name, int ifindex,int ret =0 ;bool unlisted = false; -if (po->fanout) -return -EINVAL ; -lock_sock (sk);spin_lock (&po->bind_lock);rcu_read_lock (); +if (po->fanout) { + ret = -EINVAL ; + goto out_unlock; + } +if (name) { dev =dev_get_by_name_rcu (sock_net (sk), name);if (!dev) {