id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
18b8e15b0433ac682138ce5d03157ddc28bdf350
Analyze and fix the following issue in the Linux kernel code: au1000-eth: fix all but one "line over 80 characters warnings"
Problem Details: One line has not been changed because it would not improve readability. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index df3eee11cd95..a2d86cf62760 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -357,6 +357,7 @@ static int au1000_mii_probe(struct net_device *dev) { struct au1000_private *const aup = netdev_priv(dev); struct phy_de...
ec7eabdde2cc3e71fa71f979bd3448c45122a4a8
Analyze and fix the following issue in the Linux kernel code: au1000-eth: stylistic fixes
Problem Details: This patch fixes the following checkpatch.pl warnings: - spaces after tabs - space between function and arguments - one-line statement braces - tabs instead of spaces Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index b8ae85c6da03..df3eee11cd95 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -13,7 +13,7 @@ * converted to use linux-2.6.x's PHY framework * * Author: MontaVista Software, Inc. - * ppopov@mvista.com or s...
df09162550fbb53354f0c88e85b5d0e6129ee9cc
Analyze and fix the following issue in the Linux kernel code: tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread
Problem Details: Be sure to avoid entering t_show() with FTRACE_ITER_HASH set without having properly started the iterator to iterate the hash. This case is degenerate and, as discovered by Robert Swiecki, can cause t_hash_show() to misuse a pointer. This causes a NULL ptr deref with possible security implications. ...
```diff diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 83a16e9ee518..fa7ece649fe1 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1510,6 +1510,8 @@ static void *t_start(struct seq_file *m, loff_t *pos) if (*pos > 0) return t_hash_start(m, pos); iter->flags |= FTRACE_ITER_P...
40c6023031369ae5573e622ca54fa3ffe89fb865
Analyze and fix the following issue in the Linux kernel code: libata,pata_via: revert ata_wait_idle() removal from ata_sff/via_tf_load()
Problem Details: Commit 978c0666 (libata: Remove excess delay in the tf_load path) removed ata_wait_idle() from ata_sff_tf_load() and via_tf_load(). This caused obscure detection problems in sata_sil. https://bugzilla.kernel.org/show_bug.cgi?id=16606 The commit was pure performance optimization. Revert it for now....
```diff diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 3b82d8ef76f0..dee3c2c52562 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -418,6 +418,7 @@ void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) if (ioaddr->ctl_addr) iowrite8(tf->ctl, ioadd...
eee743fd7eac9f2ea69ad06d093dfb5a12538fe5
Analyze and fix the following issue in the Linux kernel code: minix: fix regression in minix_mkdir()
Problem Details: Commit 9eed1fb721c ("minix: replace inode uid,gid,mode init with helper") broke directory creation on minix filesystems. Fix it by passing the needed mode flag to inode init helper. Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Cc: Dmitry Monakhov <dmonakhov@openvz.org> Cc: Al Viro <viro@zen...
```diff diff --git a/fs/minix/namei.c b/fs/minix/namei.c index e20ee85955d1..f3f3578393a4 100644 --- a/fs/minix/namei.c +++ b/fs/minix/namei.c @@ -115,7 +115,7 @@ static int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode) inode_inc_link_count(dir); - inode = minix_new_inode(dir, mode, &err); + in...
3ab04d5cf9736b7a4e9dfcf28285d8663b01aa0e
Analyze and fix the following issue in the Linux kernel code: vfs: take O_NONBLOCK out of the O_* uniqueness test
Problem Details: O_NONBLOCK on parisc has a dual value: #define O_NONBLOCK 000200004 /* HPUX has separate NDELAY & NONBLOCK */ It is caught by the O_* bits uniqueness check and leads to a parisc compile error. The fix would be to take O_NONBLOCK out. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-b...
```diff diff --git a/fs/fcntl.c b/fs/fcntl.c index 6769fd0f35b8..f8cc34f542c3 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -769,11 +769,15 @@ EXPORT_SYMBOL(kill_fasync); static int __init fcntl_init(void) { - /* please add new bits here to ensure allocation uniqueness */ - BUILD_BUG_ON(19 - 1 /* for O_RDONLY being 0...
8f2ae0faa3a119158c4dcfe89926d6fad5f5332c
Analyze and fix the following issue in the Linux kernel code: swap: do not send discards as barriers
Problem Details: The swap code already uses synchronous discards, no need to add I/O barriers. This fixes the worst of the terrible slowdown in swap allocation for hibernation, reported on 2.6.35 by Nigel Cunningham; but does not entirely eliminate that regression. [tj@kernel.org: superflous newlines removed] Signed-...
```diff diff --git a/mm/swapfile.c b/mm/swapfile.c index ed5151079f59..1894dead0b58 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -139,8 +139,7 @@ static int discard_swap(struct swap_info_struct *si) nr_blocks = ((sector_t)se->nr_pages - 1) << (PAGE_SHIFT - 9); if (nr_blocks) { err = blkdev_issue_discard(si-...
910321ea817a202ff70fac666e37e2c8e2f88823
Analyze and fix the following issue in the Linux kernel code: swap: revert special hibernation allocation
Problem Details: Please revert 2.6.36-rc commit d2997b1042ec150616c1963b5e5e919ffd0b0ebf "hibernation: freeze swap at hibernation". It complicated matters by adding a second swap allocation path, just for hibernation; without in any way fixing the issue that it was intended to address - page reclaim after fixing the h...
```diff diff --git a/include/linux/swap.h b/include/linux/swap.h index 2fee51a11b73..bf4eb62506db 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -315,6 +315,7 @@ extern long nr_swap_pages; extern long total_swap_pages; extern void si_swapinfo(struct sysinfo *); extern swp_entry_t get_swap_page(void)...
0dcc48c15f63ee86c2fcd33968b08d651f0360a5
Analyze and fix the following issue in the Linux kernel code: memory hotplug: fix next block calculation in is_removable
Problem Details: next_active_pageblock() is for finding next _used_ freeblock. It skips several blocks when it finds there are a chunk of free pages lager than pageblock. But it has 2 bugs. 1. We have no lock. page_order(page) - pageblock_order can be minus. 2. pageblocks_stride += is wrong. it should skip page_...
```diff diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index a4cfcdc00455..dd186c1a5d53 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -584,19 +584,19 @@ static inline int pageblock_free(struct page *page) /* Return the start of the next active pageblock after a given page */ static struct page...
1c24de60e50fb19b94d94225458da17c720f0729
Analyze and fix the following issue in the Linux kernel code: kernel/groups.c: fix integer overflow in groups_search
Problem Details: gid_t is a unsigned int. If group_info contains a gid greater than MAX_INT, groups_search() function may look on the wrong side of the search tree. This solves some unfair "permission denied" problems. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Cc: <stable@kernel.org> Signed-off-by: Andrew...
```diff diff --git a/kernel/groups.c b/kernel/groups.c index 53b1916c9492..253dc0f35cf4 100644 --- a/kernel/groups.c +++ b/kernel/groups.c @@ -143,10 +143,9 @@ int groups_search(const struct group_info *group_info, gid_t grp) right = group_info->ngroups; while (left < right) { unsigned int mid = (left+right)/2; ...
408929bed7841686ce5fdd06366fb652cb653d6c
Analyze and fix the following issue in the Linux kernel code: rtc: m41t80: do not use rtc_valid_tm in m41t80_rtc_read_alarm
Problem Details: Commit b485fe5ea ("rtc/m41t80: use rtc_valid_tm() to check returned tm") added rtc_valid_tm to m41t80_rtc_read_alarm() but it was wrong while the t->time does not contain complete date/time. This patch also fixes a warning: warning: passing argument 1 of 'rtc_valid_tm' from incompatible pointer type ...
```diff diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 66377f3e28b8..d60557cae8ef 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) t->time.tm_isdst = -1; t->enabled = !!(reg[M41...
ee3aebdd8f5f8eac41c25c80ceee3d728f920f3b
Analyze and fix the following issue in the Linux kernel code: binfmt_misc: fix binfmt_misc priority
Problem Details: Commit 74641f584da ("alpha: binfmt_aout fix") (May 2009) introduced a regression - binfmt_misc is now consulted after binfmt_elf, which will unfortunately break ia32el. ia32 ELF binaries on ia64 used to be matched using binfmt_misc and executed using wrapper. As 32bit binaries are now matched by binf...
```diff diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index a7528b913936..fd0cc0bf9a40 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -724,7 +724,7 @@ static int __init init_misc_binfmt(void) { int err = register_filesystem(&bm_fs_type); if (!err) { - err = register_binfmt(&misc_format); + err = inse...
4969c1192d15afa3389e7ae3302096ff684ba655
Analyze and fix the following issue in the Linux kernel code: mm: fix swapin race condition
Problem Details: The pte_same check is reliable only if the swap entry remains pinned (by the page lock on swapcache). We've also to ensure the swapcache isn't removed before we take the lock as try_to_free_swap won't care about the page pin. One of the possible impacts of this patch is that a KSM-shared page can poi...
```diff diff --git a/include/linux/ksm.h b/include/linux/ksm.h index 74d691ee9121..3319a6967626 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -16,6 +16,9 @@ struct stable_node; struct mem_cgroup; +struct page *ksm_does_need_to_copy(struct page *page, + struct vm_area_struct *vma, unsigned long add...
e7cb756fc3c7c32040283963572258381b342dff
Analyze and fix the following issue in the Linux kernel code: omap hsmmc: fix a racing case between kmmcd and omap_hsmmc_suspend
Problem Details: If suspend called when kmmcd is doing host->ops->disable, as kmmcd already increased host->en_dis_recurs to 1, the mmc_host_enable in suspend function will return directly without increase the nesting_cnt, which will cause the followed register access carried out to the disabled host. mmc_suspend_host...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index fb6446a6fb4d..4526d2791f29 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2323,8 +2323,8 @@ static int omap_hsmmc_suspend(struct device *dev) } } cancel_work_sync(&host->mmc_carddetect_...
23ef309a6e070490da0a37b9b6383819f8170ea3
Analyze and fix the following issue in the Linux kernel code: mmc: at91_mci: add missing linux/highmem.h include
Problem Details: Fix the following error: at91_mci.c: In function 'at91_mci_sg_to_dma': at91_mci.c:236: error: implicit declaration of function 'kmap_atomic' at91_mci.c:236: error: 'KM_BIO_SRC_IRQ' undeclared (first use in this function) at91_mci.c:236: error: (Each undeclared identifier is reported only once at91_mci...
```diff diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index 5f3a599ead07..87226cd202a5 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c @@ -66,6 +66,7 @@ #include <linux/clk.h> #include <linux/atmel_pdc.h> #include <linux/gfp.h> +#include <linux/highmem.h> #inclu...
16d9b130783c54c30cab80e24810ab1ab9596e11
Analyze and fix the following issue in the Linux kernel code: omap_hsmmc: remove unused local `state'
Problem Details: This fixes the following warning: drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_suspend': drivers/mmc/host/omap_hsmmc.c:2275: warning: unused variable 'state' Introduced by commit ID: commit 1a13f8fa76c880be41d6b1e6a2b44404bcbfdf9e Author: Matt Fleming <matt@console-pimps.org> Date: ...
```diff diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4a8776f8afdd..fb6446a6fb4d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2305,7 +2305,6 @@ static int omap_hsmmc_suspend(struct device *dev) int ret = 0; struct platform_device *pdev = to_pl...
60c2c0d5658082468b569d039f4d0dc24f92c66b
Analyze and fix the following issue in the Linux kernel code: ARM: SAMSUNG: MMC: fix build error when both DMA and PIO mode selected
Problem Details: [cjb: fix line-wrapped patch] Signed-off-by: Jiri Pinkava <jiri.pinkava@vscht.cz> Signed-off-by: Chris Ball <cjb@laptop.org> Cc: Matt Fleming <matt@console-pimps.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Ben Dooks <ben-linux@fluff.org> Cc: <linux-mmc@vger.kernel.org> Signed-off-by: Andrew Morton...
```diff diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 2e16e0a90a5e..976330de379e 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c @@ -1600,7 +1600,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev) host->pio_active = XFER_NONE; #ifdef CONFIG_MMC_S...
5600efb1bc2745d93ae0bc08130117a84f2b9d69
Analyze and fix the following issue in the Linux kernel code: mmc: fix the use of kunmap_atomic() in tmio_mmc.h
Problem Details: kunmap_atomic() takes the cookie, returned by the kmap_atomic() as its argument and not the page address, used as an argument to kmap_atomic(). This patch fixes the compile error: In file included from drivers/mmc/host/tmio_mmc.c:37: drivers/mmc/host/tmio_mmc.h: In function 'tmio_mmc_kunmap_atomic': d...
```diff diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index ee7d0a5a51c4..69d98e3bf6ab 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -164,6 +164,7 @@ tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd) static void tmio_mmc_pio_irq(struct ...
31583bb0cf6cc40f2a468a4d2f3b9cbefd24f891
Analyze and fix the following issue in the Linux kernel code: cgroups: fix API thinko
Problem Details: Add cgroup_attach_task_all() The existing cgroup_attach_task_current_cg() API is called by a thread to attach another thread to all of its cgroups; this is unsuitable for cases where a privileged task wants to attach itself to the cgroups of a less privileged one, since the call must be made from the ...
```diff diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ed3e92e41c6e..0c991023ee47 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h @@ -578,7 +578,12 @@ struct task_struct *cgroup_iter_next(struct cgroup *cgrp, void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it); int c...
ed430fec756ad65f7cfba24f8ad17c3d5a403290
Analyze and fix the following issue in the Linux kernel code: proc: export uncached bit properly in /proc/kpageflags
Problem Details: Fix the left-over old ifdef for PG_uncached in /proc/kpageflags. Now it's used by x86, too. Signed-off-by: Takashi Iwai <tiwai@suse.de> Cc: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/fs/proc/page.c b/fs/proc/page.c index 180cf5a0bd67..3b8b45660331 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -146,7 +146,7 @@ u64 stable_page_flags(struct page *page) u |= kpf_copy_bit(k, KPF_HWPOISON, PG_hwpoison); #endif -#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR +#ifdef CONFIG_ARCH_USES...
85a0fdfd0f967507f3903e8419bc7e408f5a59de
Analyze and fix the following issue in the Linux kernel code: gcov: fix null-pointer dereference for certain module types
Problem Details: The gcov-kernel infrastructure expects that each object file is loaded only once. This may not be true, e.g. when loading multiple kernel modules which are linked to the same object file. As a result, loading such kernel modules will result in incorrect gcov results while unloading will cause a null...
```diff diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c index ef3c3f88a7a3..f83972b16564 100644 --- a/kernel/gcov/fs.c +++ b/kernel/gcov/fs.c @@ -33,10 +33,11 @@ * @children: child nodes * @all: list head for list of all nodes * @parent: parent node - * @info: associated profiling data structure if not a directo...
7a801ac6f5067539ceb5fad0fe90ec49fc156e47
Analyze and fix the following issue in the Linux kernel code: O_DIRECT: fix the splitting up of contiguous I/O
Problem Details: commit c2c6ca4 (direct-io: do not merge logically non-contiguous requests) introduced a bug whereby all O_DIRECT I/Os were submitted a page at a time to the block layer. The problem is that the code expected dio->block_in_file to correspond to the current page in the dio. In fact, it corresponds to t...
```diff diff --git a/fs/direct-io.c b/fs/direct-io.c index 51f270b479b6..48d74c7391d1 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -634,7 +634,7 @@ static int dio_send_cur_page(struct dio *dio) int ret = 0; if (dio->bio) { - loff_t cur_offset = dio->block_in_file << dio->blkbits; + loff_t cur_offset = di...
b6de860651d5a9e56ba4f4e3edc1aa52ac2ac849
Analyze and fix the following issue in the Linux kernel code: rtc-bfin: fix state restoration when resuming
Problem Details: Much (but not all) of the RTC state is kept in the RTC peripheral which has its own power domain. Periodically (1 HZ), that state is synced from one power domain to the other (peripheral->core). When we are resuming, we need to wait for the sync to occur so that we don't get a mismatch of reading und...
```diff diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 65facfbe70fb..d4fb82d85e9b 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c @@ -435,8 +435,17 @@ static int bfin_rtc_resume(struct platform_device *pdev) { if (device_may_wakeup(&pdev->dev)) disable_irq_wake(IRQ_RTC); - els...
110b7e9698601b28f313c2c560d51a8b1c742002
Analyze and fix the following issue in the Linux kernel code: rtc-bfin: fix inverted logic in suspend path
Problem Details: The int_clear helper takes a bitmask of interrupts to keep, not to disable. When suspending without wakeup enabled, we want to disable all interrupts, so use 0 (keep none) instead of -1 (keep all). Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Sig...
```diff diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 72b2bcc2c224..65facfbe70fb 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c @@ -426,7 +426,7 @@ static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) enable_irq_wake(IRQ_RTC); bfin_rtc_sync_pending(&...
f574c843191728d9407b766a027f779dcd27b272
Analyze and fix the following issue in the Linux kernel code: [IA64] fix siglock
Problem Details: When ia64 converted to using ticket locks, an inline implementation of trylock/unlock in fsys.S was missed. This was not noticed because in most circumstances it simply resulted in using the slow path because the siglock was apparently not available (under old spinlock rules). Problems occur when the...
```diff diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index 3567d54f8cee..471a1e783aca 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S @@ -424,14 +424,26 @@ EX(.fail_efault, ld8 r14=[r33]) // r14 <- *set andcm r14=r14,r17 // filter out SIGKILL & SIGSTOP #ifdef CONFIG_SMP - m...
123031c0eeda6144b4002dc3285375aa9ae9dc11
Analyze and fix the following issue in the Linux kernel code: sctp: fix test for end of loop
Problem Details: Add a list_has_sctp_addr function to simplify loop Based on a patches by Dan Carpenter and David Miller Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 24b2cd555637..d344dc481ccc 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -1232,6 +1232,18 @@ out: return 0; } +static bool list_has_sctp_addr(const struct list_head *list, + union sctp_addr *ipaddr) +{ + s...
10c11f304986a1f84201c2261a428701f9d2dffc
Analyze and fix the following issue in the Linux kernel code: x86-64, fpu: Fix %cs value in convert_from_fxsr()
Problem Details: While %ds still contains the userspace selector, %cs is KERNEL_CS at this point. Always get %cs from pt_regs even for the current task. Signed-off-by: Brian Gerst <brgerst@gmail.com> Acked-by: Pekka Enberg <penberg@kernel.org> Cc: Suresh Siddha <suresh.b.siddha@intel.com> LKML-Reference: <1283563039-...
```diff diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 82166519497a..f3775f5ef4ab 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -389,19 +389,17 @@ convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk) #ifdef CONFIG_X86_64 env->fip = fxsave->rip; env...
a4d4fbc7735bba6654b20f859135f9d3f8fe7f76
Analyze and fix the following issue in the Linux kernel code: x86-64, fpu: Disable preemption when using TS_USEDFPU
Problem Details: Consolidates code and fixes the below race for 64-bit. commit 9fa2f37bfeb798728241cc4a19578ce6e4258f25 Author: torvalds <torvalds> Date: Tue Sep 2 07:37:25 2003 +0000 Be a lot more careful about TS_USEDFPU and preemption We had some races where we testecd (or set) TS_USEDFPU together w...
```diff diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 88065e3a03c0..8b40a8379cc2 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h @@ -387,19 +387,6 @@ static inline void irq_ts_restore(int TS_state) stts(); } -#ifdef CONFIG_X86_64 - -static inline void save...
85e00b55517a5696282b80836655e6b6f5702df0
Analyze and fix the following issue in the Linux kernel code: perf symbols: Fix multiple initialization of symbol system
Problem Details: By returning immediately if it was already initialized, do it as well at symbol__exit, refusing multiple deinitializations. This fixes problems in the kmem, sched and timechart commands. Reported-by: Davidlohr Bueso <dave@gnu.org> Cc: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Jovi Zhang <bookjovi...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 1a367734e016..b2f5ae97f33d 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -2268,6 +2268,9 @@ static int setup_list(struct strlist **list, const char *list_str, int symbol__init(void) { + if (symbol_conf.initializ...
0e52247a2ed1f211f0c4f682dc999610a368903f
Analyze and fix the following issue in the Linux kernel code: PCI: fix pci_resource_alignment prototype
Problem Details: This fixes the prototype for both pci_resource_alignment() and pci_sriov_resource_alignment(). Patch started as debugging effort from Cam Macdonell. Cc: Cam Macdonell <cam@cs.ualberta.ca> Cc: Avi Kivity <avi@redhat.com> [chrisw: add iov bits] Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-o...
```diff diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index ce6a3666b3d9..553d8ee55c1c 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -608,7 +608,7 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno, * the VF BAR size multiplied by the number of VFs. The alignment * is just the VF BAR size....
78d16341facf829a71b6f7c68ec5511b9c168060
Analyze and fix the following issue in the Linux kernel code: [SCSI] scsi_transport_fc: fix blocked bsg request when fc object deleted
Problem Details: When an rport is "blocked" and a bsg request is received, the bsg request gets placed on the queue but the queue stalls. If the fc object is then deleted - the bsg queue never restarts and keeps the reference on the object, and stops the overall teardown. This patch restarts the bsg queue on teardown ...
```diff diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 9f0f7d9c7422..78486d540652 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -4048,11 +4048,54 @@ fc_bsg_rportadd(struct Scsi_Host *shost, struct fc_rport *rport) /** * fc_bsg_remove -...
6014759c929b4ce8c068810b8d05f31969df5897
Analyze and fix the following issue in the Linux kernel code: [SCSI] scsi_debug: Update thin provisioning support
Problem Details: The previous thin provisioning support was not very user friendly because it depended on all the relevant options being set on the command line. Implement support for the Thin Provisioning VPD page from SBC3 r24 and add module options for TPU (UNMAP) and TPWS (WRITE SAME (16) with UNMAP bit). This al...
```diff diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index b02bdc6c2cd1..06329d47b38f 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -109,10 +109,12 @@ static const char * scsi_debug_version_date = "20100324"; #define DEF_PHYSBLK_EXP 0 #define DEF_LOWEST_ALIGNED 0 #de...
47259658ed9fad837541b738f9375d38022daa14
Analyze and fix the following issue in the Linux kernel code: [SCSI] fix kconfig dependency warnings related to SCSI_SAS_ATTRS
Problem Details: Fix kconfig dependency warnings in scsi/Kconfig: warning: (SCSI_SAS_LIBSAS && SCSI || SCSI_MPT2SAS && SCSI_LOWLEVEL && PCI && SCSI || FUSION_SAS && FUSION && PCI && SCSI) selects SCSI_SAS_ATTRS which has unmet direct dependencies (SCSI && BLK_DEV_BSG) Signed-off-by: Randy Dunlap <randy.dunlap@oracle....
```diff diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig index a6fdcf4cf74a..2e9632e2c98b 100644 --- a/drivers/scsi/Kconfig +++ b/drivers/scsi/Kconfig @@ -316,7 +316,8 @@ config SCSI_ISCSI_ATTRS config SCSI_SAS_ATTRS tristate "SAS Transport Attributes" - depends on SCSI && BLK_DEV_BSG + depends on SCSI + s...
e6d4ef450965af5a3753184d36ef9db7a3242950
Analyze and fix the following issue in the Linux kernel code: [SCSI] iscsi transport: fix kernel-doc notation
Problem Details: Fix typo in scsi_transport_iscsi.c kernel-doc notation: Warning(drivers/scsi/scsi_transport_iscsi.c:548): No description found for parameter 'cmd' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse....
```diff diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index e84026def1f4..332387a6bc25 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -537,7 +537,7 @@ static void iscsi_scan_session(struct work_struct *work) /** * iscsi_block_s...
a1c985158382cbce0b58b3264f771b3b153668a6
Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Reduce redundant mic location prefix in input source labels
Problem Details: When the mic pins are assigned to the same location, we can omit the redundant location prefix like "Front" or "Rear". Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index e3284341c484..affb4607c6da 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -4618,32 +4618,64 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, } EXPORT_SYMBOL_HDA(snd_hda_parse_pin_def_config); +enu...
3b8fad3e2f5f69bfd8e42d099ca8582fb2342edf
Analyze and fix the following issue in the Linux kernel code: irq: Fix circular headers dependency
Problem Details: asm-generic/hardirq.h needs asm/irq.h which might include linux/interrupt.h as in the sparc 32 case. At this point we need irq_cpustat generic definitions, but those are included later in asm-generic/hardirq.h. Then delay a bit the inclusion of irq.h from asm-generic/hardirq.h, it doesn't need to be i...
```diff diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index 62f59080e5cc..04d0a977cd43 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h @@ -3,13 +3,13 @@ #include <linux/cache.h> #include <linux/threads.h> -#include <linux/irq.h> typedef struct { unsig...
4e231c7962ce711c7d8c2a4dc23ecd1e8fc28363
Analyze and fix the following issue in the Linux kernel code: perf: Fix up delayed_put_task_struct()
Problem Details: I missed a perf_event_ctxp user when converting it to an array. Pull this last user into perf_event.c as well and fix it up. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c1173520f14d..93bf53aa50e5 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -889,6 +889,7 @@ extern void perf_event_task_sched_out(struct task_struct *task, struct task_stru extern int perf_event_init_task(str...
da2b71edd8a7db44fe1746261410a981f3e03632
Analyze and fix the following issue in the Linux kernel code: sched: Move sched_avg_update() to update_cpu_load()
Problem Details: Currently sched_avg_update() (which updates rt_avg stats in the rq) is getting called from scale_rt_power() (in the load balance context) which doesn't take rq->lock. Fix it by moving the sched_avg_update() to more appropriate update_cpu_load() where the CFS load gets updated as well. Signed-off-by: ...
```diff diff --git a/kernel/sched.c b/kernel/sched.c index 09b574e7f4df..ed09d4f2a69c 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -1294,6 +1294,10 @@ static void resched_task(struct task_struct *p) static void sched_rt_avg_update(struct rq *rq, u64 rt_delta) { } + +static void sched_avg_update(struct rq *rq)...
5e11637e2c929e34dcc0fbbfb48bdb638937701a
Analyze and fix the following issue in the Linux kernel code: perf: Fix CPU hotplug
Problem Details: Since we have UP_PREPARE, we should also have UP_CANCELED. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: paulus <paulus@samba.org> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
```diff diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 657555a5f30f..db5b56064687 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -5761,15 +5761,15 @@ perf_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { unsigned int cpu = (long)hcpu; - switch (action) { + sw...
9cb627d5f38830ca19aa0dca52d1d3a633018bf7
Analyze and fix the following issue in the Linux kernel code: perf, trace: Fix module leak
Problem Details: Commit 1c024eca (perf, trace: Optimize tracepoints by using per-tracepoint-per-cpu hlist to track events) caused a module refcount leak. Reported-And-Tested-by: Avi Kivity <avi@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <4C7E1F12.8030304@cn.fujitsu.com> Signed-o...
```diff diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index 000e6e85b445..31cc4cb0dbf2 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c @@ -91,6 +91,8 @@ int perf_trace_init(struct perf_event *p_event) tp_event->class && tp_event->class->reg && ...
f1f5a807b051eddd3f302e503d39214e5bde0ef2
Analyze and fix the following issue in the Linux kernel code: ahci: fix hang on failed softreset
Problem Details: ahci_do_softreset() compared the current time and deadline in reverse when calculating timeout for SRST issue. The result is that if @deadline is in future, SRST is issued with 0 timeout, which hasn't caused any problem because it later waits for DRDY with the correct timeout. If deadline is already ...
```diff diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 666850d31df2..68dc6785472f 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1326,7 +1326,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, /* issue the first D2H Register FIS */ msecs = 0; now = jiffies...
673424c0890a00e22398017c9adf999577526220
Analyze and fix the following issue in the Linux kernel code: pata_artop: Fix device ID parity check
Problem Details: x % 1 always evaluates to 0, which clearly isn't the intent. The author probably had "% 2" or "& 1" in mind, and mispelled it. Signed-off-by: Jean Delvare <jdelvare@suse.de> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
```diff diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index ba43f0f8c880..2215632e4b31 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c @@ -74,7 +74,8 @@ static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline) struct pci_dev *pdev = to_pci_dev(ap->host->dev...
5ba2aaaaa1a282a71c27f385a743f0d86f3484ca
Analyze and fix the following issue in the Linux kernel code: drm/i915/debug: Include Ironlake in self-refresh status
Problem Details: Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
```diff diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 7700ccf25784..3d882b70af16 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -752,15 +752,17 @@ static int i915_sr_status(struct seq_file *m, void *unused) drm_i915_private_...
da908f2fb4e783c2a4de751fb90f11a0dd041161
Analyze and fix the following issue in the Linux kernel code: KVM: x86: Perform hardware_enable in CPU_STARTING callback
Problem Details: The CPU_STARTING callback was added upstream with the intention of being used for KVM, specifically for the hardware enablement that must be done before we can run in hardware virt. It had bugs on the x86_64 architecture at the time, where it was called after CPU_ONLINE. The arches have since merged ...
```diff diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index b78b794c1039..d4853a54771a 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1958,10 +1958,10 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val, cpu); hardware_disable(NULL); break; - case CP...
3c9a024fde58b08745680863859d1483def64f74
Analyze and fix the following issue in the Linux kernel code: percpu: fix build breakage on s390 and cleanup build configuration tests
Problem Details: Commit bbddff05 (percpu: use percpu allocator on UP too) incorrectly excluded pcpu_build_alloc_info() on SMP configurations which use generic setup_per_cpu_area() like s390. The config ifdefs are becoming confusing. Fix and clean it up by, * Move pcpu_build_alloc_info() right on top of its two users...
```diff diff --git a/mm/percpu.c b/mm/percpu.c index fa70122dfdd0..0cd4bf61012c 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1075,165 +1075,6 @@ void __init pcpu_free_alloc_info(struct pcpu_alloc_info *ai) free_bootmem(__pa(ai), ai->__ai_size); } -#if defined(CONFIG_SMP) && (defined(CONFIG_NEED_PER_CPU_EMBED_FIR...
3a5c19c23db65a554f2e4f5df5f307c668277056
Analyze and fix the following issue in the Linux kernel code: [SCSI] fix use-after-free in scsi_init_io()
Problem Details: we're using a pointer through a freed command to reset the request, which has shown up as an oops with slab poisoning: Reported-by: Tejun Heo <tj@kernel.org> Reported-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
```diff diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9ade720422c6..ee02d3838a0a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1011,8 +1011,8 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask) err_exit: scsi_release_buffers(cmd); - scsi_put_command(cmd); cm...
d530148ae8bffe1b33f50d1776d185a6e85dc774
Analyze and fix the following issue in the Linux kernel code: dquot: do full inode dirty in allocating space
Problem Details: Alex Shi found a regression when doing ffsb test. The test has several threads, and each thread creates a small file, write to it and then delete it. ffsb reports about 20% regression and Alex bisected it to 43d2932d88e4. The test will call __mark_inode_dirty 3 times. without this commit, we only take ...
```diff diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index d50ba858cfe0..d1a9193960f1 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -274,8 +274,14 @@ static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) int ret; ret = dquot_alloc_space_nodirty(inode, n...
99f08bf59019ca6c9056f10ee8f7e1ba6663251c
Analyze and fix the following issue in the Linux kernel code: ALSA: oxygen: fix CONFIG_SND_OXYGEN_LIB dependency selection
Problem Details: As the select directive does not handle indirect dependencies, select those explicitly in the driver sections. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index b40f2b8df536..0e75d558f303 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig @@ -207,12 +207,12 @@ config SND_CMIPCI config SND_OXYGEN_LIB tristate - select SND_PCM - select SND_MPU401_UART config SND_OXYGEN tristate "C-Media 8788 (O...
9bac84edf0360ac94a27308778ef98dc9068777c
Analyze and fix the following issue in the Linux kernel code: ALSA: virtuoso: fix Xonar DS input switches
Problem Details: Use the correct number, register bits, and names for the input switches. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c index 4346006df3ec..fb3f95ccafa1 100644 --- a/sound/pci/oxygen/xonar_wm87x6.c +++ b/sound/pci/oxygen/xonar_wm87x6.c @@ -29,6 +29,13 @@ * GPIO 6 -> route input jack to input 1/2 (1/0) * GPIO 7 -> enable output to speakers * GPIO...
da0dab5ecb5001f76e739e71ee199db4c61e7af2
Analyze and fix the following issue in the Linux kernel code: ALSA: virtuoso: fix WM8766 register writes with MSB
Problem Details: The check for the volume update latch bit was accidentally in the wrong function, where it would prevent the MSB from being written, instead of correctly ignoring it for cached values. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
```diff diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c index b82c1cfa96f5..4346006df3ec 100644 --- a/sound/pci/oxygen/xonar_wm87x6.c +++ b/sound/pci/oxygen/xonar_wm87x6.c @@ -97,8 +97,12 @@ static void wm8766_write(struct oxygen *chip, (0 << OXYGEN_SPI_CODEC_SHIFT) | OXYGEN_SPI...
7839d956fc6aecbb66d645b4050e8e88e2e821cd
Analyze and fix the following issue in the Linux kernel code: drm/i915: Double check that the wait_request is not pending before warning
Problem Details: If we are busy, then we may have woken up the wait_request handler but not yet serviced it before the hang check fires. So in hang check, double check that the i915_gem_do_wait_request() is still pending the wake-up before declaring all hope lost. Fixes regression with e78d73b16bcde921c9cf458d2e4de8e4...
```diff diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 59457e83b011..744225ebb4b2 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1350,17 +1350,25 @@ void i915_hangcheck_elapsed(unsigned long data) i915_seqno_passed(i915_get_gem_seqno(dev, ...
a7a13d0676335a7dc9dd72264cca02606e43aaba
Analyze and fix the following issue in the Linux kernel code: ALSA: rawmidi: fix the get next midi device ioctl
Problem Details: If we pass in a device which is higher than SNDRV_RAWMIDI_DEVICES then the "next device" should be -1. This function just returns device + 1. But the main thing is that "device + 1" can lead to a (harmless) integer overflow and that annoys static analysis tools. [fix the case for device == SNDRV_RAW...
```diff diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index eb68326c37d4..a7868ad4d530 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -829,6 +829,8 @@ static int snd_rawmidi_control_ioctl(struct snd_card *card, if (get_user(device, (int __user *)argp)) return -EFAULT; + if (devic...
6b5e0736634d7b3d5f88d801e5a5e456190c42db
Analyze and fix the following issue in the Linux kernel code: Staging: fix Makefile so broadcom driver will actually build.
Problem Details: It would be nice if people tested their patches before sending them to me... Cc: Henry Ptasinski <henryp@broadcom.com> Cc: Brett Rudley <brudley@broadcom.com> Cc: Nohee Ko <noheek@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index 2e825895a5b9..88a934e907fb 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -14,7 +14,7 @@ obj-$(CONFIG_W35UND) += winbond/ obj-$(CONFIG_PRISM2_USB) += wlan-ng/ obj-$(CONFIG_ECHO) += echo/ obj-$(CONFIG_OTUS) += o...
842ec6ba3bdf6de35359726b0428095fdd0f9b45
Analyze and fix the following issue in the Linux kernel code: Staging: comedi: fix space coding style issue in adl_pci9111.c
Problem Details: This is a patch to the adl_pci9111.c file that fixes up multiple please, no space for starting a line warnings, found by the checkpatch.pl tool Signed-off-by: Maurice Dawson <mauricedawson2699@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/comedi/drivers/adl_pci9111.c b/drivers/staging/comedi/drivers/adl_pci9111.c index b2a02b0f569a..96c4f300205e 100644 --- a/drivers/staging/comedi/drivers/adl_pci9111.c +++ b/drivers/staging/comedi/drivers/adl_pci9111.c @@ -1,26 +1,26 @@ /* - comedi/drivers/adl_pci9111.c +comedi/...
7f440f49d16c84959194813c763f38ac9c1eee0d
Analyze and fix the following issue in the Linux kernel code: Staging: rtl8192e: Fix indent in some places
Problem Details: Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
```diff diff --git a/drivers/staging/rtl8192e/r8192E_dm.c b/drivers/staging/rtl8192e/r8192E_dm.c index aa52c6b967c5..0d66fafbebf1 100644 --- a/drivers/staging/rtl8192e/r8192E_dm.c +++ b/drivers/staging/rtl8192e/r8192E_dm.c @@ -909,9 +909,9 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device * dev) ...
5adb5bc65f93e52341c3fc9d03d4030dd375e256
Analyze and fix the following issue in the Linux kernel code: RDS: have sockets get transport module references
Problem Details: Right now there's nothing to stop the various paths that use rs->rs_transport from racing with rmmod and executing freed transport code. The simple fix is to have binding to a transport also hold a reference to the transport's module, removing this class of races. We already had an unused t_owner fie...
```diff diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c index 57ef0ec4f03d..8e3886d353b5 100644 --- a/net/rds/af_rds.c +++ b/net/rds/af_rds.c @@ -90,6 +90,8 @@ static int rds_release(struct socket *sock) rds_sock_count--; spin_unlock_irqrestore(&rds_sock_lock, flags); + rds_trans_put(rs->rs_transport); + sock-...
f046011cd73c372267befd10242988eb744649fe
Analyze and fix the following issue in the Linux kernel code: RDS/IB: track signaled sends
Problem Details: We're seeing bugs today where IB connection shutdown clears the send ring while the tasklet is processing completed sends. Implementation details cause this to dereference a null pointer. Shutdown needs to wait for send completion to stop before tearing down the connection. We can't simply wait for ...
```diff diff --git a/net/rds/ib.h b/net/rds/ib.h index acda2dbc6576..a13ced504145 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -108,6 +108,7 @@ struct rds_ib_connection { struct rds_header *i_send_hdrs; u64 i_send_hdrs_dma; struct rds_ib_send_work *i_sends; + atomic_t i_signaled_sends; /* rx */ struct...
80c51be56ffa257d3177f0d750d90be65d30c22f
Analyze and fix the following issue in the Linux kernel code: RDS: return to a single-threaded krdsd
Problem Details: We were seeing very nasty bugs due to fundamental assumption the current code makes about concurrent work struct processing. The code simpy isn't able to handle concurrent connection shutdown work function execution today, for example, which is very much possible once a multi-threaded krdsd was introd...
```diff diff --git a/net/rds/threads.c b/net/rds/threads.c index 2bab9bf07b91..c08c220efac5 100644 --- a/net/rds/threads.c +++ b/net/rds/threads.c @@ -214,7 +214,7 @@ void rds_threads_exit(void) int __init rds_threads_init(void) { - rds_wq = create_workqueue("krdsd"); + rds_wq = create_singlethread_workqueue("krdsd...
0f4b1c7e89e699f588807a914ec6e6396c851a72
Analyze and fix the following issue in the Linux kernel code: rds: fix rds_send_xmit() serialization
Problem Details: rds_send_xmit() was changed to hold an interrupt masking spinlock instead of a mutex so that it could be called from the IB receive tasklet path. This broke the TCP transport because its xmit method can block and masks and unmasks interrupts. This patch serializes callers to rds_send_xmit() with a si...
```diff diff --git a/net/rds/connection.c b/net/rds/connection.c index 5bb0eec5ada3..89871db77f8f 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -148,9 +148,7 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr, spin_lock_init(&conn->c_lock); conn->c_next_tx_seq = 1; - s...
501dcccdb7a2335cde07d4acb56e636182d62944
Analyze and fix the following issue in the Linux kernel code: rds: block ints when acquiring c_lock in rds_conn_message_info()
Problem Details: conn->c_lock is acquired in interrupt context. rds_conn_message_info() is called from user context and was acquiring c_lock without blocking interrupts, leading to possible deadlocks. Signed-off-by: Zach Brown <zach.brown@oracle.com>
```diff diff --git a/net/rds/connection.c b/net/rds/connection.c index 5bd96d538fb9..5bb0eec5ada3 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -375,6 +375,7 @@ static void rds_conn_message_info(struct socket *sock, unsigned int len, struct rds_connection *conn; struct rds_message *rm; unsigned ...
671202f3491cccdb267f88ad59ba0635aeb2a22e
Analyze and fix the following issue in the Linux kernel code: rds: remove unused rds_send_acked_before()
Problem Details: rds_send_acked_before() wasn't blocking interrupts when acquiring c_lock from user context but nothing calls it. Rather than fix its use of c_lock we just remove the function. Signed-off-by: Zach Brown <zach.brown@oracle.com>
```diff diff --git a/net/rds/rds.h b/net/rds/rds.h index cba5f8bb4780..270ded76fd53 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h @@ -724,7 +724,6 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest); typedef int (*is_acked_func)(struct rds_message *rm, uint64_t ack); void rds_send_drop_acked(stru...
33244125871734ebc0d8d147680a0d7e99385e0b
Analyze and fix the following issue in the Linux kernel code: RDS/IB: Add caching of frags and incs
Problem Details: This patch is based heavily on an initial patch by Chris Mason. Instead of freeing slab memory and pages, it keeps them, and funnels them back to be reused. The lock minimization strategy uses xchg and cmpxchg atomic ops for manipulation of pointers to list heads. We anchor the lists with a pointer to...
```diff diff --git a/net/rds/ib.h b/net/rds/ib.h index 9bb7a7412a44..2efd9d11e7d4 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -21,6 +21,8 @@ #define RDS_IB_SUPPORTED_PROTOCOLS 0x00000003 /* minor versions supported */ +#define RDS_IB_RECYCLE_BATCH_COUNT 32 + extern struct list_head rds_ib_devices; /* @@ -3...
3e0249f9c05cb77b66f7f09644ca9ca208d991a9
Analyze and fix the following issue in the Linux kernel code: RDS/IB: add refcount tracking to struct rds_ib_device
Problem Details: The RDS IB client .remove callback used to free the rds_ibdev for the given device unconditionally. This could race other users of the struct. This patch adds refcounting so that we only free the rds_ibdev once all of its users are done. Many rds_ibdev users are tied to connections. We give the con...
```diff diff --git a/net/rds/ib.c b/net/rds/ib.c index 7d289d7985fe..1732f8effb59 100644 --- a/net/rds/ib.c +++ b/net/rds/ib.c @@ -59,6 +59,38 @@ struct list_head rds_ib_devices; DEFINE_SPINLOCK(ib_nodev_conns_lock); LIST_HEAD(ib_nodev_conns); +/* + * rds_ib_destroy_mr_pool() blocks on a few things and mrs drop ref...
1cc2228c599f173d77000a250bf0541294e1a7be
Analyze and fix the following issue in the Linux kernel code: rds: Fix reference counting on the for xmit_atomic and xmit_rdma
Problem Details: This makes sure we have the proper number of references in rds_ib_xmit_atomic and rds_ib_xmit_rdma. We also consistently drop references the same way for all message types as the IOs end. Signed-off-by: Chris Mason <chris.mason@oracle.com>
```diff diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 82459e52c771..209dbc6d159d 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -757,6 +757,8 @@ int rds_ib_xmit_atomic(struct rds_connection *conn, struct rm_atomic_op *op) send->s_wr.next = NULL; send->s_wr.wr.atomic.remote_addr = op->op_remote...
c9e65383a20d9a656db70efbf67e57f8115ad776
Analyze and fix the following issue in the Linux kernel code: rds: Fix RDMA message reference counting
Problem Details: The RDS send_xmit code was trying to get fancy with message counting and was dropping the final reference on the RDMA messages too early. This resulted in memory corruption and oopsen. The fix here is to always add a ref as the parts of the message passes through rds_send_xmit, and always drop a ref ...
```diff diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 657037d96cbf..82459e52c771 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -268,11 +268,12 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context) if (send->s_queued + HZ/2 < jiffies) rds_ib_stats_inc(s_ib_tx_stalled); - ...
7e3f2952eeb1a0fe2aa9882fd1705a88f9d89b35
Analyze and fix the following issue in the Linux kernel code: rds: don't let RDS shutdown a connection while senders are present
Problem Details: This is the first in a long line of patches that tries to fix races between RDS connection shutdown and RDS traffic. Here we are maintaining a count of active senders to make sure the connection doesn't go away while they are using it. Signed-off-by: Chris Mason <chris.mason@oracle.com>
```diff diff --git a/net/rds/connection.c b/net/rds/connection.c index 7e4e9dfdbc0b..9c249f394f29 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -148,6 +148,7 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr, spin_lock_init(&conn->c_send_lock); atomic_set(&conn->c_sen...
976673ee1b92d939168c8c1fbad3e16c45caa545
Analyze and fix the following issue in the Linux kernel code: rds: switch to rwlock on bind_lock
Problem Details: The bind_lock is almost entirely readonly, but it gets hammered during normal operations and is a major bottleneck. This commit changes it to an rwlock, which takes it from 80% of the system time on a big numa machine down to much lower numbers. A better fix would involve RCU, which is done in a late...
```diff diff --git a/net/rds/bind.c b/net/rds/bind.c index 65de5cbdb576..a65afff6f4b5 100644 --- a/net/rds/bind.c +++ b/net/rds/bind.c @@ -43,7 +43,7 @@ * This is now called for every incoming frame so we arguably care much more * about it than we used to. */ -static DEFINE_SPINLOCK(rds_bind_lock); +static DEFINE...
cf4b7389ee812817deeb11da1422004e01b50646
Analyze and fix the following issue in the Linux kernel code: RDS: Fix locking in send on m_rs_lock
Problem Details: Do not nest m_rs_lock under c_lock Disable interrupts in {rdma,atomic}_send_complete Signed-off-by: Andy Grover <andy.grover@oracle.com>
```diff diff --git a/net/rds/send.c b/net/rds/send.c index 15b715a85fd5..ecda3e6c432c 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -468,8 +468,9 @@ void rds_atomic_send_complete(struct rds_message *rm, int status) struct rds_sock *rs = NULL; struct rm_atomic_op *ao; struct rds_notifier *notifier; + unsigne...
2ad8099b58f274dc23bc866ca259d7e5db87fa1a
Analyze and fix the following issue in the Linux kernel code: RDS: rds_send_xmit() locking/irq fixes
Problem Details: rds_message_put() cannot be called with irqs off, so move it after irqs are re-enabled. Spinlocks throughout the function do not to use _irqsave because the lock of c_send_lock at top already disabled irqs. Signed-off-by: Andy Grover <andy.grover@oracle.com>
```diff diff --git a/net/rds/send.c b/net/rds/send.c index d4feec6ad09c..624a3dc7f060 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -168,7 +168,7 @@ int rds_send_xmit(struct rds_connection *conn) if (!rm) { unsigned int len; - spin_lock_irqsave(&conn->c_lock, flags); + spin_lock(&conn->c_lock); ...
6c7cc6e4694dc464ae884332f2a322973497e3cf
Analyze and fix the following issue in the Linux kernel code: RDS: Rename data op members prefix from m_ to op_
Problem Details: For consistency. Signed-off-by: Andy Grover <andy.grover@oracle.com>
```diff diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 63981cd1827a..95f15247acd7 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -76,7 +76,7 @@ static void rds_ib_send_unmap_rm(struct rds_ib_connection *ic, rdsdebug("ic %p send %p rm %p\n", ic, send, rm); ib_dma_unmap_sg(ic->i_cm_id->device, ...
f8b3aaf2ba8ca9e27b47f8bfdff07c8b968f2c05
Analyze and fix the following issue in the Linux kernel code: RDS: Remove struct rds_rdma_op
Problem Details: A big changeset, but it's all pretty dumb. struct rds_rdma_op was already embedded in struct rm_rdma_op. Remove rds_rdma_op and put its members in rm_rdma_op. Rename members with "op_" prefix instead of "r_", for consistency. Of course this breaks a lot, so fixup the code accordingly. Signed-off-by:...
```diff diff --git a/net/rds/ib.h b/net/rds/ib.h index 96769b86a536..d64b5087eefe 100644 --- a/net/rds/ib.h +++ b/net/rds/ib.h @@ -54,7 +54,7 @@ struct rds_ib_connect_private { struct rds_ib_send_work { struct rds_message *s_rm; - struct rds_rdma_op *s_op; + struct rm_rdma_op *s_op; struct ib_send_wr s_wr; str...
3ef13f3c22aaea28aff383cb0883481d24885456
Analyze and fix the following issue in the Linux kernel code: RDS: cleanup/fix rds_rdma_unuse
Problem Details: First, it looks to me like the atomic_inc is wrong. We should be decrementing refcount only once here, no? It's already being done by the mr_put() at the end. Second, simplify the logic a bit by bailing early (with a warning) if !mr. Signed-off-by: Andy Grover <andy.grover@oracle.com>
```diff diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 24274bb9e329..5011efa62a92 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -414,27 +414,30 @@ void rds_rdma_unuse(struct rds_sock *rs, u32 r_key, int force) spin_lock_irqsave(&rs->rs_rdma_lock, flags); mr = rds_mr_tree_walk(&rs->rs_rdma_keys, r_key, N...
9de0864cf55927a7383b5ba6e48834ff3ef053de
Analyze and fix the following issue in the Linux kernel code: RDS: Fix locking in send on m_rs_lock
Problem Details: Do not nest m_rs_lock under c_lock Disable interrupts in {rdma,atomic}_send_complete Signed-off-by: Andy Grover <andy.grover@oracle.com>
```diff diff --git a/net/rds/send.c b/net/rds/send.c index aee58f931b69..725fb0419797 100644 --- a/net/rds/send.c +++ b/net/rds/send.c @@ -415,8 +415,9 @@ void rds_rdma_send_complete(struct rds_message *rm, int status) struct rds_sock *rs = NULL; struct rds_rdma_op *ro; struct rds_notifier *notifier; + unsigned l...
35b52c70534cb7193b218ec12efe6bc595312097
Analyze and fix the following issue in the Linux kernel code: RDS: Fix corrupted rds_mrs
Problem Details: On second look at this bug (OFED #2002), it seems that the collision is not with the retransmission queue (packet acked by the peer), but with the local send completion. A theoretical sequence of events (from time t0 to t3) is thought to be as follows, Thread #1 t0: sock_release rds_release ...
```diff diff --git a/net/rds/rdma.c b/net/rds/rdma.c index 3b442d4d64cf..463b458ff27e 100644 --- a/net/rds/rdma.c +++ b/net/rds/rdma.c @@ -130,14 +130,22 @@ void rds_rdma_drop_keys(struct rds_sock *rs) { struct rds_mr *mr; struct rb_node *node; + unsigned long flags; /* Release any MRs associated with this soc...
9e2effba2c16fc3bd47da605116485afe01e0be0
Analyze and fix the following issue in the Linux kernel code: RDS: Fix BUG_ONs to not fire when in a tasklet
Problem Details: in_interrupt() is true in softirqs. The BUG_ONs are supposed to check for if irqs are disabled, so we should use BUG_ON(irqs_disabled()) instead, duh. Signed-off-by: Andy Grover <andy.grover@oracle.com>
```diff diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index a54cd63f9e35..a92aebcb7fcf 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -441,7 +441,7 @@ static void __rds_ib_teardown_mr(struct rds_ib_mr *ibmr) /* FIXME we need a way to tell a r/w MR * from a r/o MR */ - BUG_ON(in_interrupt())...
152e1d592071c8b312bb898bc1118b64e4aea535
Analyze and fix the following issue in the Linux kernel code: PM: Prevent waiting forever on asynchronous resume after failing suspend
Problem Details: During suspend, the power.completion is expected to be set when a device has not yet started suspending. Set it on init to fix a corner case where a device is resumed when its parent has never suspended. Consider three drivers, A, B, and C. The parent of A is C, and C has async_suspend set. On boot...
```diff diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 5419a49ff135..276d5a701dc3 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -59,6 +59,7 @@ void device_pm_init(struct device *dev) { dev->power.status = DPM_ON; init_completion(&dev->power.completion); + compl...
933d41f1f2b6d5e7bcc0782ad0eeaac983a79592
Analyze and fix the following issue in the Linux kernel code: ixgbe: fix TX ring enable issues seen when VMDQ is enabled
Problem Details: The ordering of operations was messed up in the init and as a result when VMDQ was enabled we were trying to enable TX rings before setting the VFTE bits. This resulted in a ring that appeared to fail to enable when in fact it was blocked because the VFTE bits were cleared after the reset. Signed-off-...
```diff diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 3aafe94741ba..0027d7561516 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -3004,7 +3004,6 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) /* Program registers for the dist...
29da03b9d1c6f24548d98cebda1e15a25d80ee1b
Analyze and fix the following issue in the Linux kernel code: RDMA/nes: Fix hang with modified FIN handling on A0 cards
Problem Details: Changing state to CLOSING when FIN is received causes A0 cards to hang. Fix this by checking for A0 cards in FIN handling. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
```diff diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index ba93a8be6bf6..1980a461c499 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c @@ -3469,7 +3469,8 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, if (atomic_inc_...
dae58728dc64e9ad71c40ac90b463bff6ecce271
Analyze and fix the following issue in the Linux kernel code: RDMA/nes: Fix double CLOSE event indication crash
Problem Details: During a stress testing in a large cluster, multiple close event are detected and BUG() is hit in the iWARP core. The cause is that the active node gave up while waiting for an MPA response from the peer and tried to close the connection by sending RST. The passive node driver receives the RST but is...
```diff diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 443cea55daac..61e0efd4ccfb 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c @@ -502,7 +502,9 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, static void...
ae2688d59b5f861dc70a091d003773975d2ae7fb
Analyze and fix the following issue in the Linux kernel code: net: blackhole route should always be recalculated
Problem Details: Blackhole routes are used when xfrm_lookup() returns -EREMOTE (error triggered by IKE for example), hence this kind of route is always temporary and so we should check if a better route exists for next packets. Bug has been introduced by commit d11a4dc18bf41719c9f0d7ed494d295dd2973b92. Signed-off-by: ...
```diff diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 3f56b6e6c6aa..6298f75d5e93 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2738,6 +2738,11 @@ slow_output: } EXPORT_SYMBOL_GPL(__ip_route_output_key); +static struct dst_entry *ipv4_blackhole_dst_check(struct dst_entry *dst, u32 cookie) +{ + re...
70c9db0fdfd703781c3b8c2caf9287806f642e02
Analyze and fix the following issue in the Linux kernel code: RDMA/nes: Write correct register write to set TX pause param
Problem Details: Setting TX pause param writes to the wrong register location causing the adapter to hang. Correct the define used to write the reigster. Addresses: https://bugs.openfabrics.org/show_bug.cgi?id=2116 Reported-by: Shiri Franchi <shirif@voltaire.com> Signed-off-by: Chien Tung <chien.tin.tung@intel.com> S...
```diff diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 6dfdd49cdbcf..10560c796fd6 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c @@ -1446,14 +1446,14 @@ static int nes_netdev_set_pauseparam(struct net_device *netdev, NES_IDX_...
7332f2a6217ee6925f83ef0e725013067ed316ba
Analyze and fix the following issue in the Linux kernel code: cifs: eliminate some more premature cifsd exits
Problem Details: If the tcpStatus is still CifsNew, the main cifs_demultiplex_loop can break out prematurely in some cases. This is wrong as we will almost always have other structures with pointers to the TCP_Server_Info. If the main loop breaks under any other condition other than tcpStatus == CifsExiting, then it'll...
```diff diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5f68b968faa7..5fde83f0c75e 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -416,14 +416,6 @@ incomplete_rcv: } else continue; } else if (length <= 0) { - if (server->tcpStatus == CifsNew) { - cFYI(1, "tcp session abend after SMB...
522bbe65a2415fabce618186fc7777eb4c502989
Analyze and fix the following issue in the Linux kernel code: cifs: prevent cifsd from exiting prematurely
Problem Details: When cifs_demultiplex_thread exits, it does a number of cleanup tasks including freeing the TCP_Server_Info struct. Much of the existing code in cifs assumes that when there is a cisfSesInfo struct, that it holds a reference to a valid TCP_Server_Info struct. We can never allow cifsd to exit when a ci...
```diff diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0ea52e9f9065..5f68b968faa7 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -400,7 +400,9 @@ incomplete_rcv: cFYI(1, "call to reconnect done"); csocket = server->ssocket; continue; - } else if ((length == -ERESTARTSYS) || (length == ...
e508be174ad36b0cf9b324cd04978c2b13c21502
Analyze and fix the following issue in the Linux kernel code: e1000: fix Tx hangs by disabling 64-bit DMA
Problem Details: Several users report issues with 32-bit adapters when plugged into PCI slots in machines with >= 4GB ram. In particular AMD systems with HyperTransport to PCI bridges seem to trigger the issue, but it isn't limited to only them. This issue is not easily reproducible here, yet still continues to occur...
```diff diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 17f5867b5d9b..8d9269d12a67 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -789,6 +789,70 @@ static const struct net_device_ops e1000_netdev_ops = { #endif }; +/** + * e1000_init_hw_struct ...
f6b085b69d1cbbd62f49f34e71a3d58cb6d34b7e
Analyze and fix the following issue in the Linux kernel code: ipv4: Suppress lockdep-RCU false positive in FIB trie (3)
Problem Details: Hi, Here is one more of these warnings and a patch below: Sep 5 23:52:33 del kernel: [46044.244833] =================================================== Sep 5 23:52:33 del kernel: [46044.269681] [ INFO: suspicious rcu_dereference_check() usage. ] Sep 5 23:52:33 del kernel: [46044.277000] -----------...
```diff diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 79d057a939ba..4a8e370862bc 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -186,7 +186,9 @@ static inline struct tnode *node_parent_rcu(struct node *node) { struct tnode *ret = node_parent(node); - return rcu_dereference(ret); + ret...
745e507a9c79c6e1385d3414d5e56f3d4621a375
Analyze and fix the following issue in the Linux kernel code: Revert "missing changes during ntlmv2/ntlmssp auth and sign"
Problem Details: This reverts commit 3ec6bbcdb4e85403f2c5958876ca9492afdf4031. The change to kernel crypto and fixes to ntlvm2 and ntlmssp series, introduced a regression. Deferring this patch series to 2.6.37 after Shirish fixes it. Signed-off-by: Steve French <sfrench@us.ibm.com> Acked-by: Jeff Layton ...
```diff diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index eef78c24e0cc..051d00011ca3 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -553,8 +553,6 @@ calc_seckey(struct TCP_Server_Info *server) return 1; } - desc.tfm = tfm_arc4; - crypto_blkcipher_setkey(tfm_arc4, server->se...
ee9c5cfad29c8a13199962614b9b16f1c4137ac9
Analyze and fix the following issue in the Linux kernel code: niu: Fix kernel buffer overflow for ETHTOOL_GRXCLSRLALL
Problem Details: niu_get_ethtool_tcam_all() assumes that its output buffer is the right size, and warns before returning if it is not. However, the output buffer size is under user control and ETHTOOL_GRXCLSRLALL is an unprivileged ethtool command. Therefore this is at least a local denial-of-service vulnerability. ...
```diff diff --git a/drivers/net/niu.c b/drivers/net/niu.c index b9b950845b0e..340cbec48943 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -7272,32 +7272,28 @@ static int niu_get_ethtool_tcam_all(struct niu *np, struct niu_parent *parent = np->parent; struct niu_tcam_entry *tp; int i, idx, cnt; - u16 n...
56234e2767496c125a858f880f1b3a62e04a3406
Analyze and fix the following issue in the Linux kernel code: Revert "Eliminate sparse warning - bad constant expression"
Problem Details: This reverts commit 2d20ca835867d93ead6ce61780d883a4b128106d. The change to kernel crypto and fixes to ntlvm2 and ntlmssp series, introduced a regression. Deferring this patch series to 2.6.37 after Shirish fixes it. Signed-off-by: Steve French <sfrench@us.ibm.com> Acked-by: Jeff Layton ...
```diff diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 709f2296bdb4..eef78c24e0cc 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -45,38 +45,39 @@ extern void SMBencrypt(unsigned char *passwd, const unsigned char *c8, static int cifs_calculate_signature(const struct smb_hdr *cifs_pd...
7100ae97266e387d25d0c8a5d9934931f0b07dbc
Analyze and fix the following issue in the Linux kernel code: Revert "[CIFS] Eliminate unused variable warning"
Problem Details: The change to kernel crypto and fixes to ntlvm2 and ntlmssp series, introduced a regression. Deferring this patch series to 2.6.37 after Shirish fixes it. This reverts commit c89e5198b26a869ce2842bad8519264f3394dee9. Signed-off-by: Steve French <sfrench@us.ibm.com> Acked-by: Jeff Layton <jlayton@red...
```diff diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 795095f4eac6..4788e16a02cc 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -620,6 +620,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, struct key *spnego_key = NULL; __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */ ...
fb8621bb6c040a25ac2fc246653859f841a1f53d
Analyze and fix the following issue in the Linux kernel code: net: remove address space warnings in net/socket.c
Problem Details: Casts __kernel to __user pointer require __force markup, so add it. Also sock_get/setsockopt() takes @optval and/or @optlen arguments as user pointers but were taking kernel pointers, use new variables 'uoptval' and/or 'uoptlen' to fix it. These remove following warnings from sparse: net/socket.c:192...
```diff diff --git a/net/socket.c b/net/socket.c index 7848d12f5e4d..717a5f1c8792 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1918,7 +1918,8 @@ SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) * Afterwards, it will be a kernel pointer. Thus the compiler-assisted * checking fa...
6d886fd042634c0d3312bace63a5d0c541b721dc
Analyze and fix the following issue in the Linux kernel code: x86, cpu: Fix allowed CPUID bits for KVM guests
Problem Details: The AMD extensions to AVX (FMA4, XOP) work on the same YMM register set as AVX, so they are safe for guests to use, as long as AVX itself is allowed. Add F16C and AES on the way for the same reasons. Signed-off-by: Andre Przywara <andre.przywara@amd.com> LKML-Reference: <1283778860-26843-4-git-send-em...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index dd54779ccbea..6c2ecf0a806d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -1991,13 +1991,14 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, 0 /* Reserved */ | F(CX16) | 0 /* xTPR Update, PDCM */ | 0 /* Reserv...
7ef8aa72ab176e0288f363d1247079732c5d5792
Analyze and fix the following issue in the Linux kernel code: x86, cpu: Fix renamed, not-yet-shipping AMD CPUID feature bit
Problem Details: The AMD SSE5 feature set as-it has been replaced by some extensions to the AVX instruction set. Thus the bit formerly advertised as SSE5 is re-used for one of these extensions (XOP). Although this changes the /proc/cpuinfo output, it is not user visible, as there are no CPUs (yet) having this feature. ...
```diff diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 781a50b29a49..c9c73d8dedb0 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -152,7 +152,7 @@ #define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */ #define X...
6176b8f908a58a7affaacf6f3a90ef14325686f0
Analyze and fix the following issue in the Linux kernel code: drm/i915: use 125MHz reference clock for PCH attached eDP
Problem Details: Fix the test so we don't try to use the 450MHz refclk on PCH attached eDP. References: https://bugs.freedesktop.org/show_bug.cgi?id=29141 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
```diff diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 38bf7cd3d480..8c1da1efc063 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -246,8 +246,11 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, /* The clock divider is based off the hrawclk, *...
7eaf5547d0460027b15a297bb15d80bdd600cb41
Analyze and fix the following issue in the Linux kernel code: drm/i915: fix eDP detection
Problem Details: Panel needs to be powered up. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
```diff diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index eb6e6763ff56..38bf7cd3d480 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -754,13 +754,14 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, } } -static ...
19966754328d99ee003ddfc7a8c31ceb115483ac
Analyze and fix the following issue in the Linux kernel code: drm/i915: die, i915_probe_agp, die
Problem Details: Use the detection from intel-gtt.ko instead. Hooray! Also move the stolen mem allocator to the other gtt stuff in dev_prv->mem. v2: Chris Wilson noted that my error handling was crap. Fix it. He also said that this fixes a problem on his i845. Indeed, i915_probe_agp misses a special case for i830/i84...
```diff diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 6eb64c19af0e..9cb7c98afb9c 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -1714,6 +1714,12 @@ int intel_gmch_probe(struct pci_dev *pdev, } EXPORT_SYMBOL(intel_gmch_probe); +struct intel_gtt *intel...
e5e408fc94595aab897f613b6f4e2f5b36870a6f
Analyze and fix the following issue in the Linux kernel code: intel-gtt: fix gtt_total_entries detection
Problem Details: In commit f1befe71 Chris Wilson added some code to clear the full gtt on g33/pineview instead of just the mappable part. The code looks like it was copy-pasted from agp/intel-gtt.c, at least an identical piece of code is still there (in intel_i830_init_gtt_entries). This lead to a regression in 2.6.35 ...
```diff diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 56bcf27bdb77..3b84d8445a43 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -699,71 +699,43 @@ static unsigned int intel_gtt_stolen_entries(void) static unsigned int intel_gtt_total_entries(void) { ...
05f25abcf6043952fb2a2d98735dec58ba1fcadb
Analyze and fix the following issue in the Linux kernel code: powerpc/5200: mpc52xx_uart.c: Add of_node_put to avoid memory leak
Problem Details: Add a call to of_node_put in the error handling code following a call to of_find_compatible_node. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r exists@ local idexpression x; expression E,E1; statement S; @@ *x = (of_find_node_by_path |of_find_nod...
```diff diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 8dedb266f143..c4399e23565a 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -500,6 +500,7 @@ static int __init mpc512x_psc_fifoc_init(void) psc_fifoc = of_iomap(np, 0); if (!psc_fifoc) { pr_e...
970f4be85ae6ecf97b711a3a2a1d5cecd3ea0534
Analyze and fix the following issue in the Linux kernel code: firewire: ohci: activate cycle timer register quirk on Ricoh chips
Problem Details: The Ricoh FireWire controllers appear to have the non-atomic cycle timer register access bug, so, activate the driver workaround by default. The behaviour was observed on: Ricoh Co Ltd R5C552 IEEE 1394 Controller [1180:0552] and Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 04). Signed-of...
```diff diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index be29b0bb2471..1b05896648bc 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -263,6 +263,7 @@ static const struct { {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, QUIRK_NO_MSI}, {PCI_VENDOR_ID_NEC, PCI_ANY_ID,...
545074fb953e1753f6b8409db533ad7998789efb
Analyze and fix the following issue in the Linux kernel code: spi/pl022: fix APB pclk power regression on U300
Problem Details: With the introduction of an AMBA PrimeCell per-cell block clock, the pclk was left on after probe() unless explicitly disabled. This clock is wired to the same clock on PL022 causing it to stay always on since. Fix this up properly by clocking the pclk whenever we want to write into any PL022 register...
```diff diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index acd35d1ebd12..80613abe961d 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c @@ -503,8 +503,9 @@ static void giveback(struct pl022 *pl022) msg->state = NULL; if (msg->complete) msg->complete(msg->context); - /* This...
c3f139b65585a5f29df47b2302ff8dbd9bdad0b0
Analyze and fix the following issue in the Linux kernel code: spi/s3c64xx: Fix incorrect reuse of 'val' local variable.
Problem Details: Instead of, wrongly, reusing the 'val' variable, use a dedicated one for reading the status register. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
```diff diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c index 240b690a8a6f..ef9dacabe062 100644 --- a/drivers/spi/spi_s3c64xx.c +++ b/drivers/spi/spi_s3c64xx.c @@ -326,10 +326,11 @@ static int wait_for_xfer(struct s3c64xx_spi_driver_data *sdd, val = msecs_to_jiffies(ms) + 10; val = wait_for_com...