Linux 2.6.32.37
Subsystems (42)
I'm announcing the release of the 2.6.32.37 kernel.
All users of the 2.6.32 series must upgrade.
The updated 2.6.32.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/longterm/linux-2.6.32.y.git
and can be browsed at the normal kernel.org git web browser:
http://git.kernel.org/?p=linux/kernel/git/longterm/linux-2.6.32.y.git;a=summarythanks,
greg k-h
------------
Makefile | 2 arch/powerpc/kernel/crash.c | 4 + arch/x86/kernel/cpu/mtrr/main.c | 20 ++++++--- arch/x86/kernel/head64.c | 3 + arch/x86/kernel/microcode_amd.c | 72 ++++++++++++++++++++------------- arch/x86/kernel/setup.c | 5 -- arch/x86/mm/init.c | 19 ++++++++ arch/x86/mm/init_64.c | 11 ++--- drivers/atm/solos-pci.c | 9 +++- drivers/block/cciss.h | 1 drivers/bluetooth/btusb.c | 3 + drivers/char/tpm/tpm.c | 2 drivers/mfd/ab3100-core.c | 4 - drivers/misc/ep93xx_pwm.c | 6 +- drivers/net/myri10ge/myri10ge.c | 1 drivers/net/wireless/ath/ath9k/main.c | 4 + drivers/net/wireless/b43/dma.c | 2 drivers/net/wireless/b43/dma.h | 2 drivers/net/wireless/p54/p54usb.c | 2 drivers/rtc/rtc-ds1511.c | 2 drivers/scsi/ses.c | 4 - drivers/staging/hv/Channel.c | 8 +-- drivers/staging/hv/Connection.c | 6 +- drivers/staging/hv/Vmbus.c | 2 drivers/staging/hv/VmbusPrivate.h | 1 drivers/staging/hv/netvsc_drv.c | 24 +++++++++++ drivers/staging/usbip/stub_rx.c | 40 ++++++------------ drivers/staging/usbip/stub_tx.c | 74 +++++++++++++++++++++++++++------- drivers/staging/usbip/usbip_common.c | 64 ++++++++++++++++++++++++++++- drivers/staging/usbip/usbip_common.h | 2 drivers/staging/usbip/vhci_rx.c | 3 + fs/btrfs/ctree.h | 4 + fs/btrfs/disk-io.c | 4 + fs/btrfs/ioctl.c | 4 + fs/btrfs/root-tree.c | 18 ++++++++ fs/btrfs/transaction.c | 1 fs/compat.c | 28 ++++++------ fs/ecryptfs/keystore.c | 1 fs/ecryptfs/mmap.c | 5 ++ fs/exec.c | 32 ++++++++++++-- fs/ext4/inode.c | 11 ++--- fs/nfsd/lockd.c | 1 fs/nilfs2/file.c | 12 ++--- fs/ocfs2/aops.c | 6 ++ fs/quota/dquot.c | 13 +---- fs/squashfs/dir.c | 9 ++++ fs/squashfs/namei.c | 12 +++++ fs/ubifs/commit.c | 2 fs/ubifs/debug.c | 41 ++++++++++++++++-- fs/ubifs/lpt.c | 7 +-- fs/xfs/linux-2.6/xfs_ioctl.c | 11 +++-- fs/xfs/xfs_fsops.c | 3 + include/linux/binfmts.h | 5 ++ include/scsi/scsi_device.h | 2 include/sound/soc-dapm.h | 16 +++---- kernel/kgdb.c | 9 +--- kernel/perf_event.c | 3 - kernel/signal.c | 4 - mm/mremap.c | 11 ++++- net/ax25/af_ax25.c | 2 net/bluetooth/bnep/sock.c | 1 net/bluetooth/sco.c | 1 net/bridge/netfilter/ebtables.c | 2 net/can/bcm.c | 4 - net/core/dev.c | 2 net/econet/af_econet.c | 8 ++- net/ipv4/inet_diag.c | 27 +++++++----- net/ipv4/netfilter/arp_tables.c | 3 + net/ipv4/netfilter/ip_tables.c | 3 + net/ipv4/netfilter/ipt_CLUSTERIP.c | 5 +- net/ipv6/netfilter/ip6_tables.c | 3 + net/irda/af_irda.c | 16 ++++--- net/irda/iriap.c | 6 ++ net/irda/irnet/irnet_ppp.c | 3 + net/mac80211/sta_info.c | 1 net/packet/af_packet.c | 3 - net/rds/rdma.c | 8 +++ net/rose/rose_subr.c | 18 +++++++- net/sctp/sm_make_chunk.c | 17 ++++--- net/tipc/socket.c | 1 sound/core/init.c | 4 + sound/oss/dev_table.h | 2 sound/oss/midi_synth.c | 34 +++++++-------- sound/oss/midi_synth.h | 2 sound/oss/opl3.c | 23 ++++++---- sound/oss/sequencer.c | 2 sound/pci/ens1370.c | 23 ++++++++-- sound/pci/hda/patch_realtek.c | 2 88 files changed, 659 insertions(+), 244 deletions(-)
Alex Elder (1):
xfs: zero proper structure size for geometry calls
Andreas Herrmann (1):
x86, amd-ucode: Remove needless log messages
Andy Gospodarek (1):
gro: reset skb_iif on reuse
Arjan Mels (3):
staging: usbip: bugfixes related to kthread conversion
staging: usbip: bugfix add number of packets for isochronous frames
staging: usbip: bugfix for isochronous packets and optimization
Artem Bityutskiy (3):
UBIFS: do not read flash unnecessarily
UBIFS: fix oops on error path in read_pnode
UBIFS: fix debugging failure in dbg_check_space_info
Borislav Petkov (1):
x86, microcode, AMD: Extend ucode size verification
Bud Brown (1):
cciss: fix lost command issue
Christian Lamparter (1):
p54usb: IDs for two new devices
Clemens Ladisch (1):
ALSA: ens1371: fix Creative Ectiva support
Dan Rosenberg (8):
sound/oss/opl3: validate voice and channel indexes
xfs: prevent leaking uninitialized stack memory in FSGEOMETRY_V1
irda: validate peer name and attribute lengths
irda: prevent heap corruption on invalid nickname
ROSE: prevent heap corruption with bad facilities sound/oss: remove offset from load_patch callbacks
irda: prevent integer underflow in IRLMP_ENUMDEVICES
CAN: Use inode instead of kernel address for /proc file
David S. Miller (1):
econet: Fix crash in aun_incoming().
Felix Fietkau (2):
mac80211: initialize sta->last_rx in sta_info_alloc
ath9k: fix a chip wakeup related crash in ath9k_start
Frederic Weisbecker (1):
perf: Better fit max unprivileged mlock pages for tools needs
Goldwyn Rodrigues (1):
Treat writes as new when holes span across page boundaries
Greg Kroah-Hartman (2):
Revert "x86: Cleanup highmap after brk is concluded" Linux 2.6.32.37
Haiyang Zhang (1):
staging: hv: Fix GARP not sent after Quick Migration
Herbert Xu (1):
gro: Reset dev pointer on reuse
J. Bruce Fields (1):
nfsd: fix auth_domain reference leak on nlm operations
Jan Kara (1):
quota: Don't write quota info in dquot_commit()
Jason Wessel (1):
repair gdbstub to match the gdbserial protocol specification
John Hughes (1):
ses: show devices for enclosures with no page 7
John W. Linville (1):
b43: allocate receive buffers big enough for max frame len + offset
Kamalesh Babulal (2):
powerpc/kexec: Add ifdef CONFIG_PPC_STD_MMU_64 to PPC64 code
powerpc: Fix default_machine_crash_shutdown #ifdef botch
Krishnasamy, Somasundaram (1):
ses: Avoid kernel panic when lun 0 is not mapped
Kulikov Vasiliy (2):
sound: oss: midi_synth: check get_user() return value
net: tipc: fix information leak to userland
Li Zefan (1):
Btrfs: Fix uninitialized root flags for subvolumes
Linus Torvalds (2):
mm: avoid wrapping vm_pgoff in mremap()
net: fix rds_iovec page count overflow
Marc-Antoine Perennou (1):
Bluetooth: add support for Apple MacBook Pro 8,2
Mark Brown (1):
ASoC: Explicitly say registerless widgets have no register
Nelson Elhage (1):
inet_diag: Make sure we actually run the same bytecode we audited.
Olaf Hering (1):
staging: hv: use sync_bitops when interacting with the hypervisor
Oleg Nesterov (2):
exec: make argv/envp memory visible to oom-killer
exec: copy-and-paste the fixes into compat_do_execve() paths
Peter Huewe (1):
char/tpm: Fix unitialized usage of data buffer
Philip A. Prindeville (1):
atm/solos-pci: Don't include frame pseudo-header on transmit hex-dump
Phillip Lougher (1):
Squashfs: handle corruption of directory structure
Roberto Sassu (1):
eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fix
Roland Dreier (1):
Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo
Ryusuke Konishi (1):
nilfs2: fix data loss in mmap page write for hole blocks
Stanislaw Gruszka (1):
myri10ge: fix rmmod crash
Suresh Siddha (1):
x86, mtrr, pat: Fix one cpu getting out of sync during resume
Takashi Iwai (2):
ALSA: hda - Fix SPDIF out regression on ALC889
ALSA: Fix yet another race in disconnection
Tyler Hicks (1):
eCryptfs: Unlock page in write_begin error path
Vasiliy Kulikov (13):
Bluetooth: sco: fix information leak to userspace
bridge: netfilter: fix information leak
Bluetooth: bnep: fix buffer overflow
netfilter: ip_tables: fix infoleak to userspace
netfilter: arp_tables: fix infoleak to userspace
netfilter: ipt_CLUSTERIP: fix buffer overflow
ipv6: netfilter: ip6_tables: fix infoleak to userspace
mfd: ab3100: world-writable debugfs *_priv files drivers/rtc/rtc-ds1511.c: world-writable sysfs nvram file drivers/misc/ep93xx_pwm.c: world-writable sysfs files
econet: 4 byte infoleak to the network
net: ax25: fix information leak to userland
net: packet: fix information leak to userland
Wei Yongjun (1):
sctp: fix to calc the INIT/INIT-ACK chunk length correctly is set
Yongqiang Yang (1):
ext4: fix credits computing for indirect mapped files
Makefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 32 -EXTRAVERSION = .36 +EXTRAVERSION = .37 NAME = Man-Eating Seals of Antiquity # *DOCUMENTATION*
arch/powerpc/kernel/crash.c +4 -0
@@ -163,6 +163,7 @@ static void crash_kexec_prepare_cpus(int cpu) }/* wait for all the CPUs to hit real mode but timeout if they don't come in */ +#ifdef CONFIG_PPC_STD_MMU_64 static void crash_kexec_wait_realmode (int cpu) {unsigned int msecs;
@@ -187,6 +188,7 @@ static void crash_kexec_wait_realmode(int cpu) }mb (); } +#endif /* * This function will be called by secondary cpus or by kexec cpu
@@ -445,7 +447,9 @@ void default_machine_crash_shutdown(struct pt_regs *regs)crash_kexec_prepare_cpus (crashing_cpu);cpu_set (crashing_cpu, cpus_in_crash);crash_kexec_stop_spus (); +#if defined(CONFIG_PPC_STD_MMU_64 ) && defined(CONFIG_SMP )crash_kexec_wait_realmode (crashing_cpu); +#endif if (ppc_md.kexec_cpu_down) ppc_md.kexec_cpu_down (1 ,0 ); }
arch/x86/kernel/cpu/mtrr/main.c +15 -5
@@ -262,14 +262,24 @@ set_mtrr(unsigned int reg, unsigned long base, unsigned long size, mtrr_type typ/* * HACK! -* We use this same function to initialize the mtrrs on boot. -* The state of the boot cpu's mtrrs has been saved, and we want -* to replicate across all the APs. -* If we're doing that @reg is set to something special... +* +* We use this same function to initialize the mtrrs during boot, +* resume, runtime cpu online and on an explicit request to set a +* specific MTRR. +* +* During boot or suspend, the state of the boot cpu's mtrrs has been +* saved, and we want to replicate that across all the cpus that come +* online (either at the end of boot or resume or during a runtime cpu +* online). If we're doing that, @reg is set to something special and on +* this cpu we still do mtrr_if->set_all(). During boot/resume, this +* is unnecessary if at this point we are still on the cpu that started +* the boot/resume sequence. But there is no guarantee that we are still +* on the same cpu. So we do mtrr_if->set_all() on this cpu aswell to be +* sure that we are in sync with everyone else. */ if (reg != ~0U ) mtrr_if->set (reg, base, size, type); -else if (!mtrr_aps_delayed_init) +else mtrr_if->set_all ();/* Wait for the others */
arch/x86/kernel/head64.c +3 -0
@@ -76,6 +76,9 @@ void __init x86_64_start_kernel(char * real_mode_data)/* Make NULL pointers segfault */ zap_identity_mappings (); +/* Cleanup the over mapped high alias */ +cleanup_highmap (); +for (i =0 ; i <NUM_EXCEPTION_VECTORS ; i++) {#ifdef CONFIG_EARLY_PRINTK set_intr_gate (i, &early_idt_handlers[i]);
arch/x86/kernel/microcode_amd.c +45 -27
114 lines not on this page · raw message
arch/x86/kernel/setup.c +0 -5
@@ -294,9 +294,6 @@ static void __init init_gbpages(void)static inline void init_gbpages (void ) { } -static void __init cleanup_highmap (void ) -{ -}#endif static void __init reserve_brk (void )
@@ -924,8 +921,6 @@ void __init setup_arch(char **cmdline_p)reserve_brk (); -cleanup_highmap (); -init_gbpages ();/* max_pfn_mapped is updated here */
arch/x86/mm/init.c +19 -0
@@ -287,6 +287,25 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,load_cr3 (swapper_pg_dir);#endif +#ifdef CONFIG_X86_64 +if (!after_bootmem && !start) { +pud_t *pud; +pmd_t *pmd; + + mmu_cr4_features =read_cr4 (); + +/* +* _brk_end cannot change anymore, but it and _end may be +* located on different 2M pages. cleanup_highmap(), however, +* can only consider _end when it runs, so destroy any +* mappings beyond _brk_end here. +*/ + pud =pud_offset (pgd_offset_k (_brk_end), _brk_end); + pmd =pmd_offset (pud, _brk_end -1 ); +while (++pmd <=pmd_offset (pud, (unsigned long )_end -1 )) +pmd_clear (pmd); + } +#endif __flush_tlb_all ();if (!after_bootmem && e820_table_end > e820_table_start)
arch/x86/mm/init_64.c +5 -6
@@ -49,7 +49,6 @@#include <asm/numa.h> #include <asm/cacheflush.h> #include <asm/init.h> -#include <asm/setup.h> #include <linux/bootmem.h> static unsigned long dma_reserve__initdata ;
@@ -258,18 +257,18 @@ void __init init_extra_mapping_uc(unsigned long phys, unsigned long size)* to the compile time generated pmds. This results in invalid pmds up * to the point where we hit the physaddr 0 mapping. * -* We limit the mappings to the region from _text to _brk_end. _brk_end -* is rounded up to the 2MB boundary. This catches the invalid pmds as +* We limit the mappings to the region from _text to _end. _end is +* rounded up to the 2MB boundary. This catches the invalid pmds as * well, as they are located before _text: */ void __init cleanup_highmap (void ) {unsigned long vaddr = __START_KERNEL_map; -unsigned long vaddr_end = __START_KERNEL_map + (max_pfn_mapped <<PAGE_SHIFT ); -unsigned long end =roundup ((unsigned long )_brk_end,PMD_SIZE ) -1 ; +unsigned long end =roundup ((unsigned long )_end,PMD_SIZE ) -1 ;pmd_t *pmd = level2_kernel_pgt; +pmd_t *last_pmd = pmd +PTRS_PER_PMD ; -for (; vaddr +PMD_SIZE -1 < vaddr_end; pmd++, vaddr +=PMD_SIZE ) { +for (; pmd < last_pmd; pmd++, vaddr +=PMD_SIZE ) {if (pmd_none (*pmd))continue ;if (vaddr < (unsigned long ) _text || vaddr > end)
drivers/atm/solos-pci.c +8 -1
@@ -688,7 +688,7 @@ void solos_bh(unsigned long card_arg) size); }if (atmdebug) { -dev_info (&card->dev->dev,"Received: device %d\n" , port); +dev_info (&card->dev->dev,"Received: port %d\n" , port);dev_info (&card->dev->dev,"size: %d VPI: %d VCI: %d\n" , size,le16_to_cpu (header->vpi),le16_to_cpu (header->vci));
@@ -1008,8 +1008,15 @@ static uint32_t fpga_tx(struct solos_card *card)/* Clean up and free oldskb now it's gone */ if (atmdebug) { +struct pkt_hdr *header = (void *)oldskb->data; +int size =le16_to_cpu (header->size); + +skb_pull (oldskb,sizeof (*header));dev_info (&card->dev->dev,"Transmitted: port %d\n" , port); +dev_info (&card->dev->dev,"size: %d VPI: %d VCI: %d\n" , + size,le16_to_cpu (header->vpi), +le16_to_cpu (header->vci));print_buffer (oldskb); }
drivers/block/cciss.h +1 -0
@@ -165,6 +165,7 @@ static void SA5_submit_command( ctlr_info_t *h, CommandList_struct *c)printk ("Sending %x - down to controller\n" , c->busaddr );#endif /* CCISS_DEBUG */ writel (c->busaddr, h->vaddr +SA5_REQUEST_PORT_OFFSET ); +readl (h->vaddr +SA5_REQUEST_PORT_OFFSET ); h->commands_outstanding++;if ( h->commands_outstanding > h->max_outstanding) h->max_outstanding = h->commands_outstanding;
drivers/bluetooth/btusb.c +3 -0
@@ -62,6 +62,9 @@ static struct usb_device_id btusb_table[] = {/* Apple iMac11,1 */ { USB_DEVICE(0x05ac, 0x8215) }, +/* Apple MacBookPro8,2 */ + { USB_DEVICE(0x05ac, 0x821a) }, +/* AVM BlueFRITZ! USB v2.0 */ { USB_DEVICE(0x057c, 0x3800) },
drivers/char/tpm/tpm.c +1 -1
@@ -969,7 +969,7 @@ int tpm_open(struct inode *inode, struct file *file)return -EBUSY ; } - chip->data_buffer =kmalloc (TPM_BUFSIZE *sizeof (u8),GFP_KERNEL ); + chip->data_buffer =kzalloc (TPM_BUFSIZE ,GFP_KERNEL );if (chip->data_buffer ==NULL ) {clear_bit (0 , &chip->is_open);put_device (chip->dev);
drivers/mfd/ab3100-core.c +2 -2
@@ -591,7 +591,7 @@ static void ab3100_setup_debugfs(struct ab3100 *ab3100) ab3100_get_priv.ab3100 = ab3100; ab3100_get_priv.mode = false; ab3100_get_reg_file =debugfs_create_file ("get_reg" , -S_IWUGO , ab3100_dir, &ab3100_get_priv, +S_IWUSR , ab3100_dir, &ab3100_get_priv, &ab3100_get_set_reg_fops);if (!ab3100_get_reg_file) { err = -ENOMEM ;
@@ -601,7 +601,7 @@ static void ab3100_setup_debugfs(struct ab3100 *ab3100) ab3100_set_priv.ab3100 = ab3100; ab3100_set_priv.mode = true; ab3100_set_reg_file =debugfs_create_file ("set_reg" , -S_IWUGO , ab3100_dir, &ab3100_set_priv, +S_IWUSR , ab3100_dir, &ab3100_set_priv, &ab3100_get_set_reg_fops);if (!ab3100_set_reg_file) { err = -ENOMEM ;
drivers/misc/ep93xx_pwm.c +3 -3
@@ -248,11 +248,11 @@ static ssize_t ep93xx_pwm_set_invert(struct device *dev, static DEVICE_ATTR(min_freq, S_IRUGO, ep93xx_pwm_get_min_freq, NULL); static DEVICE_ATTR(max_freq, S_IRUGO, ep93xx_pwm_get_max_freq, NULL); -static DEVICE_ATTR(freq, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(freq, S_IWUSR | S_IRUGO, ep93xx_pwm_get_freq, ep93xx_pwm_set_freq); -static DEVICE_ATTR(duty_percent, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(duty_percent, S_IWUSR | S_IRUGO, ep93xx_pwm_get_duty_percent, ep93xx_pwm_set_duty_percent); -static DEVICE_ATTR(invert, S_IWUGO | S_IRUGO, +static DEVICE_ATTR(invert, S_IWUSR | S_IRUGO, ep93xx_pwm_get_invert, ep93xx_pwm_set_invert);static struct attribute *ep93xx_pwm_attrs[] = {
drivers/net/myri10ge/myri10ge.c +1 -0
@@ -3640,6 +3640,7 @@ static void myri10ge_free_slices(struct myri10ge_priv *mgp)dma_free_coherent (&pdev->dev, bytes, ss->fw_stats, ss->fw_stats_bus); ss->fw_stats =NULL ; +netif_napi_del (&ss->napi); } }kfree (mgp->ss);
drivers/net/wireless/ath/ath9k/main.c +4 -0
@@ -1918,6 +1918,8 @@ static int ath9k_start(struct ieee80211_hw *hw)DPRINTF (sc,ATH_DBG_CONFIG ,"Starting driver with " "initial channel: %d MHz\n" , curchan->center_freq); +ath9k_ps_wakeup (sc); +mutex_lock (&sc->mutex);if (ath9k_wiphy_started (sc)) {
@@ -2025,6 +2027,8 @@ static int ath9k_start(struct ieee80211_hw *hw) mutex_unlock:mutex_unlock (&sc->mutex); +ath9k_ps_restore (sc); +return r; }
drivers/net/wireless/b43/dma.c +1 -1
@@ -1521,7 +1521,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot) dmaaddr = meta->dmaaddr; goto drop_recycle_buffer; } -if (unlikely (len > ring->rx_buffersize)) { +if (unlikely (len + ring->frameoffset > ring->rx_buffersize)) {/* The data did not fit into one descriptor buffer * and is split over multiple buffers. * This should never happen, as we try to allocate buffers
drivers/net/wireless/b43/dma.h +1 -1
@@ -163,7 +163,7 @@ struct b43_dmadesc_generic {/* DMA engine tuning knobs */ #define B43_TXRING_SLOTS 256#define B43_RXRING_SLOTS 64 -#define B43_DMA0_RX_BUFFERSIZE IEEE80211_MAX_FRAME_LEN +#define B43_DMA0_RX_BUFFERSIZE (B43_DMA0_RX_FRAMEOFFSET + IEEE80211_MAX_FRAME_LEN)struct sk_buff ;
drivers/net/wireless/p54/p54usb.c +2 -0
@@ -54,6 +54,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */ {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ + {USB_DEVICE(0x0bf8, 0x1007)}, /* Fujitsu E-5400 USB */ {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */ {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */
@@ -66,6 +67,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ {USB_DEVICE(0x2001, 0x3703)}, /* DLink DWL-G122 */ + {USB_DEVICE(0x2001, 0x3762)}, /* Conceptronic C54U */ {USB_DEVICE(0x5041, 0x2234)}, /* Linksys WUSB54G */ {USB_DEVICE(0x5041, 0x2235)}, /* Linksys WUSB54G Portable */
drivers/rtc/rtc-ds1511.c +1 -1
@@ -480,7 +480,7 @@ ds1511_nvram_write(struct kobject *kobj, struct bin_attribute *bin_attr,static struct bin_attribute ds1511_nvram_attr = { .attr = { .name ="nvram" , - .mode =S_IRUGO |S_IWUGO , + .mode =S_IRUGO |S_IWUSR , }, .size =DS1511_RAM_MAX , .read = ds1511_nvram_read,
drivers/scsi/ses.c +2 -2
@@ -389,9 +389,9 @@ static void ses_enclosure_data_process(struct enclosure_device *edev, len = (desc_ptr[2 ] <<8 ) + desc_ptr[3 ];/* skip past overall descriptor */ desc_ptr += len +4 ; -if (ses_dev->page10) - addl_desc_ptr = ses_dev->page10 +8 ; } +if (ses_dev->page10) + addl_desc_ptr = ses_dev->page10 +8 ; type_ptr = ses_dev->page1 +12 + ses_dev->page1[11 ]; components =0 ;for (i =0 ; i < types; i++, type_ptr +=4 ) {
drivers/staging/hv/Channel.c +4 -4
@@ -75,14 +75,14 @@ static void VmbusChannelSetEvent(struct vmbus_channel *Channel)if (Channel->OfferMsg.MonitorAllocated) {/* Each u32 represents 32 channels */ -set_bit (Channel->OfferMsg.ChildRelId &31 , +sync_set_bit (Channel->OfferMsg.ChildRelId &31 , (unsigned long *) gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >>5 )); monitorPage = gVmbusConnection.MonitorPages; monitorPage++;/* Get the child to parent monitor page */ -set_bit (Channel->MonitorBit, +sync_set_bit (Channel->MonitorBit, (unsigned long *)&monitorPage->TriggerGroup [Channel->MonitorGroup].Pending);
@@ -102,7 +102,7 @@ static void VmbusChannelClearEvent(struct vmbus_channel *channel)if (Channel->OfferMsg.MonitorAllocated) {/* Each u32 represents 32 channels */ -clear_bit (Channel->OfferMsg.ChildRelId &31 , +sync_clear_bit (Channel->OfferMsg.ChildRelId &31 , (unsigned long *)gVmbusConnection.SendInterruptPage + (Channel->OfferMsg.ChildRelId >>5 ));
@@ -110,7 +110,7 @@ static void VmbusChannelClearEvent(struct vmbus_channel *channel) (struct hv_monitor_page *)gVmbusConnection.MonitorPages; monitorPage++;/* Get the child to parent monitor page */ -clear_bit (Channel->MonitorBit, +sync_clear_bit (Channel->MonitorBit, (unsigned long *)&monitorPage->TriggerGroup [Channel->MonitorGroup].Pending); }
drivers/staging/hv/Connection.c +4 -2
@@ -284,7 +284,9 @@ void VmbusOnEvents(void)for (dword =0 ; dword < maxdword; dword++) {if (recvInterruptPage[dword]) {for (bit =0 ; bit <32 ; bit++) { -if (test_and_clear_bit (bit, (unsigned long *)&recvInterruptPage[dword])) { +if (sync_test_and_clear_bit (bit, + (unsigned long *) + &recvInterruptPage[dword])) { relid = (dword <<5 ) + bit;DPRINT_DBG (VMBUS ,"event detected for relid - %d" , relid);
@@ -329,7 +331,7 @@ int VmbusSetEvent(u32 childRelId)DPRINT_ENTER (VMBUS );/* Each u32 represents 32 channels */ -set_bit (childRelId &31 , +sync_set_bit (childRelId &31 , (unsigned long *)gVmbusConnection.SendInterruptPage + (childRelId >>5 ));
drivers/staging/hv/Vmbus.c +1 -1
@@ -254,7 +254,7 @@ static int VmbusOnISR(struct hv_driver *drv) event = (union hv_synic_event_flags *)page_addr +VMBUS_MESSAGE_SINT ;/* Since we are a child, we only need to check bit 0 */ -if (test_and_clear_bit (0 , (unsigned long *) &event->Flags32[0 ])) { +if (sync_test_and_clear_bit (0 , (unsigned long *) &event->Flags32[0 ])) {DPRINT_DBG (VMBUS ,"received event %d" , event->Flags32[0 ]); ret |=0x2 ; }
drivers/staging/hv/VmbusPrivate.h +1 -0
@@ -32,6 +32,7 @@#include "ChannelInterface.h" #include "RingBuffer.h" #include <linux/list.h> +#include <asm/sync_bitops.h> /*
drivers/staging/hv/netvsc_drv.c +24 -0
@@ -44,6 +44,7 @@ struct net_device_context {/* point back to our device context */ struct device_context *device_ctx;struct net_device_stats stats; +struct work_struct work; };struct netvsc_driver_context {
@@ -284,6 +285,7 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj, {struct device_context *device_ctx =to_device_context (device_obj);struct net_device *net =dev_get_drvdata (&device_ctx->device); +struct net_device_context *ndev_ctx;DPRINT_ENTER (NETVSC_DRV );
@@ -297,6 +299,8 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,netif_carrier_on (net);netif_wake_queue (net);netif_notify_peers (net); + ndev_ctx =netdev_priv (net); +schedule_work (&ndev_ctx->work); }else {netif_carrier_off (net);netif_stop_queue (net);
@@ -398,6 +402,25 @@ static const struct net_device_ops device_ops = { .ndo_set_mac_address = eth_mac_addr, }; +/* +* Send GARP packet to network peers after migrations. +* After Quick Migration, the network is not immediately operational in the +* current context when receiving RNDIS_STATUS_MEDIA_CONNECT event. So, add +* another netif_notify_peers() into a scheduled work, otherwise GARP packet +* will not be sent after quick migration, and cause network disconnection. +*/ +static void netvsc_send_garp (struct work_struct *w) +{ +struct net_device_context *ndev_ctx; +struct net_device *net; + +msleep (20 ); + ndev_ctx = container_of(w, struct net_device_context, work); + net =dev_get_drvdata (&ndev_ctx->device_ctx->device); +netif_notify_peers (net); +} + +static int netvsc_probe (struct device *device) { struct driver_context *driver_ctx =
@@ -428,6 +451,7 @@ static int netvsc_probe(struct device *device) net_device_ctx =netdev_priv (net); net_device_ctx->device_ctx = device_ctx;dev_set_drvdata (device, net); +INIT_WORK (&net_device_ctx->work, netvsc_send_garp);/* Notify the netvsc driver of the new device */ ret = net_drv_obj->Base.OnDeviceAdd (device_obj, &device_info);
drivers/staging/usbip/stub_rx.c +15 -25
@@ -168,33 +168,23 @@ static int tweak_set_configuration_cmd(struct urb *urb)static int tweak_reset_device_cmd (struct urb *urb) { -struct usb_ctrlrequest *req; -__u16 value; -__u16 index; -int ret; - - req = (struct usb_ctrlrequest *) urb->setup_packet; - value =le16_to_cpu (req->wValue); - index =le16_to_cpu (req->wIndex); - -usbip_uinfo ("reset_device (port %d) to %s\n" , index, -dev_name (&urb->dev->dev)); +struct stub_priv *priv = (struct stub_priv *) urb->context; +struct stub_device *sdev = priv->sdev; -/* all interfaces should be owned by usbip driver, so just reset it. */ - ret =usb_lock_device_for_reset (urb->dev,NULL ); -if (ret <0 ) { -dev_err (&urb->dev->dev,"lock for reset\n" ); -return ret; - } - -/* try to reset the device */ - ret =usb_reset_device (urb->dev); -if (ret <0 ) -dev_err (&urb->dev->dev,"device reset\n" ); +usbip_uinfo ("reset_device %s\n" ,dev_name (&urb->dev->dev)); -usb_unlock_device (urb->dev); - -return ret; +/* +* usb_lock_device_for_reset caused a deadlock: it causes the driver +* to unbind. In the shutdown the rx thread is signalled to shut down +* but this thread is pending in the usb_lock_device_for_reset. +* +* Instead queue the reset. +* +* Unfortunatly an existing usbip connection will be dropped due to +* driver unbinding. +*/ +usb_queue_reset_device (sdev->interface); +return 0 ; }/*
drivers/staging/usbip/stub_tx.c +60 -14
127 lines not on this page · raw message
drivers/staging/usbip/usbip_common.c +63 -1
121 lines not on this page · raw message
drivers/staging/usbip/usbip_common.h +2 -0
@@ -393,6 +393,8 @@ void usbip_header_correct_endian(struct usbip_header *pdu, int send);int usbip_recv_xbuff (struct usbip_device *ud,struct urb *urb);/* some members of urb must be substituted before. */ int usbip_recv_iso (struct usbip_device *ud,struct urb *urb); +/* some members of urb must be substituted before. */ +int usbip_pad_iso (struct usbip_device *ud,struct urb *urb);void *usbip_alloc_iso_desc_pdu (struct urb *urb,ssize_t *bufflen);
drivers/staging/usbip/vhci_rx.c +3 -0
@@ -97,6 +97,9 @@ static void vhci_recv_ret_submit(struct vhci_device *vdev,if (usbip_recv_iso (ud, urb) <0 )return ; +/* restore the padding in iso packets */ +if (usbip_pad_iso (ud, urb) <0 ) +return ;if (usbip_dbg_flag_vhci_rx)usbip_dump_urb (urb);
fs/btrfs/ctree.h +4 -0
@@ -1182,6 +1182,8 @@ struct btrfs_root {#define BTRFS_INODE_DIRSYNC (1 << 10) +#define BTRFS_INODE_ROOT_ITEM_INIT (1 << 31) +/* some macros to generate set/get funcs for the struct fields. This * assumes there is a lefoo_to_cpu for every type, so lets make a simple * one for u8:
@@ -2183,6 +2185,8 @@ int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid);int btrfs_find_orphan_roots (struct btrfs_root *tree_root);int btrfs_set_root_node (struct btrfs_root_item *item,struct extent_buffer *node); +void btrfs_check_and_init_root_item (struct btrfs_root_item *item); +/* dir-item.c */ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name,
fs/btrfs/disk-io.c +3 -1
@@ -1145,8 +1145,10 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root, root->commit_root =btrfs_root_node (root);BUG_ON (!root->node); out: -if (location->objectid !=BTRFS_TREE_LOG_OBJECTID ) +if (location->objectid !=BTRFS_TREE_LOG_OBJECTID ) { root->ref_cows =1 ; +btrfs_check_and_init_root_item (&root->root_item); + }return root; }
fs/btrfs/ioctl.c +4 -0
@@ -285,6 +285,10 @@ static noinline int create_subvol(struct btrfs_root *root, inode_item->nbytes =cpu_to_le64 (root->leafsize); inode_item->mode =cpu_to_le32 (S_IFDIR |0755 ); + root_item.flags =0 ; + root_item.byte_limit =0 ; + inode_item->flags =cpu_to_le64 (BTRFS_INODE_ROOT_ITEM_INIT ); +btrfs_set_root_bytenr (&root_item, leaf->start);btrfs_set_root_generation (&root_item, trans->transid);btrfs_set_root_level (&root_item,0 );
fs/btrfs/root-tree.c +18 -0
@@ -459,3 +459,21 @@ again:btrfs_free_path (path);return 0 ; } + +/* +* Old btrfs forgets to init root_item->flags and root_item->byte_limit +* for subvolumes. To work around this problem, we steal a bit from +* root_item->inode_item->flags, and use it to indicate if those fields +* have been properly initialized. +*/ +void btrfs_check_and_init_root_item (struct btrfs_root_item *root_item) +{ +u64 inode_flags =le64_to_cpu (root_item->inode.flags); + +if (!(inode_flags &BTRFS_INODE_ROOT_ITEM_INIT )) { + inode_flags |=BTRFS_INODE_ROOT_ITEM_INIT ; + root_item->inode.flags =cpu_to_le64 (inode_flags); + root_item->flags =0 ; + root_item->byte_limit =0 ; + } +}
fs/btrfs/transaction.c +1 -0
@@ -777,6 +777,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,record_root_in_trans (trans, root);btrfs_set_root_last_snapshot (&root->root_item, trans->transid);memcpy (new_root_item, &root->root_item,sizeof (*new_root_item)); +btrfs_check_and_init_root_item (new_root_item); key.objectid = objectid;/* record when the snapshot was created in key.offset */
fs/compat.c +15 -13
@@ -1353,6 +1353,10 @@ static int compat_count(compat_uptr_t __user *argv, int max) argv++;if (i++ >= max)return -E2BIG ; + +if (fatal_signal_pending (current)) +return -ERESTARTNOHAND ; +cond_resched (); } }return i;
@@ -1394,6 +1398,12 @@ static int compat_copy_strings(int argc, compat_uptr_t __user *argv,while (len >0 ) {int offset, bytes_to_copy; +if (fatal_signal_pending (current)) { + ret = -ERESTARTNOHAND ; + goto out; + } +cond_resched (); + offset = pos %PAGE_SIZE ;if (offset ==0 ) offset =PAGE_SIZE ;
@@ -1410,18 +1420,8 @@ static int compat_copy_strings(int argc, compat_uptr_t __user *argv,if (!kmapped_page || kpos != (pos &PAGE_MASK )) {struct page *page; -#ifdef CONFIG_STACK_GROWSUP - ret =expand_stack_downwards (bprm->vma, pos); -if (ret <0 ) { -/* We've exceed the stack rlimit. */ - ret = -E2BIG ; - goto out; - } -#endif - ret =get_user_pages (current, bprm->mm, pos, -1 ,1 ,1 , &page,NULL ); -if (ret <=0 ) { -/* We've exceed the stack rlimit. */ + page =get_arg_page (bprm, pos,1 ); +if (!page) { ret = -E2BIG ; goto out; }
@@ -1542,8 +1542,10 @@ int compat_do_execve(char * filename,return retval; out: -if (bprm->mm) +if (bprm->mm) { +acct_arg_size (bprm,0 );mmput (bprm->mm); + } out_file:if (bprm->file) {
fs/ecryptfs/keystore.c +1 -0
@@ -1542,6 +1542,7 @@ int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key,printk (KERN_ERR "Could not find key with description: [%s]\n" , sig); rc =process_request_key_err (PTR_ERR (*auth_tok_key)); + (*auth_tok_key) =NULL ; goto out; } (*auth_tok) =ecryptfs_get_key_payload_data (*auth_tok_key);
fs/ecryptfs/mmap.c +5 -0
@@ -372,6 +372,11 @@ static int ecryptfs_write_begin(struct file *file, && (pos != 0))zero_user (page,0 ,PAGE_CACHE_SIZE ); out: +if (unlikely (rc)) { +unlock_page (page); +page_cache_release (page); + *pagep =NULL ; + }return rc; }
fs/exec.c +28 -4
@@ -159,7 +159,22 @@ out:#ifdef CONFIG_MMU -static struct page *get_arg_page (struct linux_binprm *bprm,unsigned long pos, +void acct_arg_size (struct linux_binprm *bprm,unsigned long pages) +{ +struct mm_struct *mm = current->mm; +long diff = (long )(pages - bprm->vma_pages); + +if (!mm || !diff) +return ; + + bprm->vma_pages = pages; + +down_write (&mm->mmap_sem); + mm->total_vm += diff; +up_write (&mm->mmap_sem); +} + +struct page *get_arg_page (struct linux_binprm *bprm,unsigned long pos,int write) {struct page *page;
@@ -181,6 +196,8 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos,unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start;struct rlimit *rlim; +acct_arg_size (bprm, size /PAGE_SIZE ); +/* * We've historically supported up to 32 pages (ARG_MAX) * of argument strings even with small stacks
@@ -274,7 +291,11 @@ static bool valid_arg_len(struct linux_binprm *bprm, long len)#else -static struct page *get_arg_page (struct linux_binprm *bprm,unsigned long pos, +void acct_arg_size (struct linux_binprm *bprm,unsigned long pages) +{ +} + +struct page *get_arg_page (struct linux_binprm *bprm,unsigned long pos,int write) {struct page *page;
@@ -981,6 +1002,7 @@ int flush_old_exec(struct linux_binprm * bprm)/* * Release all of the old mmap stuff */ +acct_arg_size (bprm,0 ); retval =exec_mmap (bprm->mm);if (retval) goto out;
@@ -1408,8 +1430,10 @@ int do_execve(char * filename,return retval; out: -if (bprm->mm) -mmput (bprm->mm); +if (bprm->mm) { +acct_arg_size (bprm,0 ); +mmput (bprm->mm); + } out_file:if (bprm->file) {
fs/ext4/inode.c +5 -6
@@ -5458,13 +5458,12 @@ static int ext4_indirect_trans_blocks(struct inode *inode, int nrblocks,/* if nrblocks are contiguous */ if (chunk) {/* -* With N contiguous data blocks, it need at most -* N/EXT4_ADDR_PER_BLOCK(inode->i_sb) indirect blocks -* 2 dindirect blocks -* 1 tindirect block +* With N contiguous data blocks, we need at most +* N/EXT4_ADDR_PER_BLOCK(inode->i_sb) + 1 indirect blocks, +* 2 dindirect blocks, and 1 tindirect block */ - indirects = nrblocks /EXT4_ADDR_PER_BLOCK (inode->i_sb); -return indirects +3 ; +return DIV_ROUND_UP (nrblocks, +EXT4_ADDR_PER_BLOCK (inode->i_sb)) +4 ; }/* * if nrblocks are not contiguous, worse case, each block touch
fs/nfsd/lockd.c +0 -1
@@ -44,7 +44,6 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp)exp_readlock (); nfserr =nfsd_open (rqstp, &fh,S_IFREG ,NFSD_MAY_LOCK , filp);fh_put (&fh); - rqstp->rq_client =NULL ;exp_readunlock ();/* We return nlm error codes as nlm doesn't know * about nfsd, but nfsd does know about nlm..
fs/nilfs2/file.c +6 -6
@@ -72,10 +72,9 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)/* * check to see if the page is mapped already (no holes) */ -if (PageMappedToDisk (page)) { -unlock_page (page); +if (PageMappedToDisk (page)) goto mapped; - } +if (page_has_buffers (page)) {struct buffer_head *bh, *head;int fully_mapped =1 ;
@@ -90,7 +89,6 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)if (fully_mapped) {SetPageMappedToDisk (page); -unlock_page (page); goto mapped; } }
@@ -105,16 +103,18 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)return VM_FAULT_SIGBUS ; ret =block_page_mkwrite (vma, vmf, nilfs_get_block); -if (unlikely (ret)) { +if (ret !=VM_FAULT_LOCKED ) {nilfs_transaction_abort (inode->i_sb);return ret; } +nilfs_set_file_dirty (NILFS_SB (inode->i_sb), inode, +1 << (PAGE_SHIFT - inode->i_blkbits));nilfs_transaction_commit (inode->i_sb); mapped:SetPageChecked (page);wait_on_page_writeback (page); -return 0 ; +return VM_FAULT_LOCKED ; }static const struct vm_operations_struct nilfs_file_vm_ops = {
fs/ocfs2/aops.c +6 -0
@@ -1091,6 +1091,12 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno,ocfs2_figure_cluster_boundaries (OCFS2_SB (inode->i_sb), cpos, &cluster_start, &cluster_end); +/* treat the write as new if the a hole/lseek spanned across +* the page boundary. +*/ + new = new | ((i_size_read (inode) <=page_offset (page)) && + (page_offset (page) <= user_pos)); +if (page == wc->w_target_page) { map_from = user_pos & (PAGE_CACHE_SIZE -1 ); map_to = map_from + user_len;
fs/quota/dquot.c +4 -9
@@ -388,7 +388,7 @@ EXPORT_SYMBOL(dquot_acquire);*/ int dquot_commit (struct dquot *dquot) { -int ret =0 , ret2 =0 ; +int ret =0 ;struct quota_info *dqopt =sb_dqopt (dquot->dq_sb);mutex_lock (&dqopt->dqio_mutex);
@@ -400,15 +400,10 @@ int dquot_commit(struct dquot *dquot)spin_unlock (&dq_list_lock);/* Inactive dquot can be only if there was error during read/init * => we have better not writing it */ -if (test_bit (DQ_ACTIVE_B , &dquot->dq_flags)) { +if (test_bit (DQ_ACTIVE_B , &dquot->dq_flags)) ret = dqopt->ops[dquot->dq_type]->commit_dqblk (dquot); -if (info_dirty (&dqopt->info[dquot->dq_type])) { - ret2 = dqopt->ops[dquot->dq_type]->write_file_info ( - dquot->dq_sb, dquot->dq_type); - } -if (ret >=0 ) - ret = ret2; - } +else + ret = -EIO ; out_sem:mutex_unlock (&dqopt->dqio_mutex);return ret;
fs/squashfs/dir.c +9 -0
@@ -173,6 +173,11 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) length +=sizeof (dirh); dir_count =le32_to_cpu (dirh.count) +1 ; + +/* dir_count should never be larger than 256 */ +if (dir_count >256 ) + goto failed_read; +while (dir_count--) {/* * Read directory entry.
@@ -184,6 +189,10 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) size =le16_to_cpu (dire->size) +1 ; +/* size should never be larger than SQUASHFS_NAME_LEN */ +if (size >SQUASHFS_NAME_LEN ) + goto failed_read; + err =squashfs_read_metadata (inode->i_sb, dire->name, &block, &offset, size);if (err <0 )
fs/squashfs/namei.c +12 -0
@@ -175,6 +175,11 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, length +=sizeof (dirh); dir_count =le32_to_cpu (dirh.count) +1 ; + +/* dir_count should never be larger than 256 */ +if (dir_count >256 ) + goto data_error; +while (dir_count--) {/* * Read directory entry.
@@ -186,6 +191,10 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, size =le16_to_cpu (dire->size) +1 ; +/* size should never be larger than SQUASHFS_NAME_LEN */ +if (size >SQUASHFS_NAME_LEN ) + goto data_error; + err =squashfs_read_metadata (dir->i_sb, dire->name, &block, &offset, size);if (err <0 )
@@ -227,6 +236,9 @@ exit_lookup:d_add (dentry, inode);return ERR_PTR (0 ); +data_error: + err = -EIO ; + read_failure: ERROR("Unable to read directory block [%llx:%x]\n", squashfs_i(dir)->start + msblk->directory_table,
fs/ubifs/commit.c +1 -1
@@ -518,7 +518,7 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot)size_t sz;if (!(ubifs_chk_flags &UBIFS_CHK_OLD_IDX )) - goto out; +return 0 ;INIT_LIST_HEAD (&list);
fs/ubifs/debug.c +36 -5
59 lines not on this page · raw message
fs/ubifs/lpt.c +3 -4
@@ -1269,10 +1269,9 @@ static int read_pnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip) lnum = branch->lnum; offs = branch->offs; pnode =kzalloc (sizeof (struct ubifs_pnode ),GFP_NOFS ); -if (!pnode) { - err = -ENOMEM ; - goto out; - } +if (!pnode) +return -ENOMEM ; +if (lnum ==0 ) {/* * This pnode was not written which just means that the LEB
fs/xfs/linux-2.6/xfs_ioctl.c +8 -3
@@ -697,14 +697,19 @@ xfs_ioc_fsgeometry_v1( xfs_mount_t *mp, void __user *arg) { -xfs_fsop_geom_v1_t fsgeo; +xfs_fsop_geom_t fsgeo;int error; - error =xfs_fs_geometry (mp, (xfs_fsop_geom_t *)&fsgeo,3 ); + error =xfs_fs_geometry (mp, &fsgeo,3 );if (error)return -error; -if (copy_to_user (arg, &fsgeo,sizeof (fsgeo))) +/* +* Caller should have passed an argument of type +* xfs_fsop_geom_v1_t. This is a proper subset of the +* xfs_fsop_geom_t that xfs_fs_geometry() fills in. +*/ +if (copy_to_user (arg, &fsgeo,sizeof (xfs_fsop_geom_v1_t)))return -XFS_ERROR (EFAULT );return 0 ; }
fs/xfs/xfs_fsops.c +3 -0
@@ -56,6 +56,9 @@ xfs_fs_geometry(xfs_fsop_geom_t *geo, int new_version) { + + memset(geo, 0, sizeof(*geo)); + geo->blocksize = mp->m_sb.sb_blocksize; geo->rtextsize = mp->m_sb.sb_rextsize; geo->agblocks = mp->m_sb.sb_agblocks;
include/linux/binfmts.h +5 -0
@@ -29,6 +29,7 @@ struct linux_binprm{char buf[BINPRM_BUF_SIZE ];#ifdef CONFIG_MMU struct vm_area_struct *vma; +unsigned long vma_pages;#else # define MAX_ARG_PAGES 32struct page *page[MAX_ARG_PAGES ];
@@ -59,6 +60,10 @@ struct linux_binprm{unsigned long loader, exec; }; +extern void acct_arg_size (struct linux_binprm *bprm,unsigned long pages); +extern struct page *get_arg_page (struct linux_binprm *bprm,unsigned long pos, +int write); +#define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0#define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT)
include/scsi/scsi_device.h +1 -1
@@ -446,7 +446,7 @@ static inline int scsi_device_qas(struct scsi_device *sdev) }static inline int scsi_device_enclosure (struct scsi_device *sdev) { -return sdev->inquiry[6 ] & (1 <<6 ); +return sdev->inquiry ? (sdev->inquiry[6 ] & (1 <<6 )) :1 ; }static inline int scsi_device_protection (struct scsi_device *sdev)
include/sound/soc-dapm.h +8 -8
@@ -46,25 +46,25 @@/* platform domain */ #define SND_SOC_DAPM_INPUT (wname) \ { .id = snd_soc_dapm_input, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0} + .num_kcontrols = 0, .reg = SND_SOC_NOPM }#define SND_SOC_DAPM_OUTPUT (wname) \ { .id = snd_soc_dapm_output, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0} + .num_kcontrols = 0, .reg = SND_SOC_NOPM }#define SND_SOC_DAPM_MIC (wname, wevent) \ { .id = snd_soc_dapm_mic, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0, .event = wevent, \ + .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}#define SND_SOC_DAPM_HP (wname, wevent) \ { .id = snd_soc_dapm_hp, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0, .event = wevent, \ + .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}#define SND_SOC_DAPM_SPK (wname, wevent) \ { .id = snd_soc_dapm_spk, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0, .event = wevent, \ + .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}#define SND_SOC_DAPM_LINE (wname, wevent) \ { .id = snd_soc_dapm_line, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0, .event = wevent, \ + .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}/* path domain */
@@ -129,11 +129,11 @@/* events that are pre and post DAPM */ #define SND_SOC_DAPM_PRE (wname, wevent) \ { .id = snd_soc_dapm_pre, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0, .event = wevent, \ + .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD}#define SND_SOC_DAPM_POST (wname, wevent) \ { .id = snd_soc_dapm_post, .name = wname, .kcontrols = NULL, \ - .num_kcontrols = 0, .event = wevent, \ + .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD}/* stream domain */
kernel/kgdb.c +3 -6
@@ -1001,10 +1001,8 @@ static void gdb_cmd_query(struct kgdb_state *ks)switch (remcom_in_buffer[1 ]) {case 's' :case 'f' : -if (memcmp (remcom_in_buffer +2 ,"ThreadInfo" ,10 )) { -error_packet (remcom_out_buffer, -EINVAL ); +if (memcmp (remcom_in_buffer +2 ,"ThreadInfo" ,10 ))break ; - } i =0 ; remcom_out_buffer[0 ] ='m' ;
@@ -1045,10 +1043,9 @@ static void gdb_cmd_query(struct kgdb_state *ks)pack_threadid (remcom_out_buffer +2 , thref);break ;case 'T' : -if (memcmp (remcom_in_buffer +1 ,"ThreadExtraInfo," ,16 )) { -error_packet (remcom_out_buffer, -EINVAL ); +if (memcmp (remcom_in_buffer +1 ,"ThreadExtraInfo," ,16 ))break ; - } + ks->threadid =0 ; ptr = remcom_in_buffer +17 ;kgdb_hex2long (&ptr, &ks->threadid);
kernel/perf_event.c +2 -1
@@ -69,7 +69,8 @@ static inline bool perf_paranoid_kernel(void)return sysctl_perf_event_paranoid >1 ; } -int sysctl_perf_event_mlock__read_mostly =512 ;/* 'free' kb per user */ +/* Minimum for 128 pages + 1 for the user control page */ +int sysctl_perf_event_mlock__read_mostly =516 ;/* 'free' kb per user */ /* * max perf event sample rate
kernel/signal.c +2 -2
@@ -2353,7 +2353,7 @@ SYSCALL_DEFINE3(rt_sigqueueinfo, pid_t, pid, int, sig,/* Not even root can pretend to send signals from the kernel. * Nor can they impersonate a kill()/tgkill(), which adds source info. */ -if (info.si_code !=SI_QUEUE ) { +if (info.si_code >=0 || info.si_code ==SI_TKILL ) {/* We used to allow any < 0 si_code */ WARN_ON_ONCE (info.si_code <0 );return -EPERM ;
@@ -2373,7 +2373,7 @@ long do_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, siginfo_t *info)/* Not even root can pretend to send signals from the kernel. * Nor can they impersonate a kill()/tgkill(), which adds source info. */ -if (info->si_code !=SI_QUEUE ) { +if (info->si_code >=0 || info->si_code ==SI_TKILL ) {/* We used to allow any < 0 si_code */ WARN_ON_ONCE (info->si_code <0 );return -EPERM ;
mm/mremap.c +9 -2
@@ -275,9 +275,16 @@ static struct vm_area_struct *vma_to_resize(unsigned long addr,if (old_len > vma->vm_end - addr) goto Efault; -if (vma->vm_flags & (VM_DONTEXPAND |VM_PFNMAP )) { -if (new_len > old_len) +/* Need to be careful about a growing mapping */ +if (new_len > old_len) { +unsigned long pgoff; + +if (vma->vm_flags & (VM_DONTEXPAND |VM_PFNMAP )) goto Efault; + pgoff = (addr - vma->vm_start) >>PAGE_SHIFT ; + pgoff += vma->vm_pgoff; +if (pgoff + (new_len >>PAGE_SHIFT ) < pgoff) + goto Einval; }if (vma->vm_flags &VM_LOCKED ) {
net/ax25/af_ax25.c +1 -1
@@ -1391,6 +1391,7 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr,ax25_cb *ax25;int err =0 ; +memset (fsa,0 ,sizeof (fsa));lock_sock (sk); ax25 =ax25_sk (sk);
@@ -1402,7 +1403,6 @@ static int ax25_getname(struct socket *sock, struct sockaddr *uaddr, fsa->fsa_ax25.sax25_family =AF_AX25 ; fsa->fsa_ax25.sax25_call = ax25->dest_addr; - fsa->fsa_ax25.sax25_ndigis =0 ;if (ax25->digipeat !=NULL ) { ndigi = ax25->digipeat->ndigi;
net/bluetooth/bnep/sock.c +1 -0
@@ -88,6 +88,7 @@ static int bnep_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned longsockfd_put (nsock);return -EBADFD ; } + ca.device[sizeof (ca.device)-1 ] =0 ; err =bnep_add_connection (&ca, nsock);if (!err) {
net/bluetooth/sco.c +1 -0
@@ -700,6 +700,7 @@ static int sco_sock_getsockopt_old(struct socket *sock, int optname, char __userbreak ; } +memset (&cinfo,0 ,sizeof (cinfo)); cinfo.hci_handle =sco_pi (sk)->conn->hcon->handle;memcpy (cinfo.dev_class,sco_pi (sk)->conn->hcon->dev_class,3 );
net/bridge/netfilter/ebtables.c +2 -0
@@ -979,6 +979,8 @@ static int do_replace(struct net *net, void __user *user, unsigned int len)if (tmp.num_counters >=INT_MAX /sizeof (struct ebt_counter ))return -ENOMEM ; + tmp.name[sizeof (tmp.name) -1 ] =0 ; + countersize =COUNTER_OFFSET (tmp.nentries) * nr_cpu_ids; newinfo =vmalloc (sizeof (*newinfo) + countersize);if (!newinfo)
net/can/bcm.c +2 -2
@@ -124,7 +124,7 @@ struct bcm_sock {struct list_head tx_ops;unsigned long dropped_usr_msgs;struct proc_dir_entry *bcm_proc_read; -char procname [20 ];/* pointer printed in ASCII with \0 */ +char procname [32 ];/* inode number in decimal with \0 */ };static inline struct bcm_sock *bcm_sk (const struct sock *sk)
@@ -1519,7 +1519,7 @@ static int bcm_connect(struct socket *sock, struct sockaddr *uaddr, int len,if (proc_dir) {/* unique socket address as filename */ -sprintf (bo->procname,"%p" , sock); +sprintf (bo->procname,"%lu" ,sock_i_ino (sk)); bo->bcm_proc_read =proc_create_data (bo->procname,0644 , proc_dir, &bcm_proc_fops, sk);
net/core/dev.c +2 -0
@@ -2614,6 +2614,8 @@ void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) {__skb_pull (skb,skb_headlen (skb));skb_reserve (skb,NET_IP_ALIGN -skb_headroom (skb)); + skb->dev = napi->dev; + skb->iif =0 ; napi->skb = skb; }
net/econet/af_econet.c +6 -2
@@ -428,10 +428,10 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock, udpdest.sin_addr.s_addr =htonl (network | addr.station); } +memset (&ah,0 ,sizeof (ah)); ah.port = port; ah.cb = cb &0x7f ; ah.code =2 ;/* magic */ - ah.pad =0 ;/* tack our header on the front of the iovec */ size =sizeof (struct aunhdr );
@@ -843,9 +843,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len) {struct iphdr *ip =ip_hdr (skb);unsigned char stn =ntohl (ip->saddr) &0xff ; +struct dst_entry *dst =skb_dst (skb); +struct ec_device *edev =NULL ;struct sock *sk;struct sk_buff *newskb; -struct ec_device *edev = skb->dev->ec_ptr; + +if (dst) + edev = dst->dev->ec_ptr;if (! edev) goto bad;
net/ipv4/inet_diag.c +16 -11
@@ -489,9 +489,11 @@ static int inet_csk_diag_dump(struct sock *sk, {struct inet_diag_req *r =NLMSG_DATA (cb->nlh); -if (cb->nlh->nlmsg_len >4 +NLMSG_SPACE (sizeof (*r))) { +if (nlmsg_attrlen (cb->nlh,sizeof (*r))) {struct inet_diag_entry entry; -struct rtattr *bc = (struct rtattr *)(r +1 ); +const struct nlattr *bc =nlmsg_find_attr (cb->nlh, +sizeof (*r), +INET_DIAG_REQ_BYTECODE );struct inet_sock *inet =inet_sk (sk); entry.family = sk->sk_family;
@@ -511,7 +513,7 @@ static int inet_csk_diag_dump(struct sock *sk, entry.dport =ntohs (inet->dport); entry.userlocks = sk->sk_userlocks; -if (!inet_diag_bc_run (RTA_DATA (bc),RTA_PAYLOAD (bc), &entry)) +if (!inet_diag_bc_run (nla_data (bc),nla_len (bc), &entry))return 0 ; }
@@ -526,9 +528,11 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw, {struct inet_diag_req *r =NLMSG_DATA (cb->nlh); -if (cb->nlh->nlmsg_len >4 +NLMSG_SPACE (sizeof (*r))) { +if (nlmsg_attrlen (cb->nlh,sizeof (*r))) {struct inet_diag_entry entry; -struct rtattr *bc = (struct rtattr *)(r +1 ); +const struct nlattr *bc =nlmsg_find_attr (cb->nlh, +sizeof (*r), +INET_DIAG_REQ_BYTECODE ); entry.family = tw->tw_family;#if defined(CONFIG_IPV6 ) || defined (CONFIG_IPV6_MODULE )
@@ -547,7 +551,7 @@ static int inet_twsk_diag_dump(struct inet_timewait_sock *tw, entry.dport =ntohs (tw->tw_dport); entry.userlocks =0 ; -if (!inet_diag_bc_run (RTA_DATA (bc),RTA_PAYLOAD (bc), &entry)) +if (!inet_diag_bc_run (nla_data (bc),nla_len (bc), &entry))return 0 ; }
@@ -617,7 +621,7 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,struct inet_diag_req *r =NLMSG_DATA (cb->nlh);struct inet_connection_sock *icsk =inet_csk (sk);struct listen_sock *lopt; -struct rtattr *bc =NULL ; +const struct nlattr *bc =NULL ;struct inet_sock *inet =inet_sk (sk);int j, s_j;int reqnum, s_reqnum;
@@ -637,8 +641,9 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk,if (!lopt || !lopt->qlen) goto out; -if (cb->nlh->nlmsg_len >4 +NLMSG_SPACE (sizeof (*r))) { - bc = (struct rtattr *)(r +1 ); +if (nlmsg_attrlen (cb->nlh,sizeof (*r))) { + bc =nlmsg_find_attr (cb->nlh,sizeof (*r), +INET_DIAG_REQ_BYTECODE ); entry.sport = inet->num; entry.userlocks = sk->sk_userlocks; }
@@ -671,8 +676,8 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, &ireq->rmt_addr; entry.dport =ntohs (ireq->rmt_port); -if (!inet_diag_bc_run (RTA_DATA (bc), -RTA_PAYLOAD (bc), &entry)) +if (!inet_diag_bc_run (nla_data (bc), +nla_len (bc), &entry))continue ; }
net/ipv4/netfilter/arp_tables.c +3 -0
@@ -1086,6 +1086,7 @@ static int do_replace(struct net *net, void __user *user, unsigned int len)/* overflow check */ if (tmp.num_counters >=INT_MAX /sizeof (struct xt_counters ))return -ENOMEM ; + tmp.name[sizeof (tmp.name)-1 ] =0 ; newinfo =xt_alloc_table_info (tmp.size);if (!newinfo)
@@ -1508,6 +1509,7 @@ static int compat_do_replace(struct net *net, void __user *user,return -ENOMEM ;if (tmp.num_counters >=INT_MAX /sizeof (struct xt_counters ))return -ENOMEM ; + tmp.name[sizeof (tmp.name)-1 ] =0 ; newinfo =xt_alloc_table_info (tmp.size);if (!newinfo)
@@ -1763,6 +1765,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len ret = -EFAULT ;break ; } + rev.name[sizeof (rev.name)-1 ] =0 ; try_then_request_module(xt_find_revision(NFPROTO_ARP, rev.name, rev.revision, 1, &ret),
net/ipv4/netfilter/ip_tables.c +3 -0
@@ -1290,6 +1290,7 @@ do_replace(struct net *net, void __user *user, unsigned int len)/* overflow check */ if (tmp.num_counters >=INT_MAX /sizeof (struct xt_counters ))return -ENOMEM ; + tmp.name[sizeof (tmp.name)-1 ] =0 ; newinfo =xt_alloc_table_info (tmp.size);if (!newinfo)
@@ -1820,6 +1821,7 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len)return -ENOMEM ;if (tmp.num_counters >=INT_MAX /sizeof (struct xt_counters ))return -ENOMEM ; + tmp.name[sizeof (tmp.name)-1 ] =0 ; newinfo =xt_alloc_table_info (tmp.size);if (!newinfo)
@@ -2044,6 +2046,7 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) ret = -EFAULT ;break ; } + rev.name[sizeof (rev.name)-1 ] =0 ;if (cmd ==IPT_SO_GET_REVISION_TARGET ) target =1 ;
net/ipv4/netfilter/ipt_CLUSTERIP.c +4 -1
@@ -666,8 +666,11 @@ static ssize_t clusterip_proc_write(struct file *file, const char __user *input,struct clusterip_config *c = pde->data;unsigned long nodenum; -if (copy_from_user (buffer, input,PROC_WRITELEN )) +if (size >PROC_WRITELEN ) +return -EIO ; +if (copy_from_user (buffer, input, size))return -EFAULT ; + buffer[size] =0 ;if (*buffer =='+' ) { nodenum =simple_strtoul (buffer+1 ,NULL ,10 );
net/ipv6/netfilter/ip6_tables.c +3 -0
@@ -1323,6 +1323,7 @@ do_replace(struct net *net, void __user *user, unsigned int len)/* overflow check */ if (tmp.num_counters >=INT_MAX /sizeof (struct xt_counters ))return -ENOMEM ; + tmp.name[sizeof (tmp.name)-1 ] =0 ; newinfo =xt_alloc_table_info (tmp.size);if (!newinfo)
@@ -1855,6 +1856,7 @@ compat_do_replace(struct net *net, void __user *user, unsigned int len)return -ENOMEM ;if (tmp.num_counters >=INT_MAX /sizeof (struct xt_counters ))return -ENOMEM ; + tmp.name[sizeof (tmp.name)-1 ] =0 ; newinfo =xt_alloc_table_info (tmp.size);if (!newinfo)
@@ -2079,6 +2081,7 @@ do_ip6t_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) ret = -EFAULT ;break ; } + rev.name[sizeof (rev.name)-1 ] =0 ;if (cmd ==IP6T_SO_GET_REVISION_TARGET ) target =1 ;
net/irda/af_irda.c +9 -7
@@ -2164,6 +2164,14 @@ static int irda_getsockopt(struct socket *sock, int level, int optname,switch (optname) {case IRLMP_ENUMDEVICES : + +/* Offset to first device entry */ + offset =sizeof (struct irda_device_list ) - +sizeof (struct irda_device_info ); + +if (len < offset) +return -EINVAL ; +/* Ask lmp for the current discovery log */ discoveries =irlmp_get_discoveries (&list.len, self->mask.word, self->nslots);
@@ -2173,15 +2181,9 @@ static int irda_getsockopt(struct socket *sock, int level, int optname, err =0 ;/* Write total list length back to client */ -if (copy_to_user (optval, &list, -sizeof (struct irda_device_list ) - -sizeof (struct irda_device_info ))) +if (copy_to_user (optval, &list, offset)) err = -EFAULT ; -/* Offset to first device entry */ - offset =sizeof (struct irda_device_list ) - -sizeof (struct irda_device_info ); -/* Copy the list itself - watch for overflow */ if (list.len >2048 ) {
net/irda/iriap.c +6 -0
@@ -655,10 +655,16 @@ static void iriap_getvaluebyclass_indication(struct iriap_cb *self, n =1 ; name_len = fp[n++]; + + IRDA_ASSERT(name_len < IAS_MAX_CLASSNAME + 1, return;); +memcpy (name, fp+n, name_len); n+=name_len; name[name_len] ='\0' ; attr_len = fp[n++]; + + IRDA_ASSERT(attr_len < IAS_MAX_ATTRIBNAME + 1, return;); +memcpy (attr, fp+n, attr_len); n+=attr_len; attr[attr_len] ='\0' ;
net/irda/irnet/irnet_ppp.c +3 -0
@@ -106,6 +106,9 @@ irnet_ctrl_write(irnet_socket * ap,while (isspace (start[length -1 ])) length--; +DABORT (length <5 || length >NICKNAME_MAX_LEN +5 , + -EINVAL ,CTRL_ERROR ,"Invalid nickname.\n" ); +/* Copy the name for later reuse */ memcpy (ap->rname, start +5 , length -5 ); ap->rname[length -5 ] ='\0' ;
net/mac80211/sta_info.c +1 -0
@@ -276,6 +276,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,memcpy (sta->sta.addr, addr,ETH_ALEN ); sta->local = local; sta->sdata = sdata; + sta->last_rx = jiffies; sta->rate_ctrl =rate_control_get (local->rate_ctrl); sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl,
net/packet/af_packet.c +2 -1
@@ -1526,7 +1526,7 @@ static int packet_getname_spkt(struct socket *sock, struct sockaddr *uaddr, uaddr->sa_family =AF_PACKET ; dev =dev_get_by_index (sock_net (sk),pkt_sk (sk)->ifindex);if (dev) { -strlcpy (uaddr->sa_data, dev->name,15 ); +strncpy (uaddr->sa_data, dev->name,14 );dev_put (dev); }else memset (uaddr->sa_data,0 ,14 );
@@ -1549,6 +1549,7 @@ static int packet_getname(struct socket *sock, struct sockaddr *uaddr, sll->sll_family =AF_PACKET ; sll->sll_ifindex = po->ifindex; sll->sll_protocol = po->num; + sll->sll_pkttype =0 ; dev =dev_get_by_index (sock_net (sk), po->ifindex);if (dev) { sll->sll_hatype = dev->type;
net/rds/rdma.c +8 -0
@@ -473,6 +473,14 @@ static struct rds_rdma_op *rds_rdma_prepare(struct rds_sock *rs, max_pages =max (nr, max_pages); nr_pages += nr; + +/* +* nr_pages for one entry is limited to (UINT_MAX>>PAGE_SHIFT)+1, +* so tot_pages cannot overflow without first going negative. +*/ +if ((int )nr_pages <0 ) + ret = -EINVAL ; + goto out; } pages =kcalloc (max_pages,sizeof (struct page *),GFP_KERNEL );
net/rose/rose_subr.c +16 -2
@@ -289,10 +289,15 @@ static int rose_parse_national(unsigned char *p, struct rose_facilities_struct * facilities->source_ndigis =0 ; facilities->dest_ndigis =0 ;for (pt = p +2 , lg =0 ; lg < l ; pt +=AX25_ADDR_LEN , lg +=AX25_ADDR_LEN ) { -if (pt[6 ] &AX25_HBIT ) +if (pt[6 ] &AX25_HBIT ) { +if (facilities->dest_ndigis >=ROSE_MAX_DIGIS ) +return -1 ;memcpy (&facilities->dest_digis[facilities->dest_ndigis++], pt,AX25_ADDR_LEN ); -else + }else { +if (facilities->source_ndigis >=ROSE_MAX_DIGIS ) +return -1 ;memcpy (&facilities->source_digis[facilities->source_ndigis++], pt,AX25_ADDR_LEN ); + } } } p += l +2 ;
@@ -332,6 +337,11 @@ static int rose_parse_ccitt(unsigned char *p, struct rose_facilities_struct *faccase 0xC0 : l = p[1 ]; + +/* Prevent overflows*/ +if (l <10 || l >20 ) +return -1 ; +if (*p ==FAC_CCITT_DEST_NSAP ) {memcpy (&facilities->source_addr, p +7 ,ROSE_ADDR_LEN );memcpy (callsign, p +12 , l -10 );
@@ -372,12 +382,16 @@ int rose_parse_facilities(unsigned char *p,switch (*p) {case FAC_NATIONAL :/* National */ len =rose_parse_national (p +1 , facilities, facilities_len -1 ); +if (len <0 ) +return 0 ; facilities_len -= len +1 ; p += len +1 ;break ;case FAC_CCITT :/* CCITT */ len =rose_parse_ccitt (p +1 , facilities, facilities_len -1 ); +if (len <0 ) +return 0 ; facilities_len -= len +1 ; p += len +1 ;break ;
net/sctp/sm_make_chunk.c +10 -7
@@ -230,7 +230,8 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, sp =sctp_sk (asoc->base.sk); num_types = sp->pf->supported_addrs (sp, types); - chunksize =sizeof (init) + addrs_len +SCTP_SAT_LEN (num_types); + chunksize =sizeof (init) + addrs_len; + chunksize +=WORD_ROUND (SCTP_SAT_LEN (num_types)); chunksize +=sizeof (ecap_param);if (sctp_prsctp_enable)
@@ -260,14 +261,14 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,/* Add HMACS parameter length if any were defined */ auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;if (auth_hmacs->length) - chunksize +=ntohs (auth_hmacs->length); + chunksize +=WORD_ROUND (ntohs (auth_hmacs->length));else auth_hmacs =NULL ;/* Add CHUNKS parameter length */ auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;if (auth_chunks->length) - chunksize +=ntohs (auth_chunks->length); + chunksize +=WORD_ROUND (ntohs (auth_chunks->length));else auth_chunks =NULL ;
@@ -277,7 +278,8 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,/* If we have any extensions to report, account for that */ if (num_ext) - chunksize +=sizeof (sctp_supported_ext_param_t) + num_ext; + chunksize +=WORD_ROUND (sizeof (sctp_supported_ext_param_t) + + num_ext);/* RFC 2960 3.3.2 Initiation (INIT) (1) *
@@ -419,13 +421,13 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, auth_hmacs = (sctp_paramhdr_t *)asoc->c.auth_hmacs;if (auth_hmacs->length) - chunksize +=ntohs (auth_hmacs->length); + chunksize +=WORD_ROUND (ntohs (auth_hmacs->length));else auth_hmacs =NULL ; auth_chunks = (sctp_paramhdr_t *)asoc->c.auth_chunks;if (auth_chunks->length) - chunksize +=ntohs (auth_chunks->length); + chunksize +=WORD_ROUND (ntohs (auth_chunks->length));else auth_chunks =NULL ;
@@ -434,7 +436,8 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, }if (num_ext) - chunksize +=sizeof (sctp_supported_ext_param_t) + num_ext; + chunksize +=WORD_ROUND (sizeof (sctp_supported_ext_param_t) + + num_ext);/* Now allocate and fill out the chunk. */ retval =sctp_make_chunk (asoc,SCTP_CID_INIT_ACK ,0 , chunksize);
net/tipc/socket.c +1 -0
@@ -393,6 +393,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr,struct sockaddr_tipc *addr = (struct sockaddr_tipc *)uaddr;struct tipc_sock *tsock =tipc_sk (sock->sk); +memset (addr,0 ,sizeof (*addr));if (peer) {if ((sock->state !=SS_CONNECTED ) && ((peer !=2 ) || (sock->state !=SS_DISCONNECTING )))
sound/core/init.c +4 -0
@@ -848,6 +848,7 @@ int snd_card_file_add(struct snd_card *card, struct file *file)return -ENOMEM ; mfile->file = file; mfile->disconnected_f_op =NULL ; +INIT_LIST_HEAD (&mfile->shutdown_list);spin_lock (&card->files_lock);if (card->shutdown) {spin_unlock (&card->files_lock);
@@ -883,6 +884,9 @@ int snd_card_file_remove(struct snd_card *card, struct file *file)list_for_each_entry (mfile, &card->files_list, list) {if (mfile->file == file) {list_del (&mfile->list); +spin_lock (&shutdown_lock); +list_del (&mfile->shutdown_list); +spin_unlock (&shutdown_lock);if (mfile->disconnected_f_op)fops_put (mfile->disconnected_f_op); found = mfile;
sound/oss/dev_table.h +1 -1
@@ -271,7 +271,7 @@ struct synth_operationsvoid (*reset) (int dev);void (*hw_control) (int dev,unsigned char *event);int (*load_patch) (int dev,int format,const char __user *addr, -int offs,int count,int pmgr_flag); +int count,int pmgr_flag);void (*aftertouch) (int dev,int voice,int pressure);void (*controller) (int dev,int voice,int ctrl_num,int value);void (*panning) (int dev,int voice,int value);
sound/oss/midi_synth.c +16 -18
@@ -476,7 +476,7 @@ EXPORT_SYMBOL(midi_synth_hw_control);int midi_synth_load_patch (int dev,int format,const char __user *addr, -int offs,int count,int pmgr_flag) +int count,int pmgr_flag) {int orig_dev = synth_devs[dev]->midi_dev;
@@ -491,39 +491,37 @@ midi_synth_load_patch(int dev, int format, const char __user *addr,if (!prefix_cmd (orig_dev,0xf0 ))return 0 ; +/* Invalid patch format */ if (format !=SYSEX_PATCH ) - { -/* printk("MIDI Error: Invalid patch format (key) 0x%x\n", format);*/ return -EINVAL ; - } + +/* Patch header too short */ if (count < hdr_size) - { -/* printk("MIDI Error: Patch header too short\n");*/ return -EINVAL ; - } + count -= hdr_size;/* -* Copy the header from user space but ignore the first bytes which have -* been transferred already. +* Copy the header from user space */ -if (copy_from_user (&((char *) &sysex)[offs], &(addr)[offs], hdr_size - offs)) +if (copy_from_user (&sysex, addr, hdr_size))return -EFAULT ; - -if (count < sysex.len) - { -/* printk(KERN_WARNING "MIDI Warning: Sysex record too short (%d<%d)\n", count, (int) sysex.len);*/ + +/* Sysex record too short */ +if ((unsigned )count < (unsigned )sysex.len) sysex.len = count; - } - left = sysex.len; - src_offs =0 ; + + left = sysex.len; + src_offs =0 ;for (i =0 ; i < left && !signal_pending (current); i++) {unsigned char data; -get_user (*(unsigned char *) &data, (unsigned char __user *) &((addr)[hdr_size + i])); +if (get_user (data, + (unsigned char __user *)(addr + hdr_size + i))) +return -EFAULT ; eox_seen = (i >0 && data &0x80 );/* End of sysex */
sound/oss/midi_synth.h +1 -1
@@ -8,7 +8,7 @@ int midi_synth_open (int dev, int mode);void midi_synth_close (int dev);void midi_synth_hw_control (int dev,unsigned char *event);int midi_synth_load_patch (int dev,int format,const char __user * addr, -int offs,int count,int pmgr_flag); +int count,int pmgr_flag);void midi_synth_panning (int dev,int channel,int pressure);void midi_synth_aftertouch (int dev,int channel,int pressure);void midi_synth_controller (int dev,int channel,int ctrl_num,int value);
sound/oss/opl3.c +15 -8
@@ -819,7 +819,7 @@ static void opl3_hw_control(int dev, unsigned char *event) }static int opl3_load_patch (int dev,int format,const char __user *addr, -int offs,int count,int pmgr_flag) +int count,int pmgr_flag) {struct sbi_instrument ins;
@@ -829,11 +829,7 @@ static int opl3_load_patch(int dev, int format, const char __user *addr,return -EINVAL ; } -/* -* What the fuck is going on here? We leave junk in the beginning -* of ins and then check the field pretty close to that beginning? -*/ -if (copy_from_user (&((char *) &ins)[offs], addr + offs,sizeof (ins) - offs)) +if (copy_from_user (&ins, addr,sizeof (ins)))return -EFAULT ;if (ins.channel <0 || ins.channel >=SBFM_MAXINSTR )
@@ -848,6 +844,10 @@ static int opl3_load_patch(int dev, int format, const char __user *addr,static void opl3_panning (int dev,int voice,int value) { + +if (voice <0 || voice >= devc->nr_voice) +return ; + devc->voc[voice].panning = value; }
@@ -1065,8 +1065,15 @@ static int opl3_alloc_voice(int dev, int chn, int note, struct voice_alloc_infostatic void opl3_setup_voice (int dev,int voice,int chn) { -struct channel_info *info = - &synth_devs[dev]->chn_info[chn]; +struct channel_info *info; + +if (voice <0 || voice >= devc->nr_voice) +return ; + +if (chn <0 || chn >15 ) +return ; + + info = &synth_devs[dev]->chn_info[chn];opl3_set_instr (dev, voice, info->pgm_num);
sound/oss/sequencer.c +1 -1
@@ -241,7 +241,7 @@ int sequencer_write(int dev, struct file *file, const char __user *buf, int counreturn -ENXIO ; fmt = (*(short *) &event_rec[0 ]) &0xffff ; - err = synth_devs[dev]->load_patch (dev, fmt, buf, p +4 , c,0 ); + err = synth_devs[dev]->load_patch (dev, fmt, buf + p, c,0 );if (err <0 )return err;
sound/pci/ens1370.c +19 -4
@@ -229,6 +229,7 @@ MODULE_PARM_DESC(lineio, "Line In to Rear Out (0 = auto, 1 = force).");#define ES_REG_1371_CODEC 0x14/* W/R: Codec Read/Write register address */ #define ES_1371_CODEC_RDY (1<<31)/* codec ready */ #define ES_1371_CODEC_WIP (1<<30)/* codec register access in progress */ +#define EV_1938_CODEC_MAGIC (1<<26)#define ES_1371_CODEC_PIRD (1<<23)/* codec read/write select register */ #define ES_1371_CODEC_WRITE (a,d) ((((a)&0x7f)<<16)|(((d)&0xffff)<<0))#define ES_1371_CODEC_READS (a) ((((a)&0x7f)<<16)|ES_1371_CODEC_PIRD)
@@ -603,12 +604,18 @@ static void snd_es1370_codec_write(struct snd_ak4531 *ak4531,#ifdef CHIP1371 +static inline bool is_ev1938 (struct ensoniq *ensoniq) +{ +return ensoniq->pci->device ==0x8938 ; +} +static void snd_es1371_codec_write (struct snd_ac97 *ac97,unsigned short reg,unsigned short val) {struct ensoniq *ensoniq = ac97->private_data; -unsigned int t, x; +unsigned int t, x, flag; + flag =is_ev1938 (ensoniq) ?EV_1938_CODEC_MAGIC :0 ;mutex_lock (&ensoniq->src_mutex);for (t =0 ; t <POLL_COUNT ; t++) { if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
@@ -630,7 +637,8 @@ static void snd_es1371_codec_write(struct snd_ac97 *ac97, 0x00010000)break ; } - outl(ES_1371_CODEC_WRITE(reg, val), ES_REG(ensoniq, 1371_CODEC)); +outl (ES_1371_CODEC_WRITE (reg, val) | flag, + ES_REG(ensoniq, 1371_CODEC));/* restore SRC reg */ snd_es1371_wait_src_ready (ensoniq); outl(x, ES_REG(ensoniq, 1371_SMPRATE));
@@ -647,8 +655,9 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97, unsigned short reg) {struct ensoniq *ensoniq = ac97->private_data; -unsigned int t, x, fail =0 ; +unsigned int t, x, flag, fail =0 ; + flag =is_ev1938 (ensoniq) ?EV_1938_CODEC_MAGIC :0 ; __again:mutex_lock (&ensoniq->src_mutex);for (t =0 ; t <POLL_COUNT ; t++) {
@@ -671,7 +680,8 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97, 0x00010000)break ; } - outl(ES_1371_CODEC_READS(reg), ES_REG(ensoniq, 1371_CODEC)); +outl (ES_1371_CODEC_READS (reg) | flag, + ES_REG(ensoniq, 1371_CODEC));/* restore SRC reg */ snd_es1371_wait_src_ready (ensoniq); outl(x, ES_REG(ensoniq, 1371_SMPRATE));
@@ -683,6 +693,11 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,/* now wait for the stinkin' data (RDY) */ for (t =0 ; t <POLL_COUNT ; t++) { if ((x = inl(ES_REG(ensoniq, 1371_CODEC))) & ES_1371_CODEC_RDY) { +if (is_ev1938 (ensoniq)) { +for (t =0 ; t <100 ; t++) +inl (ES_REG (ensoniq,CONTROL )); + x = inl(ES_REG(ensoniq, 1371_CODEC)); + }mutex_unlock (&ensoniq->src_mutex);return ES_1371_CODEC_READ (x); }
sound/pci/hda/patch_realtek.c +1 -1
@@ -1153,7 +1153,7 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type)case 0x10ec0883 :case 0x10ec0885 :case 0x10ec0887 : -case 0x10ec0889 : +/*case 0x10ec0889:*/ /* this causes an SPDIF problem */ alc889_coef_init (codec);break ;case 0x10ec0888 :
Quoted 4 lines · Greg KH
I'm announcing the release of the 2.6.32.37 kernel.
Vasiliy Kulikov (13):
net: ax25: fix information leak to userland
2.6.32.37 contains fe10ae53384e48c51996941b7720ee16995cbcb7, but seems to miss 5b919f833d9d60588d026ad82d17f17e8872c7a9 which fixes this fix.
(Found by checking why Ubuntu had a different fix here than 2.6.32.37)
c'ya
sven-haegar
Signature · 2 lines
Three may keep a secret, if two of them are dead. - Ben F.
Quoted 11 lines · Sven-Haegar Koch
Quoted 4 lines · Greg KH
I'm announcing the release of the 2.6.32.37 kernel.
Vasiliy Kulikov (13):
net: ax25: fix information leak to userland2.6.32.37 contains
fe10ae53384e48c51996941b7720ee16995cbcb7, but seems to miss5b919f833d9d60588d026ad82d17f17e8872c7a9which fixes this fix.(Found by checking why Ubuntu had a different fix here than 2.6.32.37)
Thanks, I've queued this up as well now.
greg k-h