Linux 2.6.20.5
Subsystems (12)
We (the -stable team) are announcing the release of the 2.6.20.5 kernel. It contains a number of important bugfixes including a fix for possible remote DoS.
f8c08c340b83: APPLETALK: Fix a remotely triggerable crash [CVE-2007-1357]
The diffstat and short summary of the fixes are below.
I'll also be replying to this message with a copy of the patch between 2.6.20.4 and 2.6.20.5.
The updated 2.6.20.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.20.y.git
and can be browsed at the normal kernel.org git web browser:
www.kernel.org/git/
thanks,
-chris
--------
Makefile | 2 arch/um/include/sysdep-x86_64/ptrace.h | 4 - arch/um/os-Linux/elf_aux.c | 3 arch/um/os-Linux/skas/mem.c | 10 ++- arch/um/os-Linux/skas/process.c | 6 - arch/um/os-Linux/sys-i386/registers.c | 5 - arch/um/os-Linux/sys-x86_64/registers.c | 4 - arch/um/sys-i386/delay.c | 11 --- arch/um/sys-x86_64/delay.c | 11 --- crypto/scatterwalk.c | 4 - drivers/ata/libata-core.c | 11 +++ drivers/ata/libata-scsi.c | 1 drivers/ata/sata_mv.c | 31 +++++++--- drivers/ata/sata_nv.c | 10 +++ drivers/char/generic_serial.c | 7 -- drivers/ide/ide-cd.c | 15 ++-- drivers/ide/ide-io.c | 11 +++ drivers/ide/ide-iops.c | 9 ++ drivers/ide/ide.c | 1 drivers/ide/pci/jmicron.c | 29 +++++++-- drivers/ide/pci/piix.c | 67 +++++++++++++++------- drivers/ieee1394/dv1394.c | 12 +-- drivers/media/dvb/dvb-core/dmxdev.c | 12 --- drivers/media/dvb/dvb-core/dvb_demux.c | 21 ++---- drivers/media/dvb/dvb-core/dvbdev.c | 9 -- drivers/media/dvb/frontends/isl6421.c | 1 drivers/media/dvb/frontends/nxt200x.c | 4 - drivers/media/radio/Kconfig | 2 drivers/media/video/msp3400-driver.c | 4 - drivers/media/video/saa7115.c | 2 drivers/message/i2o/i2o_block.c | 12 --- drivers/net/ppp_generic.c | 3 drivers/video/ffb.c | 84 +++++++++++++++++++-------- fs/cifs/inode.c | 21 +++++- fs/cifs/readdir.c | 4 + include/asm-sparc/mostek.h | 2 include/asm-sparc64/mostek.h | 2 include/asm-um/common.lds.S | 1 include/asm-um/delay.h | 17 ++++- include/linux/eventpoll.h | 7 ++ include/linux/ide.h | 2 include/media/saa7146_vv.h | 3 include/net/fib_rules.h | 1 include/net/ip6_fib.h | 1 net/appletalk/ddp.c | 7 +- net/core/dev.c | 4 - net/core/fib_rules.c | 30 +++++++++ net/dccp/proto.c | 4 - net/decnet/dn_rules.c | 21 +++--- net/ipv4/fib_rules.c | 14 +--- net/ipv6/fib6_rules.c | 14 +--- net/ipv6/ip6_fib.c | 8 ++ net/ipv6/route.c | 97 +++++++++++++++++++------------- net/sched/cls_basic.c | 16 ++--- net/socket.c | 7 +- 55 files changed, 446 insertions(+), 255 deletions(-)
Summary of changes from v2.6.20.4 to v2.6.20.5
==============================================
Al Viro (1):
FRA_{DST,SRC} are le16 for decnet
Alan Tyson (1):
CIFS: reset mode when client notices that ATTR_READONLY is no longer set
Albert Lee (2):
ide: clear bmdma status in ide_intr() for ICHx controllers (revised #4)
ide: remove clearing bmdma status from cdrom_decode_status() (rev #4)
Alexey Dobriyan (1):
NET: Fix sock_attach_fd() failure in sys_accept()
Arnaldo Carvalho de Melo (1):
DCCP: Fix exploitable hole in DCCP socket options
Bartlomiej Zolnierkiewicz (1):
ide: revert "ide: fix drive side 80c cable check, take 2" for now
Daniel Drake (1):
generic_serial: fix decoding of baud rate
David Miller (2):
IPV6: Fix ipv6 round-robin locking.
VIDEO: Fix FFB DAC revision probing
G. Liakhovetski (1):
PPP: Fix PPP skb leak
Greg Kroah-Hartman (1):
Linux 2.6.20.5
Hans Verkuil (1):
V4L: msp_attach must return 0 if no msp3400 was found.
J. Bruce Fields (1):
CRYPTO: api: scatterwalk_copychunks() fails to advance through scatterlist
Jean Delvare (1):
APPLETALK: Fix a remotely triggerable crash
Jeff Dike (4):
UML - fix epoll
UML - host VDSO fix
UML - Fix static linking
UML - use correct register file size everywhere
Jeff Garzik (2):
libata: sata_mv: don't touch reserved bits in EDMA config register
libata: sata_mv: Fix 50xx irq mask
Mark Lord (1):
libata bugfix: HDIO_DRIVE_TASK
Mauro Carvalho Chehab (1):
V4L: Fix SECAM handling on saa7115
Michael Krufky (1):
DVB: fix nxt200x rf input switching
Mikael Pettersson (1):
SPARC: Fix sparc builds with gcc-4.2.x
Oliver Endriss (1):
V4L: saa7146: Fix allocation of clipping memory
Paolo 'Blaisorblade' Giarrusso (1):
uml: fix unreasonably long udelay
Patrick McHardy (2):
NET: Fix packet classidier NULL pointer OOPS
NET_SCHED: Fix ingress qdisc locking.
Robert Hancock (1):
sata_nv: delay on switching between NCQ and non-NCQ commands
Simon Arlott (1):
dvb-core: fix several locking related problems
Stefan Richter (1):
ieee1394: dv1394: fix CardBus card ejection
Steve French (1):
CIFS: Allow reset of file to ATTR_NORMAL when archive bit not set
Tejun Heo (2):
jmicron: make ide jmicron driver play nice with libata ones
libata: clear TF before IDENTIFYing
Thomas Graf (1):
NET: Fix FIB rules compatability
Thomas Viehweger (1):
DVB: isl6421: don't reference freed memory
Trent Piepho (1):
V4L: radio: Fix error in Kbuild file
Vasily Averin (1):
i2o: block IO errors on i2o disk
Makefile +1 -1
@@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 20 -EXTRAVERSION = .4 +EXTRAVERSION = .5 NAME = Homicidal Dwarf Hamster # *DOCUMENTATION*
arch/um/include/sysdep-x86_64/ptrace.h +0 -4
@@ -104,10 +104,6 @@ union uml_pt_regs {#endif #ifdef UML_CONFIG_MODE_SKAS struct skas_regs { - /* x86_64 ptrace uses sizeof(user_regs_struct) as its register - * file size, while i386 uses FRAME_SIZE. Therefore, we need - * to use UM_FRAME_SIZE here instead of HOST_FRAME_SIZE. - */ unsigned long regs[MAX_REG_NR]; unsigned long fp[HOST_FP_SIZE]; struct faultinfo faultinfo;
arch/um/os-Linux/elf_aux.c +3 -0
@@ -40,6 +40,9 @@ __init void scan_elf_aux( char **envp)switch ( auxv->a_type ) {case AT_SYSINFO : __kernel_vsyscall = auxv->a_un.a_val; +/* See if the page is under TASK_SIZE */ +if (__kernel_vsyscall < (unsigned long ) envp) + __kernel_vsyscall =0 ;break ;case AT_SYSINFO_EHDR : vsyscall_ehdr = auxv->a_un.a_val;
arch/um/os-Linux/skas/mem.c +7 -3
@@ -48,7 +48,7 @@ int multi_op_count = 0;static inline long do_syscall_stub (struct mm_id * mm_idp,void **addr) {unsigned long regs[MAX_REG_NR ]; -int n; +int n, i;long ret, offset;unsigned long * data;unsigned long * syscall;
@@ -66,9 +66,13 @@ static inline long do_syscall_stub(struct mm_id * mm_idp, void **addr) (unsigned long) &__syscall_stub_start); n =ptrace_setregs (pid, regs); -if (n <0 ) +if (n <0 ){ +printk ("Registers - \n" ); +for (i =0 ; i <MAX_REG_NR ; i++) +printk ("\t%d\t0x%lx\n" , i, regs[i]);panic ("do_syscall_stub : PTRACE_SETREGS failed, errno = %d\n" , - n); + -n); + }wait_stub_done (pid,0 ,"do_syscall_stub" );
arch/um/os-Linux/skas/process.c +3 -3
@@ -67,7 +67,7 @@ void wait_stub_done(int pid, int sig, char * fname)if ((n <0 ) || !WIFSTOPPED (status) || (WSTOPSIG (status) !=SIGUSR1 &&WSTOPSIG (status) !=SIGTRAP )){ -unsigned long regs[HOST_FRAME_SIZE ]; +unsigned long regs[MAX_REG_NR ];if (ptrace (PTRACE_GETREGS , pid,0 , regs) <0 ) printk("Failed to get registers from stub, "
@@ -76,7 +76,7 @@ void wait_stub_done(int pid, int sig, char * fname)int i;printk ("Stub registers -\n" ); -for (i =0 ; i <HOST_FRAME_SIZE ; i++) +for (i =0 ; i <ARRAY_SIZE (regs); i++)printk ("\t%d - %lx\n" , i, regs[i]); } panic("%s : failed to wait for SIGUSR1/SIGTRAP, "
@@ -328,7 +328,7 @@ void userspace(union uml_pt_regs *regs)int copy_context_skas0 (unsigned long new_stack,int pid) {int err; -unsigned long regs[HOST_FRAME_SIZE ]; +unsigned long regs[MAX_REG_NR ];unsigned long fp_regs[HOST_FP_SIZE ];unsigned long current_stack =current_stub_stack ();struct stub_data *data = (struct stub_data *) current_stack;
arch/um/os-Linux/sys-i386/registers.c +3 -2
@@ -15,7 +15,7 @@/* These are set once at boot time and not changed thereafter */ -static unsigned long exec_regs[HOST_FRAME_SIZE ]; +static unsigned long exec_regs[MAX_REG_NR ];static unsigned long exec_fp_regs[HOST_FP_SIZE ];static unsigned long exec_fpx_regs[HOST_XFP_SIZE ];static int have_fpx_regs =1 ;
@@ -101,6 +101,7 @@ void init_registers(int pid) {int err; +memset (exec_regs,0 ,sizeof (exec_regs)); err =ptrace (PTRACE_GETREGS , pid,0 , exec_regs);if (err) panic("check_ptrace : PTRACE_GETREGS failed, errno = %d",
@@ -124,7 +125,7 @@ void init_registers(int pid)void get_safe_registers (unsigned long *regs,unsigned long *fp_regs) { -memcpy (regs, exec_regs,HOST_FRAME_SIZE *sizeof (unsigned long )); +memcpy (regs, exec_regs,sizeof (exec_regs));if (fp_regs !=NULL )memcpy (fp_regs, exec_fp_regs,HOST_FP_SIZE *sizeof (unsigned long ));
arch/um/os-Linux/sys-x86_64/registers.c +2 -2
@@ -14,7 +14,7 @@/* These are set once at boot time and not changed thereafter */ -static unsigned long exec_regs[HOST_FRAME_SIZE ]; +static unsigned long exec_regs[MAX_REG_NR ];static unsigned long exec_fp_regs[HOST_FP_SIZE ];void init_thread_registers (union uml_pt_regs *to)
@@ -72,7 +72,7 @@ void init_registers(int pid)void get_safe_registers (unsigned long *regs,unsigned long *fp_regs) { -memcpy (regs, exec_regs,HOST_FRAME_SIZE *sizeof (unsigned long )); +memcpy (regs, exec_regs,sizeof (exec_regs));if (fp_regs !=NULL )memcpy (fp_regs, exec_fp_regs,HOST_FP_SIZE *sizeof (unsigned long ));
arch/um/sys-i386/delay.c +0 -11
@@ -27,14 +27,3 @@ void __udelay(unsigned long usecs) }EXPORT_SYMBOL (__udelay); - -void __const_udelay (unsigned long usecs) -{ -int i, n; - - n = (loops_per_jiffy *HZ * usecs) /MILLION ; -for (i=0 ;i<n;i++) -cpu_relax (); -} - -EXPORT_SYMBOL (__const_udelay);
arch/um/sys-x86_64/delay.c +0 -11
@@ -28,14 +28,3 @@ void __udelay(unsigned long usecs) }EXPORT_SYMBOL (__udelay); - -void __const_udelay (unsigned long usecs) -{ -unsigned long i, n; - - n = (loops_per_jiffy *HZ * usecs) /MILLION ; -for (i=0 ;i<n;i++) -cpu_relax (); -} - -EXPORT_SYMBOL (__const_udelay);
crypto/scatterwalk.c +2 -2
@@ -91,6 +91,8 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,memcpy_dir (buf, vaddr, len_this_page, out);scatterwalk_unmap (vaddr, out); +scatterwalk_advance (walk, nbytes); +if (nbytes == len_this_page)break ;
@@ -99,7 +101,5 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,scatterwalk_pagedone (walk, out,1 ); } - -scatterwalk_advance (walk, nbytes); }EXPORT_SYMBOL_GPL (scatterwalk_copychunks);
drivers/ata/libata-core.c +10 -1
@@ -1478,7 +1478,16 @@ int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class, } tf.protocol =ATA_PROT_PIO ; - tf.flags |=ATA_TFLAG_POLLING ;/* for polling presence detection */ + +/* Some devices choke if TF registers contain garbage. Make +* sure those are properly initialized. +*/ + tf.flags |=ATA_TFLAG_ISADDR |ATA_TFLAG_DEVICE ; + +/* Device presence detection is unreliable on some +* controllers. Always poll IDENTIFY if available. +*/ + tf.flags |=ATA_TFLAG_POLLING ; err_mask =ata_exec_internal (dev, &tf,NULL ,DMA_FROM_DEVICE , id,sizeof (id[0 ]) *ATA_ID_WORDS );
drivers/ata/libata-scsi.c +1 -0
@@ -295,6 +295,7 @@ int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg) scsi_cmd[8 ] = args[3 ]; scsi_cmd[10 ] = args[4 ]; scsi_cmd[12 ] = args[5 ]; + scsi_cmd[13 ] = args[6 ] &0x0f ; scsi_cmd[14 ] = args[0 ];/* Good values for timeout and retries? Values below
drivers/ata/sata_mv.c +22 -9
@@ -139,14 +139,19 @@ enum {PCI_ERR = (1 <<18 ),TRAN_LO_DONE = (1 <<19 ),/* 6xxx: IRQ coalescing */ TRAN_HI_DONE = (1 <<20 ),/* 6xxx: IRQ coalescing */ +PORTS_0_3_COAL_DONE = (1 <<8 ), +PORTS_4_7_COAL_DONE = (1 <<17 ),PORTS_0_7_COAL_DONE = (1 <<21 ),/* 6xxx: IRQ coalescing */ GPIO_INT = (1 <<22 ),SELF_INT = (1 <<23 ),TWSI_INT = (1 <<24 ),HC_MAIN_RSVD = (0x7f <<25 ),/* bits 31-25 */ +HC_MAIN_RSVD_5 = (0x1fff <<19 ),/* bits 31-19 */ HC_MAIN_MASKED_IRQS = (TRAN_LO_DONE |TRAN_HI_DONE |PORTS_0_7_COAL_DONE |GPIO_INT |TWSI_INT |HC_MAIN_RSVD ), +HC_MAIN_MASKED_IRQS_5 = (PORTS_0_3_COAL_DONE |PORTS_4_7_COAL_DONE | +HC_MAIN_RSVD_5 ),/* SATAHC registers */ HC_CFG_OFS = 0,
@@ -843,23 +848,27 @@ static void mv_edma_cfg(struct mv_host_priv *hpriv, void __iomem *port_mmio)u32 cfg =readl (port_mmio +EDMA_CFG_OFS );/* set up non-NCQ EDMA configuration */ - cfg &= ~0x1f ;/* clear queue depth */ - cfg &= ~EDMA_CFG_NCQ ;/* clear NCQ mode */ cfg &= ~(1 <<9 );/* disable equeue */ -if (IS_GEN_I (hpriv)) +if (IS_GEN_I (hpriv)) { + cfg &= ~0x1f ;/* clear queue depth */ cfg |= (1 <<8 );/* enab config burst size mask */ + } -else if (IS_GEN_II (hpriv)) +else if (IS_GEN_II (hpriv)) { + cfg &= ~0x1f ;/* clear queue depth */ cfg |=EDMA_CFG_RD_BRST_EXT |EDMA_CFG_WR_BUFF_LEN ; + cfg &= ~(EDMA_CFG_NCQ |EDMA_CFG_NCQ_GO_ON_ERR );/* clear NCQ */ + }else if (IS_GEN_IIE (hpriv)) { - cfg |= (1 <<23 );/* dis RX PM port mask */ - cfg &= ~(1 <<16 );/* dis FIS-based switching (for now) */ + cfg |= (1 <<23 );/* do not mask PM field in rx'd FIS */ + cfg |= (1 <<22 );/* enab 4-entry host queue cache */ cfg &= ~(1 <<19 );/* dis 128-entry queue (for now?) */ cfg |= (1 <<18 );/* enab early completion */ - cfg |= (1 <<17 );/* enab host q cache */ - cfg |= (1 <<22 );/* enab cutthrough */ + cfg |= (1 <<17 );/* enab cut-through (dis stor&forwrd) */ + cfg &= ~(1 <<16 );/* dis FIS-based switching (for now) */ + cfg &= ~(EDMA_CFG_NCQ |EDMA_CFG_NCQ_GO_ON_ERR );/* clear NCQ */ }writelfl (cfg, port_mmio +EDMA_CFG_OFS );
@@ -2283,7 +2292,11 @@ static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent,/* and unmask interrupt generation for host regs */ writelfl (PCI_UNMASK_ALL_IRQS , mmio +PCI_IRQ_MASK_OFS ); -writelfl (~HC_MAIN_MASKED_IRQS , mmio +HC_MAIN_IRQ_MASK_OFS ); + +if (IS_50XX (hpriv)) +writelfl (~HC_MAIN_MASKED_IRQS_5 , mmio +HC_MAIN_IRQ_MASK_OFS ); +else +writelfl (~HC_MAIN_MASKED_IRQS , mmio +HC_MAIN_IRQ_MASK_OFS ); VPRINTK("HC MAIN IRQ cause/mask=0x%08x/0x%08x " "PCI int cause/mask=0x%08x/0x%08x\n",
drivers/ata/sata_nv.c +10 -0
@@ -214,6 +214,7 @@ struct nv_adma_port_priv {struct nv_adma_prd *aprd;dma_addr_t aprd_dma;u8 flags; +int last_issue_ncq; };#define NV_ADMA_CHECK_INTR (GCTL ,PORT ) ((GCTL) & ( 1 << (19 + (12 * (PORT)))))
@@ -1151,6 +1152,7 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc) {struct nv_adma_port_priv *pp = qc->ap->private_data;void __iomem *mmio =nv_adma_ctl_block (qc->ap); +int curr_ncq = (qc->tf.protocol ==ATA_PROT_NCQ );VPRINTK ("ENTER\n" );
@@ -1166,6 +1168,14 @@ static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc)/* write append register, command tag in lower 8 bits and (number of cpbs to append -1) in top 8 bits */ wmb (); + +if (curr_ncq != pp->last_issue_ncq) { +/* Seems to need some delay before switching between NCQ and non-NCQ +commands, else we get command timeouts and such. */ +udelay (20 ); + pp->last_issue_ncq = curr_ncq; + } +writew (qc->tag, mmio +NV_ADMA_APPEND );DPRINTK ("Issued tag %u\n" ,qc->tag);
drivers/char/generic_serial.c +0 -7
@@ -711,12 +711,6 @@ void gs_close(struct tty_struct * tty, struct file * filp) } -static unsigned int gs_baudrates[] = { -0 ,50 ,75 ,110 ,134 ,150 ,200 ,300 ,600 ,1200 ,1800 ,2400 ,4800 , -9600 ,19200 ,38400 ,57600 ,115200 ,230400 ,460800 ,921600 -}; - -void gs_set_termios (struct tty_struct * tty,struct ktermios * old_termios) {
@@ -772,7 +766,6 @@ void gs_set_termios (struct tty_struct * tty, baudrate =tty_get_baud_rate (tty); - baudrate = gs_baudrates[baudrate];if ((tiosp->c_cflag &CBAUD ) ==B38400 ) {if ( (port->flags &ASYNC_SPD_MASK ) ==ASYNC_SPD_HI ) baudrate =57600 ;
drivers/ide/ide-cd.c +8 -7
@@ -687,15 +687,8 @@ static void ide_dump_status_no_sense(ide_drive_t *drive, const char *msg, u8 stastatic int cdrom_decode_status (ide_drive_t *drive,int good_stat,int *stat_ret) {struct request *rq =HWGROUP (drive)->rq; -ide_hwif_t *hwif =HWIF (drive);int stat, err, sense_key; -/* We may have bogus DMA interrupts in PIO state here */ -if (HWIF (drive)->dma_status && hwif->atapi_irq_bogon) { - stat = hwif->INB (hwif->dma_status); -/* Should we force the bit as well ? */ - hwif->OUTB (stat, hwif->dma_status); - }/* Check for errors. */ stat =HWIF (drive)->INB (IDE_STATUS_REG );if (stat_ret)
@@ -930,6 +923,10 @@ static ide_startstop_t cdrom_start_packet_command(ide_drive_t *drive,HWIF (drive)->OUTB (drive->ctl,IDE_CONTROL_REG );if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) { +/* waiting for CDB interrupt, not DMA yet. */ +if (info->dma) + drive->waiting_for_dma =0 ; +/* packet command */ ide_execute_command (drive,WIN_PACKETCMD , handler,ATAPI_WAIT_PC , cdrom_timer_expiry);return ide_started;
@@ -972,6 +969,10 @@ static ide_startstop_t cdrom_transfer_packet_command (ide_drive_t *drive,/* Check for errors. */ if (cdrom_decode_status (drive,DRQ_STAT ,NULL ))return ide_stopped; + +/* Ok, next interrupt will be DMA interrupt. */ +if (info->dma) + drive->waiting_for_dma =1 ; }else {/* Otherwise, we must wait for DRQ to get set. */ if (ide_wait_stat(&startstop, drive, DRQ_STAT,
drivers/ide/ide-io.c +11 -0
@@ -1646,6 +1646,17 @@ irqreturn_t ide_intr (int irq, void *dev_id)del_timer (&hwgroup->timer);spin_unlock (&ide_lock); +/* Some controllers might set DMA INTR no matter DMA or PIO; +* bmdma status might need to be cleared even for +* PIO interrupts to prevent spurious/lost irq. +*/ +if (hwif->ide_dma_clear_irq && !(drive->waiting_for_dma)) +/* ide_dma_end() needs bmdma status for error checking. +* So, skip clearing bmdma status here and leave it +* to ide_dma_end() if this is dma interrupt. +*/ + hwif->ide_dma_clear_irq (drive); +if (drive->unmask)local_irq_enable_in_hardirq ();/* service this interrupt, may set handler for next interrupt */
drivers/ide/ide-iops.c +9 -0
@@ -598,6 +598,9 @@ u8 eighty_ninty_three (ide_drive_t *drive)if (HWIF (drive)->udma_four ==0 )return 0 ; +printk (KERN_INFO "%s: hw_config=%04x\n" , + drive->name, drive->id->hw_config); +/* Check for SATA but only if we are ATA5 or higher */ if (drive->id->hw_config ==0 && (drive->id->major_rev_num &0x7FE0 ))return 1 ;
@@ -607,8 +610,14 @@ u8 eighty_ninty_three (ide_drive_t *drive)if (!(drive->id->hw_config &0x4000 ))return 0 ;#endif /* CONFIG_IDEDMA_IVB */ +/* +* FIXME: enable this after fixing master/slave IDENTIFY order, +* also ignore the result if the slave device is pre-ATA3 one +*/ +#if 0 if (!(drive->id->hw_config &0x2000 ))return 0 ; +#endif return 1 ; }
drivers/ide/ide.c +1 -0
@@ -503,6 +503,7 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif) hwif->ide_dma_on = tmp_hwif->ide_dma_on; hwif->ide_dma_off_quietly = tmp_hwif->ide_dma_off_quietly; hwif->ide_dma_test_irq = tmp_hwif->ide_dma_test_irq; + hwif->ide_dma_clear_irq = tmp_hwif->ide_dma_clear_irq; hwif->ide_dma_host_on = tmp_hwif->ide_dma_host_on; hwif->ide_dma_host_off = tmp_hwif->ide_dma_host_off; hwif->ide_dma_lostirq = tmp_hwif->ide_dma_lostirq;
drivers/ide/pci/jmicron.c +24 -5
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devireturn 0 ; } +/* If libata is configured, jmicron PCI quirk will configure it such +* that the SATA ports are in AHCI function while the PATA ports are +* in a separate IDE function. In such cases, match device class and +* attach only to IDE. If libata isn't configured, keep the old +* behavior for backward compatibility. +*/ +#if defined(CONFIG_ATA ) || defined(CONFIG_ATA_MODULE ) +#define JMB_CLASS PCI_CLASS_STORAGE_IDE << 8 +#define JMB_CLASS_MASK 0xffff00 +#else +#define JMB_CLASS 0 +#define JMB_CLASS_MASK 0 +#endif +static struct pci_device_id jmicron_pci_tbl[] = { - {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB361 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,0 }, - {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB363 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,1 }, - {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB365 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,2 }, - {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB366 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,3 }, - {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB368 ,PCI_ANY_ID ,PCI_ANY_ID ,0 ,0 ,4 }, + {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB361 , +PCI_ANY_ID ,PCI_ANY_ID ,JMB_CLASS ,JMB_CLASS_MASK ,0 }, + {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB363 , +PCI_ANY_ID ,PCI_ANY_ID ,JMB_CLASS ,JMB_CLASS_MASK ,1 }, + {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB365 , +PCI_ANY_ID ,PCI_ANY_ID ,JMB_CLASS ,JMB_CLASS_MASK ,2 }, + {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB366 , +PCI_ANY_ID ,PCI_ANY_ID ,JMB_CLASS ,JMB_CLASS_MASK ,3 }, + {PCI_VENDOR_ID_JMICRON ,PCI_DEVICE_ID_JMICRON_JMB368 , +PCI_ANY_ID ,PCI_ANY_ID ,JMB_CLASS ,JMB_CLASS_MASK ,4 }, {0 , }, };
drivers/ide/pci/piix.c +48 -19
100 lines not on this page · raw message
drivers/ieee1394/dv1394.c +5 -7
@@ -2267,11 +2267,7 @@ static void dv1394_remove_host (struct hpsb_host *host) {struct video_card *video;unsigned long flags; -int id = host->id; - -/* We only work with the OHCI-1394 driver */ -if (strcmp (host->driver->name,OHCI1394_DRIVER_NAME )) -return ; +int id = host->id, found_ohci_card =0 ;/* find the corresponding video_cards */ do {
@@ -2284,6 +2280,7 @@ static void dv1394_remove_host (struct hpsb_host *host)if ((tmp_vid->id >>2 ) == id) {list_del (&tmp_vid->list); video = tmp_vid; + found_ohci_card =1 ;break ; } }
@@ -2293,8 +2290,9 @@ static void dv1394_remove_host (struct hpsb_host *host)dv1394_un_init (video); }while (video !=NULL ); -class_device_destroy (hpsb_protocol_class, -MKDEV (IEEE1394_MAJOR ,IEEE1394_MINOR_BLOCK_DV1394 *16 + (id<<2 ))); +if (found_ohci_card) +class_device_destroy (hpsb_protocol_class,MKDEV (IEEE1394_MAJOR , +IEEE1394_MINOR_BLOCK_DV1394 *16 + (id <<2 ))); }static void dv1394_add_host (struct hpsb_host *host)
drivers/media/dvb/dvb-core/dmxdev.c +3 -9
@@ -181,8 +181,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)struct dvb_device *dvbdev = file->private_data;struct dmxdev *dmxdev = dvbdev->priv; -if (mutex_lock_interruptible (&dmxdev->mutex)) -return -ERESTARTSYS ; +mutex_lock (&dmxdev->mutex);if ((file->f_flags &O_ACCMODE ) ==O_WRONLY ) { dmxdev->demux->disconnect_frontend (dmxdev->demux);
@@ -674,13 +673,8 @@ static int dvb_demux_open(struct inode *inode, struct file *file)static int dvb_dmxdev_filter_free (struct dmxdev *dmxdev,struct dmxdev_filter *dmxdevfilter) { -if (mutex_lock_interruptible (&dmxdev->mutex)) -return -ERESTARTSYS ; - -if (mutex_lock_interruptible (&dmxdevfilter->mutex)) { -mutex_unlock (&dmxdev->mutex); -return -ERESTARTSYS ; - } +mutex_lock (&dmxdev->mutex); +mutex_lock (&dmxdevfilter->mutex);dvb_dmxdev_filter_stop (dmxdevfilter);dvb_dmxdev_filter_reset (dmxdevfilter);
drivers/media/dvb/dvb-core/dvb_demux.c +7 -14
@@ -673,8 +673,7 @@ static int dmx_ts_feed_stop_filtering(struct dmx_ts_feed *ts_feed)struct dvb_demux *demux = feed->demux;int ret; -if (mutex_lock_interruptible (&demux->mutex)) -return -ERESTARTSYS ; +mutex_lock (&demux->mutex);if (feed->state <DMX_STATE_GO ) {mutex_unlock (&demux->mutex);
@@ -748,8 +747,7 @@ static int dvbdmx_release_ts_feed(struct dmx_demux *dmx,struct dvb_demux *demux = (struct dvb_demux *)dmx;struct dvb_demux_feed *feed = (struct dvb_demux_feed *)ts_feed; -if (mutex_lock_interruptible (&demux->mutex)) -return -ERESTARTSYS ; +mutex_lock (&demux->mutex);if (feed->state ==DMX_STATE_FREE ) {mutex_unlock (&demux->mutex);
@@ -916,8 +914,7 @@ static int dmx_section_feed_stop_filtering(struct dmx_section_feed *feed)struct dvb_demux *dvbdmx = dvbdmxfeed->demux;int ret; -if (mutex_lock_interruptible (&dvbdmx->mutex)) -return -ERESTARTSYS ; +mutex_lock (&dvbdmx->mutex);if (!dvbdmx->stop_feed) {mutex_unlock (&dvbdmx->mutex);
@@ -942,8 +939,7 @@ static int dmx_section_feed_release_filter(struct dmx_section_feed *feed,struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;struct dvb_demux *dvbdmx = dvbdmxfeed->demux; -if (mutex_lock_interruptible (&dvbdmx->mutex)) -return -ERESTARTSYS ; +mutex_lock (&dvbdmx->mutex);if (dvbdmxfilter->feed != dvbdmxfeed) {mutex_unlock (&dvbdmx->mutex);
@@ -1016,8 +1012,7 @@ static int dvbdmx_release_section_feed(struct dmx_demux *demux,struct dvb_demux_feed *dvbdmxfeed = (struct dvb_demux_feed *)feed;struct dvb_demux *dvbdmx = (struct dvb_demux *)demux; -if (mutex_lock_interruptible (&dvbdmx->mutex)) -return -ERESTARTSYS ; +mutex_lock (&dvbdmx->mutex);if (dvbdmxfeed->state ==DMX_STATE_FREE ) {mutex_unlock (&dvbdmx->mutex);
@@ -1126,8 +1121,7 @@ static int dvbdmx_connect_frontend(struct dmx_demux *demux,if (demux->frontend)return -EINVAL ; -if (mutex_lock_interruptible (&dvbdemux->mutex)) -return -ERESTARTSYS ; +mutex_lock (&dvbdemux->mutex); demux->frontend = frontend;mutex_unlock (&dvbdemux->mutex);
@@ -1138,8 +1132,7 @@ static int dvbdmx_disconnect_frontend(struct dmx_demux *demux) {struct dvb_demux *dvbdemux = (struct dvb_demux *)demux; -if (mutex_lock_interruptible (&dvbdemux->mutex)) -return -ERESTARTSYS ; +mutex_lock (&dvbdemux->mutex); demux->frontend =NULL ;mutex_unlock (&dvbdemux->mutex);
drivers/media/dvb/dvb-core/dvbdev.c +3 -6
@@ -204,8 +204,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,int id; -if (mutex_lock_interruptible (&dvbdev_register_lock)) -return -ERESTARTSYS ; +mutex_lock (&dvbdev_register_lock);if ((id =dvbdev_get_free_id (adap, type)) <0 ) {mutex_unlock (&dvbdev_register_lock);
@@ -295,8 +294,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu {int num; -if (mutex_lock_interruptible (&dvbdev_register_lock)) -return -ERESTARTSYS ; +mutex_lock (&dvbdev_register_lock);if ((num =dvbdev_get_free_adapter_num ()) <0 ) {mutex_unlock (&dvbdev_register_lock);
@@ -324,8 +322,7 @@ EXPORT_SYMBOL(dvb_register_adapter);int dvb_unregister_adapter (struct dvb_adapter *adap) { -if (mutex_lock_interruptible (&dvbdev_register_lock)) -return -ERESTARTSYS ; +mutex_lock (&dvbdev_register_lock);list_del (&adap->list_head);mutex_unlock (&dvbdev_register_lock);return 0 ;
drivers/media/dvb/frontends/isl6421.c +1 -0
@@ -122,6 +122,7 @@ struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter/* detect if it is present or not */ if (isl6421_set_voltage (fe,SEC_VOLTAGE_OFF )) {kfree (isl6421); + fe->sec_priv =NULL ;return NULL ; }
drivers/media/dvb/frontends/nxt200x.c +2 -2
@@ -562,7 +562,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,/* set input */ if (state->config->set_pll_input) - state->config->set_pll_input (buf,1 ); + state->config->set_pll_input (buf+1 ,1 );break ;case VSB_8 :/* Set non-punctured clock for VSB */
@@ -571,7 +571,7 @@ static int nxt200x_setup_frontend_parameters (struct dvb_frontend* fe,/* set input */ if (state->config->set_pll_input) - state->config->set_pll_input (buf,0 ); + state->config->set_pll_input (buf+1 ,0 );break ;default :return -EINVAL ;
drivers/media/radio/Kconfig +1 -1
@@ -3,7 +3,7 @@ # menu "Radio Adapters" - depends on VIDEO_DEV!=n + depends on VIDEO_DEV config RADIO_CADET tristate "ADS Cadet AM/FM Tuner"
drivers/media/video/msp3400-driver.c +2 -2
@@ -825,7 +825,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)if (msp_reset (client) ==-1 ) {v4l_dbg (1 , msp_debug, client,"msp3400 not found\n" );kfree (client); -return -1 ; +return 0 ; } state =kmalloc (sizeof (*state),GFP_KERNEL );
@@ -859,7 +859,7 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)v4l_dbg (1 , msp_debug, client,"not an msp3400 (cannot read chip version)\n" );kfree (state);kfree (client); -return -1 ; +return 0 ; }msp_set_audio (client);
drivers/media/video/saa7115.c +1 -1
@@ -960,7 +960,7 @@ static void saa711x_set_v4lstd(struct i2c_client *client, v4l2_std_id std) reg |=0x10 ; }else if (std ==V4L2_STD_NTSC_M_JP ) { reg |=0x40 ; - }else if (std ==V4L2_STD_SECAM ) { + }else if (std &V4L2_STD_SECAM ) { reg |=0x50 ; }saa711x_write (client,R_0E_CHROMA_CNTL_1 , reg);
drivers/message/i2o/i2o_block.c +1 -11
@@ -390,13 +390,6 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req)return BLKPREP_KILL ; } -/* request is already processed by us, so return */ -if (blk_special_request (req)) { -osm_debug ("REQ_SPECIAL already set!\n" ); - req->cmd_flags |=REQ_DONTPREP ; -return BLKPREP_OK ; - } -/* connect the i2o_block_request to the request */ if (!req->special) { ireq =i2o_block_request_alloc ();
@@ -408,11 +401,8 @@ static int i2o_block_prep_req_fn(struct request_queue *q, struct request *req) ireq->i2o_blk_dev = i2o_blk_dev; req->special = ireq; ireq->req = req; - }else - ireq = req->special; - + }/* do not come back here */ - req->cmd_type =REQ_TYPE_SPECIAL ; req->cmd_flags |=REQ_DONTPREP ;return BLKPREP_OK ;
drivers/net/ppp_generic.c +3 -0
@@ -2544,6 +2544,9 @@ static void ppp_destroy_interface(struct ppp *ppp) ppp->active_filter =NULL ;#endif /* CONFIG_PPP_FILTER */ +if (ppp->xmit_pending) +kfree_skb (ppp->xmit_pending); +kfree (ppp); }
drivers/video/ffb.c +60 -24
156 lines not on this page · raw message
fs/cifs/inode.c +18 -3
@@ -488,6 +488,12 @@ int cifs_get_inode_info(struct inode **pinode,mode e.g. 555 */ if (cifsInfo->cifsAttrs &ATTR_READONLY ) inode->i_mode &= ~(S_IWUGO ); +else if ((inode->i_mode &S_IWUGO ) ==0 ) +/* the ATTR_READONLY flag may have been */ +/* changed on server -- set any w bits */ +/* allowed by mnt_file_mode */ + inode->i_mode |= (S_IWUGO & + cifs_sb->mnt_file_mode);/* BB add code here - validate if device or weird share or device type? */ }
@@ -1133,6 +1139,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)struct cifsFileInfo *open_file =NULL ;FILE_BASIC_INFO time_buf;int set_time = FALSE; +int set_dosattr = FALSE;__u64 mode =0xFFFFFFFFFFFFFFFFULL ;__u64 uid =0xFFFFFFFFFFFFFFFFULL ;__u64 gid =0xFFFFFFFFFFFFFFFFULL ;
@@ -1269,15 +1276,23 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)else if (attrs->ia_valid &ATTR_MODE ) { rc =0 ;if ((mode &S_IWUGO ) ==0 )/* not writeable */ { -if ((cifsInode->cifsAttrs &ATTR_READONLY ) ==0 ) +if ((cifsInode->cifsAttrs &ATTR_READONLY ) ==0 ) { + set_dosattr = TRUE; time_buf.Attributes =cpu_to_le32 (cifsInode->cifsAttrs |ATTR_READONLY ); + } }else if ((mode &S_IWUGO ) ==S_IWUGO ) { -if (cifsInode->cifsAttrs &ATTR_READONLY ) +if (cifsInode->cifsAttrs &ATTR_READONLY ) { + set_dosattr = TRUE; time_buf.Attributes =cpu_to_le32 (cifsInode->cifsAttrs & (~ATTR_READONLY )); +/* Windows ignores set to zero */ +if (time_buf.Attributes ==0 ) + time_buf.Attributes |= +cpu_to_le32 (ATTR_NORMAL ); + } }/* BB to be implemented - via Windows security descriptors or streams */
@@ -1315,7 +1330,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) }else time_buf.ChangeTime =0 ; -if (set_time || time_buf.Attributes) { +if (set_time || set_dosattr) { time_buf.CreationTime =0 ;/* do not change */ /* In the future we should experiment - try setting timestamps via Handle (SetFileInfo) instead of by path */
fs/cifs/readdir.c +4 -0
@@ -215,6 +215,10 @@ static void fill_in_inode(struct inode *tmp_inode, int new_buf_type, tmp_inode->i_mode |=S_IFREG ;if (attr &ATTR_READONLY ) tmp_inode->i_mode &= ~(S_IWUGO ); +else if ((tmp_inode->i_mode &S_IWUGO ) ==0 ) +/* the ATTR_READONLY flag may have been changed on */ +/* server -- set any w bits allowed by mnt_file_mode */ + tmp_inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode); }/* could add code here - to validate if device or weird share type? */ /* can not fill in nlink here as in qpathinfo version and Unx search */
include/asm-sparc/mostek.h +1 -1
@@ -87,7 +87,7 @@ extern void __iomem *mstk48t02_regs;#define MSTK_DOW_MASK 0x07#define MSTK_DOM_MASK 0x3f#define MSTK_MONTH_MASK 0x1f -#define MSTK_YEAR_MASK 0xff +#define MSTK_YEAR_MASK 0xffU/* Binary coded decimal conversion macros. */ #define MSTK_REGVAL_TO_DECIMAL (x) (((x) & 0x0F) + 0x0A * ((x) >> 0x04))
include/asm-sparc64/mostek.h +1 -1
@@ -89,7 +89,7 @@ extern void __iomem *mstk48t02_regs;#define MSTK_DOW_MASK 0x07#define MSTK_DOM_MASK 0x3f#define MSTK_MONTH_MASK 0x1f -#define MSTK_YEAR_MASK 0xff +#define MSTK_YEAR_MASK 0xffU/* Binary coded decimal conversion macros. */ #define MSTK_REGVAL_TO_DECIMAL (x) (((x) & 0x0F) + 0x0A * ((x) >> 0x04))
include/asm-um/common.lds.S +1 -0
@@ -15,6 +15,7 @@ PROVIDE (_unprotected_end = .); . = ALIGN(4096); + .note : { *(note.*) } __start___ex_table = .; __ex_table : { *(__ex_table) } __stop___ex_table = .;
include/asm-um/delay.h +14 -3
@@ -1,9 +1,20 @@#ifndef __UM_DELAY_H#define __UM_DELAY_H -#include "asm/arch/delay.h" -#include "asm/archparam.h" -#define MILLION 1000000 +/* Undefined on purpose */ +extern void __bad_udelay (void ); + +extern void __udelay (unsigned long usecs); +extern void __delay (unsigned long loops); + +#define udelay (n) ((__builtin_constant_p(n) && (n) > 20000) ? \ + __bad_udelay() : __udelay(n)) + +/* It appears that ndelay is not used at all for UML, and has never been +* implemented. */ +extern void __unimplemented_ndelay (void ); +#define ndelay (n) __unimplemented_ndelay() +#endif
include/linux/eventpoll.h +7 -0
@@ -31,12 +31,19 @@/* * On x86-64 make the 64bit structure have the same alignment as the * 32bit structure. This makes 32bit emulation easier. +* +* UML/x86_64 needs the same packing as x86_64 - UML + UML_X86 + +* 64_BIT adds up to UML/x86_64. */ #ifdef __x86_64__#define EPOLL_PACKED __attribute__((packed))#else +#if defined(CONFIG_UML ) && defined(CONFIG_UML_X86 ) && defined(CONFIG_64BIT ) +#define EPOLL_PACKED __attribute__((packed)) +#else #define EPOLL_PACKED #endif +#endif struct epoll_event {__u32 events;
include/linux/ide.h +1 -1
@@ -727,6 +727,7 @@ typedef struct hwif_s {int (*ide_dma_on)(ide_drive_t *drive);int (*ide_dma_off_quietly)(ide_drive_t *drive);int (*ide_dma_test_irq)(ide_drive_t *drive); +void (*ide_dma_clear_irq)(ide_drive_t *drive);int (*ide_dma_host_on)(ide_drive_t *drive);int (*ide_dma_host_off)(ide_drive_t *drive);int (*ide_dma_lostirq)(ide_drive_t *drive);
@@ -796,7 +797,6 @@ typedef struct hwif_s { unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ - unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */struct device gendev;struct completion gendev_rel_comp;/* To deal with device release() */
include/media/saa7146_vv.h +2 -1
@@ -239,7 +239,8 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits);#define SAA7146_HPS_SYNC_PORT_B 0x01/* some memory sizes */ -#define SAA7146_CLIPPING_MEM (14*PAGE_SIZE) +/* max. 16 clipping rectangles */ +#define SAA7146_CLIPPING_MEM (16 * 4 * sizeof(u32))/* some defines for the various clipping-modes */ #define SAA7146_CLIPPING_RECT 0x4
include/net/fib_rules.h +1 -0
@@ -34,6 +34,7 @@ struct fib_rules_opsint family;struct list_head list;int rule_size; +int addr_size; int (*action)(struct fib_rule *, struct flowi *, int,
include/net/ip6_fib.h +1 -0
@@ -58,6 +58,7 @@ struct fib6_node__u16 fn_bit;/* bit key */ __u16 fn_flags;__u32 fn_sernum; +struct rt6_info *rr_ptr; };#ifndef CONFIG_IPV6_SUBTREES
net/appletalk/ddp.c +5 -2
@@ -1417,10 +1417,13 @@ static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,/* * Size check to see if ddp->deh_len was crap * (Otherwise we'll detonate most spectacularly -* in the middle of recvmsg()). +* in the middle of atalk_checksum() or recvmsg()). */ -if (skb->len <sizeof (*ddp)) +if (skb->len <sizeof (*ddp) || skb->len < (len_hops &1023 )) { +pr_debug ("AppleTalk: dropping corrupted frame (deh_len=%u, " +"skb->len=%u)\n" , len_hops &1023 , skb->len); goto freeit; + }/* * Any checksums. Note we don't do htons() on this == is assumed to be
net/core/dev.c +2 -2
@@ -1750,10 +1750,10 @@ static int ing_filter(struct sk_buff *skb) skb->tc_verd =SET_TC_AT (skb->tc_verd,AT_INGRESS ); -spin_lock (&dev->ingress_lock); +spin_lock (&dev->queue_lock);if ((q = dev->qdisc_ingress) !=NULL ) result = q->enqueue (skb, q); -spin_unlock (&dev->ingress_lock); +spin_unlock (&dev->queue_lock); }
net/core/fib_rules.c +30 -0
@@ -152,6 +152,28 @@ out:EXPORT_SYMBOL_GPL (fib_rules_lookup); +static int validate_rulemsg (struct fib_rule_hdr *frh,struct nlattr **tb, +struct fib_rules_ops *ops) +{ +int err = -EINVAL ; + +if (frh->src_len) +if (tb[FRA_SRC ] ==NULL || + frh->src_len > (ops->addr_size *8 ) || +nla_len (tb[FRA_SRC ]) != ops->addr_size) + goto errout; + +if (frh->dst_len) +if (tb[FRA_DST ] ==NULL || + frh->dst_len > (ops->addr_size *8 ) || +nla_len (tb[FRA_DST ]) != ops->addr_size) + goto errout; + + err =0 ; +errout: +return err; +} +int fib_nl_newrule (struct sk_buff *skb,struct nlmsghdr * nlh,void *arg) {struct fib_rule_hdr *frh =nlmsg_data (nlh);
@@ -173,6 +195,10 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)if (err <0 ) goto errout; + err =validate_rulemsg (frh, tb, ops); +if (err <0 ) + goto errout; + rule =kzalloc (ops->rule_size,GFP_KERNEL );if (rule ==NULL ) { err = -ENOMEM ;
@@ -260,6 +286,10 @@ int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)if (err <0 ) goto errout; + err =validate_rulemsg (frh, tb, ops); +if (err <0 ) + goto errout; +list_for_each_entry (rule, ops->rules_list, list) {if (frh->action && (frh->action != rule->action))continue ;
net/dccp/proto.c +3 -1
@@ -575,7 +575,7 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname,if (get_user (len, optlen))return -EFAULT ; -if (len <sizeof (int )) +if (len < (int )sizeof (int ))return -EINVAL ; dp =dccp_sk (sk);
@@ -589,9 +589,11 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname, (__be32 __user *)optval, optlen);case DCCP_SOCKOPT_SEND_CSCOV : val = dp->dccps_pcslen; + len =sizeof (val);break ;case DCCP_SOCKOPT_RECV_CSCOV : val = dp->dccps_pcrlen; + len =sizeof (val);break ; case 128 ... 191: return ccid_hc_rx_getsockopt(dp->dccps_hc_rx_ccid, sk, optname,
net/decnet/dn_rules.c +10 -11
@@ -109,8 +109,6 @@ errout:static struct nla_policy dn_fib_rule_policy[FRA_MAX +1 ]__read_mostly = {FRA_GENERIC_POLICY , - [FRA_SRC ] = { .type =NLA_U16 }, - [FRA_DST ] = { .type =NLA_U16 }, };static int dn_fib_rule_match (struct fib_rule *rule,struct flowi *fl,int flags)
@@ -133,7 +131,7 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb,int err = -EINVAL ;struct dn_fib_rule *r = (struct dn_fib_rule *)rule; -if (frh->src_len >16 || frh->dst_len >16 || frh->tos) +if (frh->tos) goto errout;if (rule->table ==RT_TABLE_UNSPEC ) {
@@ -150,11 +148,11 @@ static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb, } } -if (tb[FRA_SRC ]) - r->src =nla_get_u16 (tb[FRA_SRC ]); +if (frh->src_len) + r->src =nla_get_le16 (tb[FRA_SRC ]); -if (tb[FRA_DST ]) - r->dst =nla_get_u16 (tb[FRA_DST ]); +if (frh->dst_len) + r->dst =nla_get_le16 (tb[FRA_DST ]); r->src_len = frh->src_len; r->srcmask =dnet_make_mask (r->src_len);
@@ -176,10 +174,10 @@ static int dn_fib_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,if (frh->dst_len && (r->dst_len != frh->dst_len))return 0 ; -if (tb[FRA_SRC ] && (r->src !=nla_get_u16 (tb[FRA_SRC ]))) +if (frh->src_len && (r->src !=nla_get_le16 (tb[FRA_SRC ])))return 0 ; -if (tb[FRA_DST ] && (r->dst !=nla_get_u16 (tb[FRA_DST ]))) +if (frh->dst_len && (r->dst !=nla_get_le16 (tb[FRA_DST ])))return 0 ;return 1 ;
@@ -214,9 +212,9 @@ static int dn_fib_rule_fill(struct fib_rule *rule, struct sk_buff *skb, frh->tos =0 ;if (r->dst_len) -NLA_PUT_U16 (skb,FRA_DST , r->dst); +NLA_PUT_LE16 (skb,FRA_DST , r->dst);if (r->src_len) -NLA_PUT_U16 (skb,FRA_SRC , r->src); +NLA_PUT_LE16 (skb,FRA_SRC , r->src);return 0 ;
@@ -249,6 +247,7 @@ int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb)static struct fib_rules_ops dn_fib_rules_ops = { .family = AF_DECnet, .rule_size =sizeof (struct dn_fib_rule ), + .addr_size =sizeof (u16), .action = dn_fib_rule_action, .match = dn_fib_rule_match, .configure = dn_fib_rule_configure,
net/ipv4/fib_rules.c +6 -8
@@ -171,8 +171,6 @@ static struct fib_table *fib_empty_table(void)static struct nla_policy fib4_rule_policy[FRA_MAX +1 ]__read_mostly = {FRA_GENERIC_POLICY , - [FRA_SRC ] = { .type =NLA_U32 }, - [FRA_DST ] = { .type =NLA_U32 }, [FRA_FLOW ] = { .type =NLA_U32 }, };
@@ -183,8 +181,7 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb,int err = -EINVAL ;struct fib4_rule *rule4 = (struct fib4_rule *) rule; -if (frh->src_len >32 || frh->dst_len >32 || - (frh->tos & ~IPTOS_TOS_MASK )) +if (frh->tos & ~IPTOS_TOS_MASK ) goto errout;if (rule->table ==RT_TABLE_UNSPEC ) {
@@ -201,10 +198,10 @@ static int fib4_rule_configure(struct fib_rule *rule, struct sk_buff *skb, } } -if (tb[FRA_SRC ]) +if (frh->src_len) rule4->src =nla_get_be32 (tb[FRA_SRC ]); -if (tb[FRA_DST ]) +if (frh->dst_len) rule4->dst =nla_get_be32 (tb[FRA_DST ]);#ifdef CONFIG_NET_CLS_ROUTE
@@ -242,10 +239,10 @@ static int fib4_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,return 0 ;#endif -if (tb[FRA_SRC ] && (rule4->src !=nla_get_be32 (tb[FRA_SRC ]))) +if (frh->src_len && (rule4->src !=nla_get_be32 (tb[FRA_SRC ])))return 0 ; -if (tb[FRA_DST ] && (rule4->dst !=nla_get_be32 (tb[FRA_DST ]))) +if (frh->dst_len && (rule4->dst !=nla_get_be32 (tb[FRA_DST ])))return 0 ;return 1 ;
@@ -309,6 +306,7 @@ static size_t fib4_rule_nlmsg_payload(struct fib_rule *rule)static struct fib_rules_ops fib4_rules_ops = { .family =AF_INET , .rule_size =sizeof (struct fib4_rule ), + .addr_size =sizeof (u32), .action = fib4_rule_action, .match = fib4_rule_match, .configure = fib4_rule_configure,
net/ipv6/fib6_rules.c +5 -9
@@ -131,8 +131,6 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)static struct nla_policy fib6_rule_policy[FRA_MAX +1 ]__read_mostly = {FRA_GENERIC_POLICY , - [FRA_SRC ] = { .len =sizeof (struct in6_addr ) }, - [FRA_DST ] = { .len =sizeof (struct in6_addr ) }, }; static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,
@@ -142,9 +140,6 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb,int err = -EINVAL ;struct fib6_rule *rule6 = (struct fib6_rule *) rule; -if (frh->src_len >128 || frh->dst_len >128 ) - goto errout; -if (rule->action ==FR_ACT_TO_TBL ) {if (rule->table ==RT6_TABLE_UNSPEC ) goto errout;
@@ -155,11 +150,11 @@ static int fib6_rule_configure(struct fib_rule *rule, struct sk_buff *skb, } } -if (tb[FRA_SRC ]) +if (frh->src_len)nla_memcpy (&rule6->src.addr, tb[FRA_SRC ],sizeof (struct in6_addr )); -if (tb[FRA_DST ]) +if (frh->dst_len)nla_memcpy (&rule6->dst.addr, tb[FRA_DST ],sizeof (struct in6_addr ));
@@ -186,11 +181,11 @@ static int fib6_rule_compare(struct fib_rule *rule, struct fib_rule_hdr *frh,if (frh->tos && (rule6->tclass != frh->tos))return 0 ; -if (tb[FRA_SRC ] && +if (frh->src_len &&nla_memcmp (tb[FRA_SRC ], &rule6->src.addr,sizeof (struct in6_addr )))return 0 ; -if (tb[FRA_DST ] && +if (frh->dst_len &&nla_memcmp (tb[FRA_DST ], &rule6->dst.addr,sizeof (struct in6_addr )))return 0 ;
@@ -240,6 +235,7 @@ static size_t fib6_rule_nlmsg_payload(struct fib_rule *rule)static struct fib_rules_ops fib6_rules_ops = { .family =AF_INET6 , .rule_size =sizeof (struct fib6_rule ), + .addr_size =sizeof (struct in6_addr ), .action = fib6_rule_action, .match = fib6_rule_match, .configure = fib6_rule_configure,
net/ipv6/ip6_fib.c +8 -0
@@ -659,6 +659,10 @@ static int fib6_add_rt2node(struct fib6_node *fn, struct rt6_info *rt, ins = &iter->u.next; } +/* Reset round-robin state, if necessary */ +if (ins == &fn->leaf) + fn->rr_ptr =NULL ; +/* * insert node */
@@ -1110,6 +1114,10 @@ static void fib6_del_route(struct fib6_node *fn, struct rt6_info **rtp, rt6_stats.fib_rt_entries--; rt6_stats.fib_discarded_routes++; +/* Reset round-robin state, if necessary */ +if (fn->rr_ptr == rt) + fn->rr_ptr =NULL ; +/* Adjust walkers */ read_lock (&fib6_walker_lock);FOR_WALKERS (w) {
net/ipv6/route.c +59 -38
128 lines not on this page · raw message
net/sched/cls_basic.c +7 -9
@@ -82,6 +82,13 @@ static void basic_put(struct tcf_proto *tp, unsigned long f)static int basic_init (struct tcf_proto *tp) { +struct basic_head *head; + + head =kzalloc (sizeof (*head),GFP_KERNEL ); +if (head ==NULL ) +return -ENOBUFS ; +INIT_LIST_HEAD (&head->flist); + tp->root = head;return 0 ; }
@@ -177,15 +184,6 @@ static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle, } err = -ENOBUFS ; -if (head ==NULL ) { - head =kzalloc (sizeof (*head),GFP_KERNEL ); -if (head ==NULL ) - goto errout; - -INIT_LIST_HEAD (&head->flist); - tp->root = head; - } - f =kzalloc (sizeof (*f),GFP_KERNEL );if (f ==NULL ) goto errout;
net/socket.c +6 -1
@@ -1368,7 +1368,7 @@ asmlinkage long sys_accept(int fd, struct sockaddr __user *upeer_sockaddr, err =sock_attach_fd (newsock, newfile);if (err <0 ) - goto out_fd; + goto out_fd_simple; err =security_socket_accept (sock, newsock);if (err)
@@ -1401,6 +1401,11 @@ out_put:fput_light (sock->file, fput_needed); out:return err; +out_fd_simple: +sock_release (newsock); +put_filp (newfile); +put_unused_fd (newfd); + goto out_put; out_fd:fput (newfile);put_unused_fd (newfd);
Quoted 14 lines · * Chris Wright ([email protected]) wrote:
crypto/scatterwalk.c +2
-0@@ -91,6 +91,8 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,memcpy_dir (buf, vaddr, len_this_page, out);scatterwalk_unmap (vaddr, out); +scatterwalk_advance (walk, nbytes); +if (nbytes == len_this_page)break ;
crypto/scatterwalk.c void scatterwalk_copychunks(void *buf, struct scatter_walk *walk, · line 105
Quoted 7 lines
crypto/scatterwalk.c +0
-2@@ -99,7 +101,5 @@ void scatterwalk_copychunks(void *buf, struct scatter_walk *walk,scatterwalk_pagedone (walk, out,1 ); } - -scatterwalk_advance (walk, nbytes); }EXPORT_SYMBOL_GPL (scatterwalk_copychunks);
Argh, looks like 2.6.20.5 is brown paper bag material
Chris Wright wrote:
<snip snip>
Quoted 2 lines
Arnaldo Carvalho de Melo (1):
DCCP: Fix exploitable hole in DCCP socket options
<snip snip>
Does this fix cure CVE-2007-1730 and CVE-2007-1734, or just one of them? They both seem to be in the exact same code path the patch touches.