aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/Kconfig3
-rw-r--r--arch/alpha/kernel/pci_iommu.c12
-rw-r--r--drivers/block/floppy.c5
-rw-r--r--drivers/char/riscom8.c2
-rw-r--r--drivers/spi/au1550_spi.c4
-rw-r--r--drivers/spi/spi_bitbang.c8
-rw-r--r--fs/proc/task_mmu.c18
-rw-r--r--include/asm-h8300/uaccess.h11
-rwxr-xr-xscripts/kernel-doc4
-rw-r--r--security/smack/smack.h8
-rw-r--r--security/smack/smackfs.c31
11 files changed, 54 insertions, 52 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 002703b8c0b..729cdbdf803 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -330,6 +330,9 @@ config PCI_DOMAINS
330config PCI_SYSCALL 330config PCI_SYSCALL
331 def_bool PCI 331 def_bool PCI
332 332
333config IOMMU_HELPER
334 def_bool PCI
335
333config ALPHA_CORE_AGP 336config ALPHA_CORE_AGP
334 bool 337 bool
335 depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL 338 depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index e07a23fc5b7..4e1c08636ed 100644
--- a/arch/alpha/kernel/pci_iommu.c
+++ b/arch/alpha/kernel/pci_iommu.c
@@ -10,6 +10,7 @@
10#include <linux/scatterlist.h> 10#include <linux/scatterlist.h>
11#include <linux/log2.h> 11#include <linux/log2.h>
12#include <linux/dma-mapping.h> 12#include <linux/dma-mapping.h>
13#include <linux/iommu-helper.h>
13 14
14#include <asm/io.h> 15#include <asm/io.h>
15#include <asm/hwrpb.h> 16#include <asm/hwrpb.h>
@@ -125,14 +126,6 @@ iommu_arena_new(struct pci_controller *hose, dma_addr_t base,
125 return iommu_arena_new_node(0, hose, base, window_size, align); 126 return iommu_arena_new_node(0, hose, base, window_size, align);
126} 127}
127 128
128static inline int is_span_boundary(unsigned int index, unsigned int nr,
129 unsigned long shift,
130 unsigned long boundary_size)
131{
132 shift = (shift + index) & (boundary_size - 1);
133 return shift + nr > boundary_size;
134}
135
136/* Must be called with the arena lock held */ 129/* Must be called with the arena lock held */
137static long 130static long
138iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena, 131iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
@@ -147,7 +140,6 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
147 base = arena->dma_base >> PAGE_SHIFT; 140 base = arena->dma_base >> PAGE_SHIFT;
148 if (dev) { 141 if (dev) {
149 boundary_size = dma_get_seg_boundary(dev) + 1; 142 boundary_size = dma_get_seg_boundary(dev) + 1;
150 BUG_ON(!is_power_of_2(boundary_size));
151 boundary_size >>= PAGE_SHIFT; 143 boundary_size >>= PAGE_SHIFT;
152 } else { 144 } else {
153 boundary_size = 1UL << (32 - PAGE_SHIFT); 145 boundary_size = 1UL << (32 - PAGE_SHIFT);
@@ -161,7 +153,7 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
161 153
162again: 154again:
163 while (i < n && p+i < nent) { 155 while (i < n && p+i < nent) {
164 if (!i && is_span_boundary(p, n, base, boundary_size)) { 156 if (!i && iommu_is_span_boundary(p, n, base, boundary_size)) {
165 p = ALIGN(p + 1, mask + 1); 157 p = ALIGN(p + 1, mask + 1);
166 goto again; 158 goto again;
167 } 159 }
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 32c79a55511..7652e87d60c 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -217,7 +217,6 @@ static int use_virtual_dma;
217 */ 217 */
218 218
219static DEFINE_SPINLOCK(floppy_lock); 219static DEFINE_SPINLOCK(floppy_lock);
220static struct completion device_release;
221 220
222static unsigned short virtual_dma_port = 0x3f0; 221static unsigned short virtual_dma_port = 0x3f0;
223irqreturn_t floppy_interrupt(int irq, void *dev_id); 222irqreturn_t floppy_interrupt(int irq, void *dev_id);
@@ -4144,7 +4143,6 @@ DEVICE_ATTR(cmos,S_IRUGO,floppy_cmos_show,NULL);
4144 4143
4145static void floppy_device_release(struct device *dev) 4144static void floppy_device_release(struct device *dev)
4146{ 4145{
4147 complete(&device_release);
4148} 4146}
4149 4147
4150static struct platform_device floppy_device[N_DRIVE]; 4148static struct platform_device floppy_device[N_DRIVE];
@@ -4539,7 +4537,6 @@ void cleanup_module(void)
4539{ 4537{
4540 int drive; 4538 int drive;
4541 4539
4542 init_completion(&device_release);
4543 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256); 4540 blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
4544 unregister_blkdev(FLOPPY_MAJOR, "fd"); 4541 unregister_blkdev(FLOPPY_MAJOR, "fd");
4545 4542
@@ -4564,8 +4561,6 @@ void cleanup_module(void)
4564 4561
4565 /* eject disk, if any */ 4562 /* eject disk, if any */
4566 fd_eject(0); 4563 fd_eject(0);
4567
4568 wait_for_completion(&device_release);
4569} 4564}
4570 4565
4571module_param(floppy, charp, 0); 4566module_param(floppy, charp, 0);
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index 589ac6f65b9..3f9d0a9ac36 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -1709,7 +1709,7 @@ static int __init riscom8_init_module (void)
1709 1709
1710 if (iobase || iobase1 || iobase2 || iobase3) { 1710 if (iobase || iobase1 || iobase2 || iobase3) {
1711 for(i = 0; i < RC_NBOARD; i++) 1711 for(i = 0; i < RC_NBOARD; i++)
1712 rc_board[0].base = 0; 1712 rc_board[i].base = 0;
1713 } 1713 }
1714 1714
1715 if (iobase) 1715 if (iobase)
diff --git a/drivers/spi/au1550_spi.c b/drivers/spi/au1550_spi.c
index c47a650183a..41a3d00c451 100644
--- a/drivers/spi/au1550_spi.c
+++ b/drivers/spi/au1550_spi.c
@@ -99,7 +99,7 @@ static dbdev_tab_t au1550_spi_mem_dbdev =
99static void au1550_spi_bits_handlers_set(struct au1550_spi *hw, int bpw); 99static void au1550_spi_bits_handlers_set(struct au1550_spi *hw, int bpw);
100 100
101 101
102/** 102/*
103 * compute BRG and DIV bits to setup spi clock based on main input clock rate 103 * compute BRG and DIV bits to setup spi clock based on main input clock rate
104 * that was specified in platform data structure 104 * that was specified in platform data structure
105 * according to au1550 datasheet: 105 * according to au1550 datasheet:
@@ -650,7 +650,7 @@ static int au1550_spi_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
650 return hw->txrx_bufs(spi, t); 650 return hw->txrx_bufs(spi, t);
651} 651}
652 652
653static irqreturn_t au1550_spi_irq(int irq, void *dev, struct pt_regs *regs) 653static irqreturn_t au1550_spi_irq(int irq, void *dev)
654{ 654{
655 struct au1550_spi *hw = dev; 655 struct au1550_spi *hw = dev;
656 return hw->irq_callback(hw); 656 return hw->irq_callback(hw);
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c
index f7f8580edad..71e881419cd 100644
--- a/drivers/spi/spi_bitbang.c
+++ b/drivers/spi/spi_bitbang.c
@@ -344,12 +344,14 @@ static void bitbang_work(struct work_struct *work)
344 t->rx_dma = t->tx_dma = 0; 344 t->rx_dma = t->tx_dma = 0;
345 status = bitbang->txrx_bufs(spi, t); 345 status = bitbang->txrx_bufs(spi, t);
346 } 346 }
347 if (status > 0)
348 m->actual_length += status;
347 if (status != t->len) { 349 if (status != t->len) {
348 if (status > 0) 350 /* always report some kind of error */
349 status = -EMSGSIZE; 351 if (status >= 0)
352 status = -EREMOTEIO;
350 break; 353 break;
351 } 354 }
352 m->actual_length += status;
353 status = 0; 355 status = 0;
354 356
355 /* protocol tweaks before next transfer */ 357 /* protocol tweaks before next transfer */
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 6dc0334815f..4206454734e 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -640,17 +640,17 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
640 640
641 ret = -EACCES; 641 ret = -EACCES;
642 if (!ptrace_may_attach(task)) 642 if (!ptrace_may_attach(task))
643 goto out; 643 goto out_task;
644 644
645 ret = -EINVAL; 645 ret = -EINVAL;
646 /* file position must be aligned */ 646 /* file position must be aligned */
647 if (*ppos % PM_ENTRY_BYTES) 647 if (*ppos % PM_ENTRY_BYTES)
648 goto out; 648 goto out_task;
649 649
650 ret = 0; 650 ret = 0;
651 mm = get_task_mm(task); 651 mm = get_task_mm(task);
652 if (!mm) 652 if (!mm)
653 goto out; 653 goto out_task;
654 654
655 ret = -ENOMEM; 655 ret = -ENOMEM;
656 uaddr = (unsigned long)buf & PAGE_MASK; 656 uaddr = (unsigned long)buf & PAGE_MASK;
@@ -658,7 +658,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
658 pagecount = (PAGE_ALIGN(uend) - uaddr) / PAGE_SIZE; 658 pagecount = (PAGE_ALIGN(uend) - uaddr) / PAGE_SIZE;
659 pages = kmalloc(pagecount * sizeof(struct page *), GFP_KERNEL); 659 pages = kmalloc(pagecount * sizeof(struct page *), GFP_KERNEL);
660 if (!pages) 660 if (!pages)
661 goto out_task; 661 goto out_mm;
662 662
663 down_read(&current->mm->mmap_sem); 663 down_read(&current->mm->mmap_sem);
664 ret = get_user_pages(current, current->mm, uaddr, pagecount, 664 ret = get_user_pages(current, current->mm, uaddr, pagecount,
@@ -668,6 +668,12 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
668 if (ret < 0) 668 if (ret < 0)
669 goto out_free; 669 goto out_free;
670 670
671 if (ret != pagecount) {
672 pagecount = ret;
673 ret = -EFAULT;
674 goto out_pages;
675 }
676
671 pm.out = buf; 677 pm.out = buf;
672 pm.end = buf + count; 678 pm.end = buf + count;
673 679
@@ -699,15 +705,17 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
699 ret = pm.out - buf; 705 ret = pm.out - buf;
700 } 706 }
701 707
708out_pages:
702 for (; pagecount; pagecount--) { 709 for (; pagecount; pagecount--) {
703 page = pages[pagecount-1]; 710 page = pages[pagecount-1];
704 if (!PageReserved(page)) 711 if (!PageReserved(page))
705 SetPageDirty(page); 712 SetPageDirty(page);
706 page_cache_release(page); 713 page_cache_release(page);
707 } 714 }
708 mmput(mm);
709out_free: 715out_free:
710 kfree(pages); 716 kfree(pages);
717out_mm:
718 mmput(mm);
711out_task: 719out_task:
712 put_task_struct(task); 720 put_task_struct(task);
713out: 721out:
diff --git a/include/asm-h8300/uaccess.h b/include/asm-h8300/uaccess.h
index a22350ec271..356068cd087 100644
--- a/include/asm-h8300/uaccess.h
+++ b/include/asm-h8300/uaccess.h
@@ -91,22 +91,19 @@ extern int __put_user_bad(void);
91#define get_user(x, ptr) \ 91#define get_user(x, ptr) \
92({ \ 92({ \
93 int __gu_err = 0; \ 93 int __gu_err = 0; \
94 uint32_t __gu_val = 0; \ 94 typeof(*(ptr)) __gu_val = *ptr; \
95 switch (sizeof(*(ptr))) { \ 95 switch (sizeof(*(ptr))) { \
96 case 1: \ 96 case 1: \
97 case 2: \ 97 case 2: \
98 case 4: \ 98 case 4: \
99 __gu_val = *(ptr); \ 99 case 8: \
100 break; \
101 case 8: \
102 memcpy(&__gu_val, ptr, sizeof (*(ptr))); \
103 break; \ 100 break; \
104 default: \ 101 default: \
105 __gu_val = 0; \
106 __gu_err = __get_user_bad(); \ 102 __gu_err = __get_user_bad(); \
103 __gu_val = 0; \
107 break; \ 104 break; \
108 } \ 105 } \
109 (x) = (typeof(*(ptr)))__gu_val; \ 106 (x) = __gu_val; \
110 __gu_err; \ 107 __gu_err; \
111}) 108})
112#define __get_user(x, ptr) get_user(x, ptr) 109#define __get_user(x, ptr) get_user(x, ptr)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 74c2f9db2aa..263d04ab2d9 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -247,6 +247,10 @@ my ($function, %function_table,%parametertypes,$declaration_purpose);
247my ($type,$declaration_name,$return_type); 247my ($type,$declaration_name,$return_type);
248my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map); 248my ($newsection,$newcontents,$prototype,$filelist, $brcount, %source_map);
249 249
250if (defined($ENV{'KBUILD_VERBOSE'})) {
251 $verbose = "$ENV{'KBUILD_VERBOSE'}";
252}
253
250# Generated docbook code is inserted in a template at a point where 254# Generated docbook code is inserted in a template at a point where
251# docbook v3.1 requires a non-zero sequence of RefEntry's; see: 255# docbook v3.1 requires a non-zero sequence of RefEntry's; see:
252# http://www.oasis-open.org/docbook/documentation/reference/html/refentry.html 256# http://www.oasis-open.org/docbook/documentation/reference/html/refentry.html
diff --git a/security/smack/smack.h b/security/smack/smack.h
index a21a0e907ab..62c1e982849 100644
--- a/security/smack/smack.h
+++ b/security/smack/smack.h
@@ -26,14 +26,6 @@
26#define SMK_MAXLEN 23 26#define SMK_MAXLEN 23
27#define SMK_LABELLEN (SMK_MAXLEN+1) 27#define SMK_LABELLEN (SMK_MAXLEN+1)
28 28
29/*
30 * How many kinds of access are there?
31 * Here's your answer.
32 */
33#define SMK_ACCESSDASH '-'
34#define SMK_ACCESSLOW "rwxa"
35#define SMK_ACCESSKINDS (sizeof(SMK_ACCESSLOW) - 1)
36
37struct superblock_smack { 29struct superblock_smack {
38 char *smk_root; 30 char *smk_root;
39 char *smk_floor; 31 char *smk_floor;
diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c
index 358c92c1a15..afe7c9b0732 100644
--- a/security/smack/smackfs.c
+++ b/security/smack/smackfs.c
@@ -81,10 +81,23 @@ static struct semaphore smack_write_sem;
81/* 81/*
82 * Values for parsing cipso rules 82 * Values for parsing cipso rules
83 * SMK_DIGITLEN: Length of a digit field in a rule. 83 * SMK_DIGITLEN: Length of a digit field in a rule.
84 * SMK_CIPSOMEN: Minimum possible cipso rule length. 84 * SMK_CIPSOMIN: Minimum possible cipso rule length.
85 * SMK_CIPSOMAX: Maximum possible cipso rule length.
85 */ 86 */
86#define SMK_DIGITLEN 4 87#define SMK_DIGITLEN 4
87#define SMK_CIPSOMIN (SMK_MAXLEN + 2 * SMK_DIGITLEN) 88#define SMK_CIPSOMIN (SMK_LABELLEN + 2 * SMK_DIGITLEN)
89#define SMK_CIPSOMAX (SMK_CIPSOMIN + SMACK_CIPSO_MAXCATNUM * SMK_DIGITLEN)
90
91/*
92 * Values for parsing MAC rules
93 * SMK_ACCESS: Maximum possible combination of access permissions
94 * SMK_ACCESSLEN: Maximum length for a rule access field
95 * SMK_LOADLEN: Smack rule length
96 */
97#define SMK_ACCESS "rwxa"
98#define SMK_ACCESSLEN (sizeof(SMK_ACCESS) - 1)
99#define SMK_LOADLEN (SMK_LABELLEN + SMK_LABELLEN + SMK_ACCESSLEN)
100
88 101
89/* 102/*
90 * Seq_file read operations for /smack/load 103 * Seq_file read operations for /smack/load
@@ -229,14 +242,10 @@ static void smk_set_access(struct smack_rule *srp)
229 * The format is exactly: 242 * The format is exactly:
230 * char subject[SMK_LABELLEN] 243 * char subject[SMK_LABELLEN]
231 * char object[SMK_LABELLEN] 244 * char object[SMK_LABELLEN]
232 * char access[SMK_ACCESSKINDS] 245 * char access[SMK_ACCESSLEN]
233 *
234 * Anything following is commentary and ignored.
235 * 246 *
236 * writes must be SMK_LABELLEN+SMK_LABELLEN+4 bytes. 247 * writes must be SMK_LABELLEN+SMK_LABELLEN+SMK_ACCESSLEN bytes.
237 */ 248 */
238#define MINIMUM_LOAD (SMK_LABELLEN + SMK_LABELLEN + SMK_ACCESSKINDS)
239
240static ssize_t smk_write_load(struct file *file, const char __user *buf, 249static ssize_t smk_write_load(struct file *file, const char __user *buf,
241 size_t count, loff_t *ppos) 250 size_t count, loff_t *ppos)
242{ 251{
@@ -253,7 +262,7 @@ static ssize_t smk_write_load(struct file *file, const char __user *buf,
253 return -EPERM; 262 return -EPERM;
254 if (*ppos != 0) 263 if (*ppos != 0)
255 return -EINVAL; 264 return -EINVAL;
256 if (count < MINIMUM_LOAD) 265 if (count != SMK_LOADLEN)
257 return -EINVAL; 266 return -EINVAL;
258 267
259 data = kzalloc(count, GFP_KERNEL); 268 data = kzalloc(count, GFP_KERNEL);
@@ -513,7 +522,7 @@ static ssize_t smk_write_cipso(struct file *file, const char __user *buf,
513 return -EPERM; 522 return -EPERM;
514 if (*ppos != 0) 523 if (*ppos != 0)
515 return -EINVAL; 524 return -EINVAL;
516 if (count <= SMK_CIPSOMIN) 525 if (count < SMK_CIPSOMIN || count > SMK_CIPSOMAX)
517 return -EINVAL; 526 return -EINVAL;
518 527
519 data = kzalloc(count + 1, GFP_KERNEL); 528 data = kzalloc(count + 1, GFP_KERNEL);
@@ -547,7 +556,7 @@ static ssize_t smk_write_cipso(struct file *file, const char __user *buf,
547 if (ret != 1 || catlen > SMACK_CIPSO_MAXCATNUM) 556 if (ret != 1 || catlen > SMACK_CIPSO_MAXCATNUM)
548 goto out; 557 goto out;
549 558
550 if (count <= (SMK_CIPSOMIN + catlen * SMK_DIGITLEN)) 559 if (count != (SMK_CIPSOMIN + catlen * SMK_DIGITLEN))
551 goto out; 560 goto out;
552 561
553 memset(mapcatset, 0, sizeof(mapcatset)); 562 memset(mapcatset, 0, sizeof(mapcatset));