Linux 3.10.37
Greg KH
maintainerI'm announcing the release of the 3.10.37 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/arc/boot/dts/nsimosci.dts | 12 +- arch/arc/configs/nsimosci_defconfig | 1 arch/m68k/Kconfig | 1 arch/s390/Kconfig | 1 arch/x86/crypto/ghash-clmulni-intel_asm.S | 29 ----- arch/x86/crypto/ghash-clmulni-intel_glue.c | 14 ++ drivers/cpufreq/cpufreq.c | 24 ++++ drivers/cpufreq/cpufreq_governor.c | 3 drivers/cpufreq/powernow-k6.c | 147 +++++++++++++++++++++++------ drivers/cpuidle/driver.c | 3 drivers/isdn/isdnloop/isdnloop.c | 23 ++-- drivers/net/ethernet/broadcom/tg3.c | 5 drivers/net/usb/usbnet.c | 33 +++--- drivers/net/vxlan.c | 3 drivers/net/xen-netback/netback.c | 4 drivers/vhost/net.c | 20 +++ include/linux/cpufreq.h | 1 include/linux/futex.h | 4 include/linux/usb/usbnet.h | 2 include/net/sock.h | 5 init/Kconfig | 7 + kernel/futex.c | 14 ++ lib/nlattr.c | 10 + net/8021q/vlan.c | 4 net/8021q/vlan_dev.c | 6 - net/bridge/br_multicast.c | 6 + net/core/netpoll.c | 2 net/core/rtnetlink.c | 10 + net/core/sock.c | 5 net/ipv4/inet_fragment.c | 5 net/ipv4/ipmr.c | 13 +- net/ipv4/tcp_output.c | 11 ++ net/ipv6/addrconf.c | 5 net/ipv6/exthdrs_offload.c | 4 net/ipv6/icmp.c | 2 net/ipv6/ip6_output.c | 18 +-- net/ipv6/ip6mr.c | 13 +- net/ipv6/mcast.c | 11 +- net/ipv6/route.c | 2 net/rds/iw.c | 3 net/sctp/sm_make_chunk.c | 4 net/sctp/sm_statefuns.c | 5 net/socket.c | 4 net/unix/af_unix.c | 17 ++- scripts/Makefile.headersinst | 20 ++- scripts/headers_install.sh | 7 - security/selinux/hooks.c | 36 +++++-- 48 files changed, 412 insertions(+), 169 deletions(-)
Anton Nayshtut (1):
ipv6: Fix exthdrs offload registration.
Ard Biesheuvel (1):
crypto: ghash-clmulni-intel - use C implementation for setkey()
Dan Carpenter (1):
isdnloop: several buffer overflows
Daniel Borkmann (1):
net: sctp: fix skb leakage in COOKIE ECHO path of chunk->auth_chunk
Daniel Fu (1):
cpuidle: Check the result of cpuidle_get_driver() against NULL
David Stevens (1):
vxlan: fix potential NULL dereference in arp_reduce()
Eric Dumazet (2):
net: unix: non blocking recvmsg() should not return -EINTR
tcp: tcp_release_cb() should release socket ownership
Finn Thain (1):
m68k: Skip futex_atomic_cmpxchg_inatomic() test
Florian Westphal (1):
inet: frag: make sure forced eviction removes all frags
Greg Kroah-Hartman (1):
Linux 3.10.37
Hannes Frederic Sowa (1):
ipv6: some ipv6 statistic counters failed to disable bh
Heiko Carstens (1):
futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test
Heiner Kallweit (1):
ipv6: Avoid unnecessary temporary addresses being generated
Li RongQing (1):
netpoll: fix the skb check in pkt_is_ns
Linus Lüssing (1):
bridge: multicast: add sanity check for query source addresses
Matthew Leach (1):
net: socket: error on a negative msg_namelen
Michael S. Tsirkin (2):
vhost: fix total length when packets are too short
vhost: validate vhost_get_vq_desc return value
Mikulas Patocka (3):
powernow-k6: disable cache when changing frequency
powernow-k6: correctly initialize default parameters
powernow-k6: reorder frequencies
Mischa Jonker (1):
ARC: [nsimosci] Change .dts to use generic 8250 UART
Nicolas Dichtel (4):
kbuild: fix make headers_install when path is too long
rtnetlink: fix fdb notification flags
ipmr: fix mfc notification flags
ip6mr: fix mfc notification flags
Nikolay Aleksandrov (1):
net: fix for a race condition in the inet frag code
Oliver Neukum (1):
usbnet: include wait queue head in device structure
Pablo Neira (1):
netlink: don't compare the nul-termination in nla_strcmp
Paul Durrant (1):
xen-netback: remove pointless clause from if statement
Paul Moore (1):
selinux: correctly label /proc inodes in use before the policy is loaded
Peter Boström (1):
vlan: Set correct source MAC address with TX VLAN offload enabled
Sabrina Dubroca (1):
ipv6: don't set DST_NOCOUNT for remotely added routes
Sasha Levin (1):
rds: prevent dereference of a NULL device in rds_iw_laddr_check
Stephen Boyd (1):
cpufreq: Fix timer/workqueue corruption due to double queueing
Vineet Gupta (1):
ARC: [nsimosci] Unbork console
Vlad Yasevich (2):
tg3: Do not include vlan acceleration features in vlan_features
vlan: Set hard_header_len according to available acceleration
Xiaoguang Chen (1):
cpufreq: Fix governor start/stop race condition
YOSHIFUJI Hideaki (1):
isdnloop: Validate NUL-terminated strings from user.
lucien (1):
ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly
Greg KH
maintainerMakefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 3 PATCHLEVEL = 10 -SUBLEVEL = 36 +SUBLEVEL = 37 EXTRAVERSION = NAME = TOSSUG Baby Fish
arch/arc/boot/dts/nsimosci.dts +7 -5
@@ -11,13 +11,16 @@ / { compatible = "snps,nsimosci"; - clock-frequency = <80000000>; /* 80 MHZ */ + clock-frequency = <20000000>; /* 20 MHZ */ #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&intc>; chosen { - bootargs = "console=tty0 consoleblank=0"; + /* this is for console on PGU */ + /* bootargs = "console=tty0 consoleblank=0"; */ + /* this is for console on serial */ + bootargs = "earlycon=uart8250,mmio32,0xc0000000,115200n8 console=ttyS0,115200n8 consoleblank=0 debug"; }; aliases {
@@ -44,15 +47,14 @@ }; uart0: serial@c0000000 { - compatible = "snps,dw-apb-uart"; + compatible = "ns8250"; reg = <0xc0000000 0x2000>; interrupts = <11>; - #clock-frequency = <80000000>; clock-frequency = <3686400>; baud = <115200>; reg-shift = <2>; reg-io-width = <4>; - status = "okay"; + no-loopback-test = <1>; }; pgu0: pgu@c9000000 {
arch/arc/configs/nsimosci_defconfig +1 -0
@@ -54,6 +54,7 @@ CONFIG_SERIO_ARC_PS2=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_DW=y +CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_ARC=y CONFIG_SERIAL_ARC_CONSOLE=y # CONFIG_HW_RANDOM is not set
arch/m68k/Kconfig +1 -0
@@ -16,6 +16,7 @@ config M68K select FPU if MMU select ARCH_WANT_IPC_PARSE_VERSION select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE + select HAVE_FUTEX_CMPXCHG if MMU && FUTEX select HAVE_MOD_ARCH_SPECIFIC select MODULES_USE_ELF_REL select MODULES_USE_ELF_RELA
arch/s390/Kconfig +1 -0
@@ -116,6 +116,7 @@ config S390 select HAVE_FUNCTION_GRAPH_TRACER select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACE_MCOUNT_TEST + select HAVE_FUTEX_CMPXCHG if FUTEX select HAVE_KERNEL_BZIP2 select HAVE_KERNEL_GZIP select HAVE_KERNEL_LZMA
arch/x86/crypto/ghash-clmulni-intel_asm.S +0 -29
@@ -24,10 +24,6 @@ .align 16 .Lbswap_mask: .octa 0x000102030405060708090a0b0c0d0e0f -.Lpoly: - .octa 0xc2000000000000000000000000000001 -.Ltwo_one: - .octa 0x00000001000000000000000000000001 #define DATA %xmm0 #define SHASH %xmm1
@@ -134,28 +130,3 @@ ENTRY(clmul_ghash_update) .Lupdate_just_ret: ret ENDPROC(clmul_ghash_update) - -/* - * void clmul_ghash_setkey(be128 *shash, const u8 *key); - * - * Calculate hash_key << 1 mod poly - */ -ENTRY(clmul_ghash_setkey) - movaps .Lbswap_mask, BSWAP - movups (%rsi), %xmm0 - PSHUFB_XMM BSWAP %xmm0 - movaps %xmm0, %xmm1 - psllq $1, %xmm0 - psrlq $63, %xmm1 - movaps %xmm1, %xmm2 - pslldq $8, %xmm1 - psrldq $8, %xmm2 - por %xmm1, %xmm0 - # reduction - pshufd $0b00100100, %xmm2, %xmm1 - pcmpeqd .Ltwo_one, %xmm1 - pand .Lpoly, %xmm1 - pxor %xmm1, %xmm0 - movups %xmm0, (%rdi) - ret -ENDPROC(clmul_ghash_setkey)
arch/x86/crypto/ghash-clmulni-intel_glue.c +11 -3
@@ -30,8 +30,6 @@ void clmul_ghash_mul(char *dst, const be128 *shash);void clmul_ghash_update (char *dst,const char *src,unsigned int srclen,const be128 *shash); -void clmul_ghash_setkey (be128 *shash,const u8 *key); -struct ghash_async_ctx {struct cryptd_ahash *cryptd_tfm; };
@@ -58,13 +56,23 @@ static int ghash_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen) {struct ghash_ctx *ctx =crypto_shash_ctx (tfm); +be128 *x = (be128 *)key; +u64 a, b;if (keylen !=GHASH_BLOCK_SIZE ) {crypto_shash_set_flags (tfm,CRYPTO_TFM_RES_BAD_KEY_LEN );return -EINVAL ; } -clmul_ghash_setkey (&ctx->shash, key); +/* perform multiplication by 'x' in GF(2^128) */ + a =be64_to_cpu (x->a); + b =be64_to_cpu (x->b); + + ctx->shash.a = (__be64)((b <<1 ) | (a >>63 )); + ctx->shash.b = (__be64)((a <<1 ) | (b >>63 )); + +if (a >>63 ) + ctx->shash.b ^=cpu_to_be64 (0xc2 );return 0 ; }
drivers/cpufreq/cpufreq.c +24 -0
@@ -46,6 +46,7 @@ static DEFINE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_data); static DEFINE_PER_CPU(char[CPUFREQ_NAME_LEN], cpufreq_cpu_governor);#endif static DEFINE_RWLOCK (cpufreq_driver_lock); +static DEFINE_MUTEX (cpufreq_governor_lock);/* * cpu_policy_rwsem is a per CPU reader-writer semaphore designed to cure
@@ -1563,6 +1564,21 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,pr_debug ("__cpufreq_governor for CPU %u, event %u\n" , policy->cpu, event); + +mutex_lock (&cpufreq_governor_lock); +if ((!policy->governor_enabled && (event ==CPUFREQ_GOV_STOP )) || + (policy->governor_enabled && (event ==CPUFREQ_GOV_START ))) { +mutex_unlock (&cpufreq_governor_lock); +return -EBUSY ; + } + +if (event ==CPUFREQ_GOV_STOP ) + policy->governor_enabled = false; +else if (event ==CPUFREQ_GOV_START ) + policy->governor_enabled = true; + +mutex_unlock (&cpufreq_governor_lock); + ret = policy->governor->governor (policy, event);if (!ret) {
@@ -1570,6 +1586,14 @@ static int __cpufreq_governor(struct cpufreq_policy *policy, policy->governor->initialized++; else if (event == CPUFREQ_GOV_POLICY_EXIT) policy->governor->initialized--; + } else { +/* Restore original values */ +mutex_lock (&cpufreq_governor_lock); +if (event ==CPUFREQ_GOV_STOP ) + policy->governor_enabled = true; +else if (event ==CPUFREQ_GOV_START ) + policy->governor_enabled = false; +mutex_unlock (&cpufreq_governor_lock); }/* we keep one module reference alive for
drivers/cpufreq/cpufreq_governor.c +3 -0
@@ -177,6 +177,9 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy, {int i; +if (!policy->governor_enabled) +return ; +if (!all_cpus) {__gov_queue_work (smp_processor_id (), dbs_data, delay); }else {
drivers/cpufreq/powernow-k6.c +120 -27
212 lines not on this page · raw message
drivers/cpuidle/driver.c +2 -1
@@ -251,7 +251,8 @@ struct cpuidle_driver *cpuidle_driver_ref(void)spin_lock (&cpuidle_driver_lock); drv =cpuidle_get_driver (); - drv->refcnt++; +if (drv) + drv->refcnt++;spin_unlock (&cpuidle_driver_lock);return drv;
drivers/isdn/isdnloop/isdnloop.c +15 -8
@@ -518,9 +518,9 @@ static isdnloop_stat isdnloop_cmd_table[] =static void isdnloop_fake_err (isdnloop_card *card) { -char buf[60 ]; +char buf[64 ]; -sprintf (buf,"E%s" , card->omsg); +snprintf (buf,sizeof (buf),"E%s" , card->omsg);isdnloop_fake (card, buf,-1 );isdnloop_fake (card,"NAK" ,-1 ); }
@@ -903,6 +903,8 @@ isdnloop_parse_cmd(isdnloop_card *card)case 7 :/* 0x;EAZ */ p +=3 ; +if (strlen (p) >=sizeof (card->eazlist[0 ])) +break ;strcpy (card->eazlist[ch -1 ], p);break ;case 8 :
@@ -1070,6 +1072,12 @@ isdnloop_start(isdnloop_card *card, isdnloop_sdef *sdefp)return -EBUSY ;if (copy_from_user ((char *) &sdef, (char *) sdefp,sizeof (sdef)))return -EFAULT ; + +for (i =0 ; i <3 ; i++) { +if (!memchr (sdef.num[i],0 ,sizeof (sdef.num[i]))) +return -EINVAL ; + } +spin_lock_irqsave (&card->isdnloop_lock, flags);switch (sdef.ptype) {case ISDN_PTYPE_EURO :
@@ -1127,7 +1135,7 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card) {ulong a;int i; -char cbuf[60 ]; +char cbuf[80 ];isdn_ctrl cmd;isdnloop_cdef cdef;
@@ -1192,7 +1200,6 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card)break ;if ((c->arg &255 ) <ISDNLOOP_BCH ) {char *p; -char dial[50 ];char dcode[4 ]; a = c->arg;
@@ -1204,10 +1211,10 @@ isdnloop_command(isdn_ctrl *c, isdnloop_card *card) }else /* Normal Dial */ strcpy (dcode,"CAL" ); -strcpy (dial, p); -sprintf (cbuf,"%02d;D%s_R%s,%02d,%02d,%s\n" , (int ) (a +1 ), - dcode, dial, c->parm.setup.si1, - c->parm.setup.si2, c->parm.setup.eazmsn); +snprintf (cbuf,sizeof (cbuf), +"%02d;D%s_R%s,%02d,%02d,%s\n" , (int ) (a +1 ), + dcode, p, c->parm.setup.si1, + c->parm.setup.si2, c->parm.setup.eazmsn); i =isdnloop_writecmd (cbuf,strlen (cbuf),0 , card); }break ;
drivers/net/ethernet/broadcom/tg3.c +2 -3
@@ -17308,8 +17308,6 @@ static int tg3_init_one(struct pci_dev *pdev,tg3_init_bufmgr_config (tp); - features |=NETIF_F_HW_VLAN_CTAG_TX |NETIF_F_HW_VLAN_CTAG_RX ; -/* 5700 B0 chips do not support checksumming correctly due * to hardware bugs. */
@@ -17341,7 +17339,8 @@ static int tg3_init_one(struct pci_dev *pdev, features |=NETIF_F_TSO_ECN ; } - dev->features |= features; + dev->features |= features |NETIF_F_HW_VLAN_CTAG_TX | +NETIF_F_HW_VLAN_CTAG_RX ; dev->vlan_features |= features;/*
drivers/net/usb/usbnet.c +19 -14
@@ -727,14 +727,12 @@ EXPORT_SYMBOL_GPL(usbnet_unlink_rx_urbs);// precondition: never called in_interrupt static void usbnet_terminate_urbs (struct usbnet *dev) { -DECLARE_WAIT_QUEUE_HEAD_ONSTACK (unlink_wakeup);DECLARE_WAITQUEUE (wait, current);int temp;/* ensure there are no more active urbs */ -add_wait_queue (&unlink_wakeup, &wait); +add_wait_queue (&dev->wait, &wait);set_current_state (TASK_UNINTERRUPTIBLE ); - dev->wait = &unlink_wakeup; temp =unlink_urbs (dev, &dev->txq) +unlink_urbs (dev, &dev->rxq);
@@ -748,15 +746,14 @@ static void usbnet_terminate_urbs(struct usbnet *dev) "waited for %d urb completions\n", temp); }set_current_state (TASK_RUNNING ); - dev->wait =NULL ; -remove_wait_queue (&unlink_wakeup, &wait); +remove_wait_queue (&dev->wait, &wait); }int usbnet_stop (struct net_device *net) {struct usbnet *dev =netdev_priv (net);struct driver_info *info = dev->driver_info; -int retval; +int retval, pm;clear_bit (EVENT_DEV_OPEN , &dev->flags);netif_stop_queue (net);
@@ -766,6 +763,8 @@ int usbnet_stop (struct net_device *net) net->stats.rx_packets, net->stats.tx_packets, net->stats.rx_errors, net->stats.tx_errors); +/* to not race resume */ + pm =usb_autopm_get_interface (dev->intf);/* allow minidriver to stop correctly (wireless devices to turn off * radio etc) */ if (info->stop) {
@@ -792,6 +791,9 @@ int usbnet_stop (struct net_device *net) dev->flags =0 ;del_timer_sync (&dev->delay);tasklet_kill (&dev->bh); +if (!pm) +usb_autopm_put_interface (dev->intf); +if (info->manage_power && !test_and_clear_bit (EVENT_NO_RUNTIME_PM , &dev->flags)) info->manage_power (dev,0 );
@@ -1360,11 +1362,12 @@ static void usbnet_bh (unsigned long param)/* restart RX again after disabling due to high error rate */ clear_bit (EVENT_RX_KILL , &dev->flags); -// waiting for all pending urbs to complete? -if (dev->wait) { -if ((dev->txq.qlen + dev->rxq.qlen + dev->done.qlen) ==0 ) { -wake_up (dev->wait); - } +/* waiting for all pending urbs to complete? +* only then can we forgo submitting anew +*/ +if (waitqueue_active (&dev->wait)) { +if (dev->txq.qlen + dev->rxq.qlen + dev->done.qlen ==0 ) +wake_up_all (&dev->wait);// or are we maybe short a few urbs? } else if (netif_running (dev->net) &&
@@ -1502,6 +1505,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) dev->driver_name = name; dev->msg_enable =netif_msg_init (msg_level,NETIF_MSG_DRV |NETIF_MSG_PROBE |NETIF_MSG_LINK ); +init_waitqueue_head (&dev->wait);skb_queue_head_init (&dev->rxq);skb_queue_head_init (&dev->txq);skb_queue_head_init (&dev->done);
@@ -1694,9 +1698,10 @@ int usbnet_resume (struct usb_interface *intf)spin_unlock_irq (&dev->txq.lock);if (test_bit (EVENT_DEV_OPEN , &dev->flags)) { -/* handle remote wakeup ASAP */ -if (!dev->wait && -netif_device_present (dev->net) && +/* handle remote wakeup ASAP +* we cannot race against stop +*/ +if (netif_device_present (dev->net) && !timer_pending (&dev->delay) && !test_bit (EVENT_RX_HALT , &dev->flags))rx_alloc_submit (dev,GFP_NOIO );
drivers/net/vxlan.c +3 -0
@@ -845,6 +845,9 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb)neigh_release (n); +if (reply ==NULL ) + goto out; +skb_reset_mac_header (reply);__skb_pull (reply,skb_network_offset (reply)); reply->ip_summed =CHECKSUM_UNNECESSARY ;
drivers/net/xen-netback/netback.c +2 -2
@@ -347,8 +347,8 @@ static bool start_new_rx_buffer(int offset, unsigned long size, int head)* into multiple copies tend to give large frags their * own buffers as before. */ -if ((offset + size >MAX_BUFFER_OFFSET ) && - (size <=MAX_BUFFER_OFFSET ) && offset && !head) +BUG_ON (size >MAX_BUFFER_OFFSET ); +if ((offset + size >MAX_BUFFER_OFFSET ) && offset && !head)return true;return false;
drivers/vhost/net.c +19 -1
@@ -513,9 +513,13 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, r = -ENOBUFS ; goto err; } - d =vhost_get_vq_desc (vq->dev, vq, vq->iov + seg, + r =vhost_get_vq_desc (vq->dev, vq, vq->iov + seg,ARRAY_SIZE (vq->iov) - seg, &out, &in, log, log_num); +if (unlikely (r <0 )) + goto err; + + d = r;if (d == vq->num) { r =0 ; goto err;
@@ -540,6 +544,12 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, *iovcount = seg;if (unlikely (log)) *log_num = nlogs; + +/* Detect overrun */ +if (unlikely (datalen >0 )) { + r =UIO_MAXIOV +1 ; + goto err; + }return headcount; err:vhost_discard_vq_desc (vq, headcount);
@@ -595,6 +605,14 @@ static void handle_rx(struct vhost_net *net)/* On error, stop handling until the next kick. */ if (unlikely (headcount <0 ))break ; +/* On overrun, truncate and discard */ +if (unlikely (headcount >UIO_MAXIOV )) { + msg.msg_iovlen =1 ; + err = sock->ops->recvmsg (NULL , sock, &msg, +1 ,MSG_DONTWAIT |MSG_TRUNC ); +pr_debug ("Discarded rx packet: len %zd\n" , sock_len); +continue ; + }/* OK, now we need to know about added descriptors. */ if (!headcount) {if (unlikely (vhost_enable_notify (&net->dev, vq))) {
include/linux/cpufreq.h +1 -0
@@ -107,6 +107,7 @@ struct cpufreq_policy {unsigned int policy;/* see above */ struct cpufreq_governor *governor;/* see below */ void *governor_data; +bool governor_enabled;/* governor start/stop flag */ struct work_struct update;/* if update_policy() needs to be * called, but you're in IRQ context */
include/linux/futex.h +4 -0
@@ -55,7 +55,11 @@ union futex_key {#ifdef CONFIG_FUTEX extern void exit_robust_list (struct task_struct *curr);extern void exit_pi_state_list (struct task_struct *curr); +#ifdef CONFIG_HAVE_FUTEX_CMPXCHG +#define futex_cmpxchg_enabled 1 +#else extern int futex_cmpxchg_enabled; +#endif #else static inline void exit_robust_list (struct task_struct *curr) {
include/linux/usb/usbnet.h +1 -1
@@ -30,7 +30,7 @@ struct usbnet {struct driver_info *driver_info;const char *driver_name;void *driver_priv; -wait_queue_head_t *wait; +wait_queue_head_t wait;struct mutex phy_mutex;unsigned char suspend_count;unsigned char pkt_cnt, pkt_err;
include/net/sock.h +5 -0
@@ -1437,6 +1437,11 @@ static inline void sk_wmem_free_skb(struct sock *sk, struct sk_buff *skb)*/ #define sock_owned_by_user (sk) ((sk)->sk_lock.owned) +static inline void sock_release_ownership (struct sock *sk) +{ + sk->sk_lock.owned =0 ; +} +/* * Macro so as to not evaluate some arguments when * lockdep is not enabled.
init/Kconfig +7 -0
@@ -1365,6 +1365,13 @@ config FUTEX support for "fast userspace mutexes". The resulting kernel may not run glibc-based applications correctly. +config HAVE_FUTEX_CMPXCHG + bool + help + Architectures should select this if futex_atomic_cmpxchg_inatomic() + is implemented and always working. This removes a couple of runtime + checks. + config EPOLL bool "Enable eventpoll support" if EXPERT default y
kernel/futex.c +12 -2
@@ -67,7 +67,9 @@#include "rtmutex_common.h" +#ifndef CONFIG_HAVE_FUTEX_CMPXCHG int __read_mostly futex_cmpxchg_enabled; +#endif #define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
@@ -2729,10 +2731,10 @@ SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,return do_futex (uaddr, op, val, tp, uaddr2, val2, val3); } -static int __init futex_init (void ) +static void __init futex_detect_cmpxchg (void ) { +#ifndef CONFIG_HAVE_FUTEX_CMPXCHG u32 curval; -int i;/* * This will fail and we want it. Some arch implementations do
@@ -2746,6 +2748,14 @@ static int __init futex_init(void)*/ if (cmpxchg_futex_value_locked (&curval,NULL ,0 ,0 ) == -EFAULT ) futex_cmpxchg_enabled =1 ; +#endif +} + +static int __init futex_init (void ) +{ +int i; + +futex_detect_cmpxchg ();for (i =0 ; i <ARRAY_SIZE (futex_queues); i++) {plist_head_init (&futex_queues[i].chain);
lib/nlattr.c +8 -2
@@ -303,9 +303,15 @@ int nla_memcmp(const struct nlattr *nla, const void *data,*/ int nla_strcmp (const struct nlattr *nla,const char *str) { -int len =strlen (str) +1 ; -int d =nla_len (nla) - len; +int len =strlen (str); +char *buf =nla_data (nla); +int attrlen =nla_len (nla); +int d; +if (attrlen >0 && buf[attrlen -1 ] =='\0' ) + attrlen--; + + d = attrlen - len;if (d ==0 ) d =memcmp (nla_data (nla), str, len);
net/8021q/vlan.c +3 -1
@@ -305,9 +305,11 @@ static void vlan_sync_address(struct net_device *dev,static void vlan_transfer_features (struct net_device *dev,struct net_device *vlandev) { +struct vlan_dev_priv *vlan =vlan_dev_priv (vlandev); + vlandev->gso_max_size = dev->gso_max_size; -if (dev->features &NETIF_F_HW_VLAN_CTAG_TX ) +if (vlan_hw_offload_capable (dev->features, vlan->vlan_proto)) vlandev->hard_header_len = dev->hard_header_len;else vlandev->hard_header_len = dev->hard_header_len +VLAN_HLEN ;
net/8021q/vlan_dev.c +5 -1
@@ -557,6 +557,9 @@ static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *devstruct vlan_dev_priv *vlan =vlan_dev_priv (dev);struct net_device *real_dev = vlan->real_dev; +if (saddr ==NULL ) + saddr = dev->dev_addr; +return dev_hard_header (skb, real_dev, type, daddr, saddr, len); }
@@ -608,7 +611,8 @@ static int vlan_dev_init(struct net_device *dev)#endif dev->needed_headroom = real_dev->needed_headroom; -if (real_dev->features &NETIF_F_HW_VLAN_CTAG_TX ) { +if (vlan_hw_offload_capable (real_dev->features, +vlan_dev_priv (dev)->vlan_proto)) { dev->header_ops = &vlan_passthru_header_ops; dev->hard_header_len = real_dev->hard_header_len; }else {
net/bridge/br_multicast.c +6 -0
@@ -1176,6 +1176,12 @@ static int br_ip6_multicast_query(struct net_bridge *br,br_multicast_query_received (br, port, !ipv6_addr_any (&ip6h->saddr)); +/* RFC2710+RFC3810 (MLDv1+MLDv2) require link-local source addresses */ +if (!(ipv6_addr_type (&ip6h->saddr) &IPV6_ADDR_LINKLOCAL )) { + err = -EINVAL ; + goto out; + } +if (skb->len ==sizeof (*mld)) {if (!pskb_may_pull (skb,sizeof (*mld))) { err = -EINVAL ;
net/core/netpoll.c +1 -1
@@ -745,7 +745,7 @@ static bool pkt_is_ns(struct sk_buff *skb)struct nd_msg *msg;struct ipv6hdr *hdr; -if (skb->protocol !=htons (ETH_P_ARP )) +if (skb->protocol !=htons (ETH_P_IPV6 ))return false;if (!pskb_may_pull (skb,sizeof (struct ipv6hdr ) +sizeof (struct nd_msg )))return false;
net/core/rtnetlink.c +6 -4
@@ -1973,12 +1973,13 @@ EXPORT_SYMBOL(rtmsg_ifinfo);static int nlmsg_populate_fdb_fill (struct sk_buff *skb,struct net_device *dev,u8 *addr,u32 pid,u32 seq, -int type,unsigned int flags) +int type,unsigned int flags, +int nlflags) {struct nlmsghdr *nlh;struct ndmsg *ndm; - nlh =nlmsg_put (skb, pid, seq, type,sizeof (*ndm),NLM_F_MULTI ); + nlh =nlmsg_put (skb, pid, seq, type,sizeof (*ndm), nlflags);if (!nlh)return -EMSGSIZE ;
@@ -2016,7 +2017,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, int type)if (!skb) goto errout; - err =nlmsg_populate_fdb_fill (skb, dev, addr,0 ,0 , type,NTF_SELF ); + err =nlmsg_populate_fdb_fill (skb, dev, addr,0 ,0 , type,NTF_SELF ,0 );if (err <0 ) {kfree_skb (skb); goto errout;
@@ -2249,7 +2250,8 @@ static int nlmsg_populate_fdb(struct sk_buff *skb, err =nlmsg_populate_fdb_fill (skb, dev, ha->addr, portid, seq, -RTM_NEWNEIGH ,NTF_SELF ); +RTM_NEWNEIGH ,NTF_SELF , +NLM_F_MULTI );if (err <0 )return err; skip:
net/core/sock.c +4 -1
@@ -2309,10 +2309,13 @@ void release_sock(struct sock *sk)if (sk->sk_backlog.tail)__release_sock (sk); +/* Warning : release_cb() might need to release sk ownership, +* ie call sock_release_ownership(sk) before us. +*/ if (sk->sk_prot->release_cb) sk->sk_prot->release_cb (sk); - sk->sk_lock.owned =0 ; +sock_release_ownership (sk);if (waitqueue_active (&sk->sk_lock.wq))wake_up (&sk->sk_lock.wq);spin_unlock_bh (&sk->sk_lock.slock);
net/ipv4/inet_fragment.c +3 -2
@@ -211,7 +211,7 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force) } work =frag_mem_limit (nf) - nf->low_thresh; -while (work >0 ) { +while (work >0 || force) {spin_lock (&nf->lru_lock);if (list_empty (&nf->lru_list)) {
@@ -283,9 +283,10 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,atomic_inc (&qp->refcnt);hlist_add_head (&qp->list, &hb->chain); +inet_frag_lru_add (nf, qp);spin_unlock (&hb->chain_lock);read_unlock (&f->lock); -inet_frag_lru_add (nf, qp); +return qp; }
net/ipv4/ipmr.c +8 -5
@@ -2255,13 +2255,14 @@ int ipmr_get_route(struct net *net, struct sk_buff *skb, }static int ipmr_fill_mroute (struct mr_table *mrt,struct sk_buff *skb, -u32 portid,u32 seq,struct mfc_cache *c,int cmd) +u32 portid,u32 seq,struct mfc_cache *c,int cmd, +int flags) {struct nlmsghdr *nlh;struct rtmsg *rtm;int err; - nlh =nlmsg_put (skb, portid, seq, cmd,sizeof (*rtm),NLM_F_MULTI ); + nlh =nlmsg_put (skb, portid, seq, cmd,sizeof (*rtm), flags);if (nlh ==NULL )return -EMSGSIZE ;
@@ -2329,7 +2330,7 @@ static void mroute_netlink_event(struct mr_table *mrt, struct mfc_cache *mfc,if (skb ==NULL ) goto errout; - err =ipmr_fill_mroute (mrt, skb,0 ,0 , mfc, cmd); + err =ipmr_fill_mroute (mrt, skb,0 ,0 , mfc, cmd,0 );if (err <0 ) goto errout;
@@ -2368,7 +2369,8 @@ static int ipmr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)if (ipmr_fill_mroute (mrt, skb,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq, - mfc,RTM_NEWROUTE ) <0 ) + mfc,RTM_NEWROUTE , +NLM_F_MULTI ) <0 ) goto done; next_entry: e++;
@@ -2382,7 +2384,8 @@ next_entry:if (ipmr_fill_mroute (mrt, skb,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq, - mfc,RTM_NEWROUTE ) <0 ) { + mfc,RTM_NEWROUTE , +NLM_F_MULTI ) <0 ) {spin_unlock_bh (&mfc_unres_lock); goto done; }
net/ipv4/tcp_output.c +11 -0
@@ -755,6 +755,17 @@ void tcp_release_cb(struct sock *sk)if (flags & (1UL <<TCP_TSQ_DEFERRED ))tcp_tsq_handler (sk); +/* Here begins the tricky part : +* We are called from release_sock() with : +* 1) BH disabled +* 2) sk_lock.slock spinlock held +* 3) socket owned by us (sk->sk_lock.owned == 1) +* +* But following code is meant to be called from BH handlers, +* so we should keep BH disabled, but early release socket ownership +*/ +sock_release_ownership (sk); +if (flags & (1UL <<TCP_WRITE_TIMER_DEFERRED )) {tcp_write_timer_handler (sk);__sock_put (sk);
net/ipv6/addrconf.c +4 -1
@@ -1111,8 +1111,11 @@ retry:* Lifetime is greater than REGEN_ADVANCE time units. In particular, * an implementation must not create a temporary address with a zero * Preferred Lifetime. +* Use age calculation as in addrconf_verify to avoid unnecessary +* temporary addresses being generated. */ -if (tmp_prefered_lft <= regen_advance) { + age = (now - tmp_tstamp +ADDRCONF_TIMER_FUZZ_MINUS ) /HZ ; +if (tmp_prefered_lft <= regen_advance + age) {in6_ifa_put (ifp);in6_dev_put (idev); ret =-1 ;
net/ipv6/exthdrs_offload.c +2 -2
@@ -25,11 +25,11 @@ int __init ipv6_exthdrs_offload_init(void)int ret; ret =inet6_add_offload (&rthdr_offload,IPPROTO_ROUTING ); -if (!ret) +if (ret) goto out; ret =inet6_add_offload (&dstopt_offload,IPPROTO_DSTOPTS ); -if (!ret) +if (ret) goto out_rt; out:
net/ipv6/icmp.c +1 -1
@@ -508,7 +508,7 @@ static void icmp6_send(struct sk_buff *skb, u8 type, u8 code, __u32 info) np->tclass,NULL , &fl6, (struct rt6_info *)dst, MSG_DONTWAIT, np->dontfrag);if (err) { -ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTERRORS ); +ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTERRORS );ip6_flush_pending_frames (sk); }else { err = icmpv6_push_pending_frames(sk, &fl6, &tmp_hdr,
net/ipv6/ip6_output.c +8 -10
@@ -1108,21 +1108,19 @@ static void ip6_append_data_mtu(unsigned int *mtu,unsigned int fragheaderlen, struct sk_buff *skb, struct rt6_info *rt, - bool pmtuprobe) + unsigned int orig_mtu) { if (!(rt->dst.flags & DST_XFRM_TUNNEL)) { if (skb == NULL) {/* first fragment, reserve header_len */ - *mtu = *mtu - rt->dst.header_len; + *mtu = orig_mtu - rt->dst.header_len; } else {/* * this fragment is not first, the headers * space is regarded as data space. */ - *mtu =min (*mtu, pmtuprobe ? - rt->dst.dev->mtu : -dst_mtu (rt->dst.path)); + *mtu = orig_mtu; } *maxfraglen = ((*mtu - fragheaderlen) & ~7 ) + fragheaderlen -sizeof (struct frag_hdr );
@@ -1139,7 +1137,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,struct ipv6_pinfo *np =inet6_sk (sk);struct inet_cork *cork;struct sk_buff *skb, *skb_prev =NULL ; -unsigned int maxfraglen, fragheaderlen, mtu; +unsigned int maxfraglen, fragheaderlen, mtu, orig_mtu;int exthdrlen;int dst_exthdrlen;int hh_len;
@@ -1221,6 +1219,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, dst_exthdrlen =0 ; mtu = cork->fragsize; } + orig_mtu = mtu; hh_len =LL_RESERVED_SPACE (rt->dst.dev);
@@ -1300,8 +1299,7 @@ alloc_new_skb:if (skb ==NULL || skb_prev ==NULL )ip6_append_data_mtu (&mtu, &maxfraglen, fragheaderlen, skb, rt, - np->pmtudisc == -IPV6_PMTUDISC_PROBE ); + orig_mtu); skb_prev = skb;
@@ -1556,8 +1554,8 @@ int ip6_push_pending_frames(struct sock *sk)if (proto ==IPPROTO_ICMPV6 ) {struct inet6_dev *idev =ip6_dst_idev (skb_dst (skb)); -ICMP6MSGOUT_INC_STATS_BH (net, idev,icmp6_hdr (skb)->icmp6_type); -ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTMSGS ); +ICMP6MSGOUT_INC_STATS (net, idev,icmp6_hdr (skb)->icmp6_type); +ICMP6_INC_STATS (net, idev,ICMP6_MIB_OUTMSGS ); } err =ip6_local_out (skb);
net/ipv6/ip6mr.c +8 -5
@@ -2351,13 +2351,14 @@ int ip6mr_get_route(struct net *net, }static int ip6mr_fill_mroute (struct mr6_table *mrt,struct sk_buff *skb, -u32 portid,u32 seq,struct mfc6_cache *c,int cmd) +u32 portid,u32 seq,struct mfc6_cache *c,int cmd, +int flags) {struct nlmsghdr *nlh;struct rtmsg *rtm;int err; - nlh =nlmsg_put (skb, portid, seq, cmd,sizeof (*rtm),NLM_F_MULTI ); + nlh =nlmsg_put (skb, portid, seq, cmd,sizeof (*rtm), flags);if (nlh ==NULL )return -EMSGSIZE ;
@@ -2425,7 +2426,7 @@ static void mr6_netlink_event(struct mr6_table *mrt, struct mfc6_cache *mfc,if (skb ==NULL ) goto errout; - err =ip6mr_fill_mroute (mrt, skb,0 ,0 , mfc, cmd); + err =ip6mr_fill_mroute (mrt, skb,0 ,0 , mfc, cmd,0 );if (err <0 ) goto errout;
@@ -2464,7 +2465,8 @@ static int ip6mr_rtm_dumproute(struct sk_buff *skb, struct netlink_callback *cb)if (ip6mr_fill_mroute (mrt, skb,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq, - mfc,RTM_NEWROUTE ) <0 ) + mfc,RTM_NEWROUTE , +NLM_F_MULTI ) <0 ) goto done; next_entry: e++;
@@ -2478,7 +2480,8 @@ next_entry:if (ip6mr_fill_mroute (mrt, skb,NETLINK_CB (cb->skb).portid, cb->nlh->nlmsg_seq, - mfc,RTM_NEWROUTE ) <0 ) { + mfc,RTM_NEWROUTE , +NLM_F_MULTI ) <0 ) {spin_unlock_bh (&mfc_unres_lock); goto done; }
net/ipv6/mcast.c +6 -5
@@ -1439,11 +1439,12 @@ static void mld_sendpack(struct sk_buff *skb) dst_output); out:if (!err) { -ICMP6MSGOUT_INC_STATS_BH (net, idev,ICMPV6_MLD2_REPORT ); -ICMP6_INC_STATS_BH (net, idev,ICMP6_MIB_OUTMSGS ); -IP6_UPD_PO_STATS_BH (net, idev,IPSTATS_MIB_OUTMCAST , payload_len); - }else -IP6_INC_STATS_BH (net, idev,IPSTATS_MIB_OUTDISCARDS ); +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 ); + }rcu_read_unlock ();return ;
net/ipv6/route.c +1 -1
@@ -1428,7 +1428,7 @@ int ip6_route_add(struct fib6_config *cfg)if (!table) goto out; - rt =ip6_dst_alloc (net,NULL ,DST_NOCOUNT , table); + rt =ip6_dst_alloc (net,NULL , (cfg->fc_flags &RTF_ADDRCONF ) ?0 :DST_NOCOUNT , table);if (!rt) { err = -ENOMEM ;
net/rds/iw.c +2 -1
@@ -239,7 +239,8 @@ static int rds_iw_laddr_check(__be32 addr) ret =rdma_bind_addr (cm_id, (struct sockaddr *)&sin);/* due to this, we will claim to support IB devices unless we check node_type. */ -if (ret || cm_id->device->node_type !=RDMA_NODE_RNIC ) +if (ret || !cm_id->device || + cm_id->device->node_type !=RDMA_NODE_RNIC ) ret = -EADDRNOTAVAIL ; rdsdebug("addr %pI4 ret %d node type %d\n",
net/sctp/sm_make_chunk.c +2 -2
@@ -1403,8 +1403,8 @@ static void sctp_chunk_destroy(struct sctp_chunk *chunk)BUG_ON (!list_empty (&chunk->list));list_del_init (&chunk->transmitted_list); -/* Free the chunk skb data and the SCTP_chunk stub itself. */ -dev_kfree_skb (chunk->skb); +consume_skb (chunk->skb); +consume_skb (chunk->auth_chunk);SCTP_DBG_OBJCNT_DEC (chunk);kmem_cache_free (sctp_chunk_cachep, chunk);
net/sctp/sm_statefuns.c +0 -5
@@ -767,7 +767,6 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,/* Make sure that we and the peer are AUTH capable */ if (!net->sctp.auth_enable || !new_asoc->peer.auth_capable) { -kfree_skb (chunk->auth_chunk);sctp_association_free (new_asoc);return sctp_sf_pdiscard (net, ep, asoc, type, arg, commands); }
@@ -782,10 +781,6 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net, auth.transport = chunk->transport; ret =sctp_sf_authenticate (net, ep, new_asoc, type, &auth); - -/* We can now safely free the auth_chunk clone */ -kfree_skb (chunk->auth_chunk); -if (ret !=SCTP_IERROR_NO_ERROR ) {sctp_association_free (new_asoc);return sctp_sf_pdiscard (net, ep, asoc, type, arg, commands);
net/socket.c +4 -0
@@ -1964,6 +1964,10 @@ static int copy_msghdr_from_user(struct msghdr *kmsg, {if (copy_from_user (kmsg, umsg,sizeof (struct msghdr )))return -EFAULT ; + +if (kmsg->msg_namelen <0 ) +return -EINVAL ; +if (kmsg->msg_namelen >sizeof (struct sockaddr_storage )) kmsg->msg_namelen =sizeof (struct sockaddr_storage );return 0 ;
net/unix/af_unix.c +12 -5
@@ -1792,8 +1792,11 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, goto out; err =mutex_lock_interruptible (&u->readlock); -if (err) { - err =sock_intr_errno (sock_rcvtimeo (sk, noblock)); +if (unlikely (err)) { +/* recvmsg() in non blocking mode is supposed to return -EAGAIN +* sk_rcvtimeo is not honored by mutex_lock_interruptible() +*/ + err = noblock ? -EAGAIN : -ERESTARTSYS ; goto out; }
@@ -1913,6 +1916,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock,struct unix_sock *u =unix_sk (sk);struct sockaddr_un *sunaddr = msg->msg_name;int copied =0 ; +int noblock = flags &MSG_DONTWAIT ;int check_creds =0 ;int target;int err =0 ;
@@ -1928,7 +1932,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, goto out; target =sock_rcvlowat (sk, flags&MSG_WAITALL , size); - timeo =sock_rcvtimeo (sk, flags&MSG_DONTWAIT ); + timeo =sock_rcvtimeo (sk, noblock);/* Lock the socket to prevent queue disordering * while sleeps in memcpy_tomsg
@@ -1940,8 +1944,11 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, } err =mutex_lock_interruptible (&u->readlock); -if (err) { - err =sock_intr_errno (timeo); +if (unlikely (err)) { +/* recvmsg() in non blocking mode is supposed to return -EAGAIN +* sk_rcvtimeo is not honored by mutex_lock_interruptible() +*/ + err = noblock ? -EAGAIN : -ERESTARTSYS ; goto out; }
scripts/Makefile.headersinst +14 -6
@@ -47,18 +47,24 @@ header-y := $(filter-out $(generic-y), $(header-y)) all-files := $(header-y) $(genhdr-y) $(wrapper-files) output-files := $(addprefix $(installdir)/, $(all-files)) -input-files := $(foreach hdr, $(header-y), \ +input-files1 := $(foreach hdr, $(header-y), \ $(if $(wildcard $(srcdir)/$(hdr)), \ - $(wildcard $(srcdir)/$(hdr)), \ + $(wildcard $(srcdir)/$(hdr))) \ + ) +input-files1-name := $(notdir $(input-files1)) +input-files2 := $(foreach hdr, $(header-y), \ + $(if $(wildcard $(srcdir)/$(hdr)),, \ $(if $(wildcard $(oldsrcdir)/$(hdr)), \ $(wildcard $(oldsrcdir)/$(hdr)), \ $(error Missing UAPI file $(srcdir)/$(hdr))) \ - )) \ - $(foreach hdr, $(genhdr-y), \ + )) +input-files2-name := $(notdir $(input-files2)) +input-files3 := $(foreach hdr, $(genhdr-y), \ $(if $(wildcard $(gendir)/$(hdr)), \ $(wildcard $(gendir)/$(hdr)), \ $(error Missing generated UAPI file $(gendir)/$(hdr)) \ )) +input-files3-name := $(notdir $(input-files3)) # Work out what needs to be removed oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h))
@@ -72,7 +78,9 @@ printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ file$(if $(word 2, $(all-files)),s)) cmd_install = \ - $(CONFIG_SHELL) $< $(installdir) $(input-files); \ + $(CONFIG_SHELL) $< $(installdir) $(srcdir) $(input-files1-name); \ + $(CONFIG_SHELL) $< $(installdir) $(oldsrcdir) $(input-files2-name); \ + $(CONFIG_SHELL) $< $(installdir) $(gendir) $(input-files3-name); \ for F in $(wrapper-files); do \ echo "\#include <asm-generic/$$F>" > $(installdir)/$$F; \ done; \
@@ -98,7 +106,7 @@ __headersinst: $(subdirs) $(install-file) @: targets += $(install-file) -$(install-file): scripts/headers_install.sh $(input-files) FORCE +$(install-file): scripts/headers_install.sh $(input-files1) $(input-files2) $(input-files3) FORCE $(if $(unwanted),$(call cmd,remove),) $(if $(wildcard $(dir $@)),,$(shell mkdir -p $(dir $@))) $(call if_changed,install)
scripts/headers_install.sh +5 -2
@@ -2,7 +2,7 @@ if [ $# -lt 1 ] then - echo "Usage: headers_install.sh OUTDIR [FILES...] + echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...] echo echo "Prepares kernel header files for use by user space, by removing" echo "all compiler.h definitions and #includes, removing any"
@@ -10,6 +10,7 @@ then echo "asm/inline/volatile keywords." echo echo "OUTDIR: directory to write each userspace header FILE to." + echo "SRCDIR: source directory where files are picked." echo "FILES: list of header files to operate on." exit 1
@@ -19,6 +20,8 @@ fi OUTDIR="$1" shift +SRCDIR="$1" +shift # Iterate through files listed on command line
@@ -34,7 +37,7 @@ do -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \ -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \ -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \ - "$i" > "$OUTDIR/$FILE.sed" || exit 1 + "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1 scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \ > "$OUTDIR/$FILE" [ $? -gt 1 ] && exit 1
security/selinux/hooks.c +27 -9
@@ -1361,15 +1361,33 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent isec->sid = sbsec->sid;if ((sbsec->flags &SE_SBPROC ) && !S_ISLNK (inode->i_mode)) { -if (opt_dentry) { - isec->sclass =inode_mode_to_security_class (inode->i_mode); - rc =selinux_proc_get_sid (opt_dentry, - isec->sclass, - &sid); -if (rc) - goto out_unlock; - isec->sid = sid; - } +/* We must have a dentry to determine the label on +* procfs inodes */ +if (opt_dentry) +/* Called from d_instantiate or +* d_splice_alias. */ + dentry =dget (opt_dentry); +else +/* Called from selinux_complete_init, try to +* find a dentry. */ + dentry =d_find_alias (inode); +/* +* This can be hit on boot when a file is accessed +* before the policy is loaded. When we load policy we +* may find inodes that have no dentry on the +* sbsec->isec_head list. No reason to complain as +* these will get fixed up the next time we go through +* inode_doinit() with a dentry, before these inodes +* could be used again by userspace. +*/ +if (!dentry) + goto out_unlock; + isec->sclass =inode_mode_to_security_class (inode->i_mode); + rc =selinux_proc_get_sid (dentry, isec->sclass, &sid); +dput (dentry); +if (rc) + goto out_unlock; + isec->sid = sid; }break ; }