id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
321fb991399bd7b156f8b15a8acfa0c8622e3c68 | Analyze and fix the following issue in the Linux kernel code: vxlan: fix byte order in hash function | Problem Details:
Shift was wrong direction causing packets to hash based on
other parts of the ethernet header, not the address.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 92150c0cf4d9..882a041d7594 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -228,9 +228,9 @@ static u32 eth_hash(const unsigned char *addr)
/* only want 6 bytes */
#ifdef __BIG_ENDIAN
- value <<= 16;
-#else
value >>= 16;
+#else
+ v... |
7386199c471f70526bbcc629f072a5a8effe218f | Analyze and fix the following issue in the Linux kernel code: DM RAID: Fix comparison of index and quantity for "rebuild" parameter | Problem Details:
DM RAID: Fix comparison of index and quantity for "rebuild" parameter
The "rebuild" parameter takes an index argument that starts counting from
zero. The conditional used to validate the index was using '>' rather than
'>=', leaving the door open for an index value that would be 1 too large.
Reporte... | ```diff
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 4e79ebaab3c1..89a06a361332 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -539,7 +539,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
/* Parameters that take a numeric value are checked here */
if (!strca... |
2863b9eb44787adecba4f977d71d7fd876805b1c | Analyze and fix the following issue in the Linux kernel code: MD RAID10: Prep for DM RAID10 device replacement capability | Problem Details:
MD RAID10: Fix a couple potential kernel panics if RAID10 is used by dm-raid
When device-mapper uses the RAID10 personality through dm-raid.c, there is no
'gendisk' structure in mddev and some sysfs information is also not populated.
This patch avoids touching those non-existent structures.
Signed-... | ```diff
diff --git a/drivers/md/md.c b/drivers/md/md.c
index feab588adb50..85e6786653ea 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2044,8 +2044,14 @@ EXPORT_SYMBOL(md_integrity_register);
/* Disable data integrity if non-capable/non-matching disk is being added */
void md_integrity_add_rdev(struct md_rdev... |
5aa8b572007c4bca1e6d3dd4c4820f1ae49d6bb2 | Analyze and fix the following issue in the Linux kernel code: pktgen: fix crash when generating IPv6 packets | Problem Details:
For IPv6, sizeof(struct ipv6hdr) = 40, thus the following
expression will result negative:
datalen = pkt_dev->cur_pkt_size - 14 -
sizeof(struct ipv6hdr) - sizeof(struct udphdr) -
pkt_dev->pkt_overhead;
And, the check "if (datalen < sizeof(struct pktgen_hdr... | ```diff
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 148e73d2c451..e356b8d52bad 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2927,7 +2927,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
sizeof(struct ipv6hdr) - sizeof(struct udphdr) -
pkt_dev->pkt_overhead;
- ... |
49999ab27eab6289a8e4f450e148bdab521361b2 | Analyze and fix the following issue in the Linux kernel code: autofs4 - fix reset pending flag on mount fail | Problem Details:
In autofs4_d_automount(), if a mount fail occurs the AUTOFS_INF_PENDING
mount pending flag is not cleared.
One effect of this is when using the "browse" option, directory entry
attributes show up with all "?"s due to the incorrect callback and
subsequent failure return (when in fact no callback should... | ```diff
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index e7396cfdb109..91b11650722e 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -392,10 +392,12 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
ino->flags |= AUTOFS_INF_PENDING;
spin_unlock(&sbi->fs_lock);
status = autofs4_... |
55c2770e413e96871147b9406a9c41fe9bc5209c | Analyze and fix the following issue in the Linux kernel code: sparc64: fix ptrace interaction with force_successful_syscall_return() | Problem Details:
we want syscall_trace_leave() called on exit from any syscall;
skipping its call in case we'd done force_successful_syscall_return()
is broken...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index 1d7e274f3f2b..7f5f65d0b3fd 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -212,24 +212,20 @@ linux_sparc_syscall:
3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
ret_sys_call:
ldx [%sp + PTREGS_OFF + PT... |
cd9d6f10d07f26dd8a70e519c22b6b4f8a9e3e7a | Analyze and fix the following issue in the Linux kernel code: gbefb: fix compile error | Problem Details:
The patch "drivers/video/gbefb.c: use devm_ functions" caused a
compile error.
drivers/video/gbefb.c:1159:16: error: implicit declaration of function
'devm_ioremap' [-Werror=implicit-function-declaration]
drivers/video/gbefb.c:1179:3: error: implicit declaration of function
'devm_ioremap_nocache' [-We... | ```diff
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index 9b79d3835f04..8dc1f7a55083 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -20,6 +20,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/module.h>
+#include <linux/io.h>
#ifdef CONFIG_X86
#include <asm/mtr... |
f88620b9c5521e9cb9de88e56272bfec3d831513 | Analyze and fix the following issue in the Linux kernel code: sparc64: Fix deficiencies in sun4v error reporting. | Problem Details:
Missing error types, attributes, and report fields. Pad out
to 64-bytes.
Make string reporting cleaner and easier to extend in the future using
"const char *" arrays that index by either bit position, or absolute
field value.
Report the raw 64-byte error report as a sequence of u64s before the
annot... | ```diff
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
index 7c831d848b4e..73083e1d38d9 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
@@ -265,6 +265,11 @@ extern __must_check long strnlen_user(const char __user *str, long n);
#define ... |
ec073619cdda99ffb6a07d3b8000569f5210815a | Analyze and fix the following issue in the Linux kernel code: perf: fix duplicate header inclusion | Problem Details:
#include <stdbool.h> somehow got duplicated on its way to linus's tree
(probably as a conflict resolution as things got sent through multiple
trees)
Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>... | ```diff
diff --git a/tools/perf/util/include/linux/rbtree.h b/tools/perf/util/include/linux/rbtree.h
index 9bcdc844b330..2a030c5af3aa 100644
--- a/tools/perf/util/include/linux/rbtree.h
+++ b/tools/perf/util/include/linux/rbtree.h
@@ -1,3 +1,2 @@
#include <stdbool.h>
-#include <stdbool.h>
#include "../../../../includ... |
cd59085a9b89585f20b4765f74c04e8c527f09f2 | Analyze and fix the following issue in the Linux kernel code: memcg, kmem: fix build error when CONFIG_INET is disabled | Problem Details:
Commit e1aab161e013 ("socket: initial cgroup code.") causes a build
error when CONFIG_INET is disabled in Linus' tree:
net/built-in.o: In function `sk_update_clone':
net/core/sock.c:1336: undefined reference to `sock_update_memcg'
sock_update_memcg() is only defined when CONFIG_INET is enabled, s... | ```diff
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index fd0e6d53836e..11ddc7ffeba8 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -396,7 +396,7 @@ enum {
};
struct sock;
-#ifdef CONFIG_MEMCG_KMEM
+#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM)
void so... |
8dc0839510ed4a7c594386ef58446b014fb4c27a | Analyze and fix the following issue in the Linux kernel code: rtc: kconfig: fix RTC_INTF defaults connected to RTC_CLASS | Problem Details:
Commit 6b8029fab641 ("rtc: kconfig: remove unnecessary dependencies")
removed various 'depends on RTC_CLASS' dependencies but also removed a
few 'default RTC_CLASS' statements, which actually changed default
behavior.
This resulted in the various RTC interfaces (sysfs, proc, dev) all being
disabled by... | ```diff
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index e069f176a82d..19c03ab2bdcb 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -59,6 +59,7 @@ comment "RTC interfaces"
config RTC_INTF_SYSFS
boolean "/sys/class/rtc/rtcN (sysfs)"
depends on SYSFS
+ default RTC_CLASS
help
Say yes h... |
fdb8d561e6fb8538e320554b991ed183b19ddc83 | Analyze and fix the following issue in the Linux kernel code: rapidio: fix comment | Problem Details:
The resource index for the mailboxes was incorrect.
Signed-off-by: Chad Reese <kreese@caviumnetworks.com>
Acked-by: Alexandre Bounine <alexandre.bounine@idt.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/include/linux/rio.h b/include/linux/rio.h
index ac21ac675265..4187da511006 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -63,7 +63,7 @@
*
* 0 RapidIO inbound doorbells
* 1 RapidIO inbound mailboxes
- * 1 RapidIO outbound mailboxes
+ * 2 RapidIO outbound mailboxes
*/
#define... |
627260595ca6abcb16d68a3732bac6b547e112d6 | Analyze and fix the following issue in the Linux kernel code: mm: compaction: fix bit ranges in {get,clear,set}_pageblock_skip() | Problem Details:
{get,clear,set}_pageblock_skip() use incorrect bit ranges (please compare
to bit ranges used by {get,set}_pageblock_flags() used for migration
types) and can overwrite pageblock migratetype of the next pageblock in
the bitmap.
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-... | ```diff
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index eed27f4f4c3e..be655e4a2a75 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -71,13 +71,13 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
#ifdef CONFIG_COMPACTION
... |
1633dbbacbaa3a2f95ef901caf9d0b32728c10b6 | Analyze and fix the following issue in the Linux kernel code: arch/powerpc/platforms/pseries/hotplug-memory.c: section removal cleanups | Problem Details:
Followups to d760afd4d257 ("memory-hotplug: suppress "Trying to free
nonexistent resource <XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY>" warning").
- use unsigned long type, as overflows are conceivable
- rename `i' to the less-misleading and more informative `section'
Cc: Benjamin Herrenschmidt <benh@kerne... | ```diff
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 2fe690fcaa1d..ecdb0a6b3171 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -77,8 +77,9 @@ static int pseries_remove_memblock(... |
158544b165d362c23acdde0104d9aab505a262a6 | Analyze and fix the following issue in the Linux kernel code: arch/powerpc/platforms/pseries/hotplug-memory.c: fix section handling code | Problem Details:
Fix
arch/powerpc/platforms/pseries/hotplug-memory.c: In function 'pseries_remove_memblock':
arch/powerpc/platforms/pseries/hotplug-memory.c:103:17: error: unused variable 'pfn' [-Werror=unused-variable]
Caused by commit d760afd4d257 ("memory-hotplug: suppress "Trying to free
nonexistent resource ... | ```diff
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index dc0a035e63bb..2fe690fcaa1d 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -101,7 +101,7 @@ static int pseries_remove_membloc... |
87cac8f879a5ecd7109dbe688087e8810b3364eb | Analyze and fix the following issue in the Linux kernel code: s390/kvm: dont announce RRBM support | Problem Details:
Newer kernels (linux-next with the transparent huge page patches)
use rrbm if the feature is announced via feature bit 66.
RRBM will cause intercepts, so KVM does not handle it right now,
causing an illegal instruction in the guest.
The easy solution is to disable the feature bit for the guest.
This ... | ```diff
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index ecced9d18986..38883f0bf27e 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -997,7 +997,7 @@ static int __init kvm_s390_init(void)
}
memcpy(facilities, S390_lowcore.stfle_fac_list, 16);
facilities[0] &= 0xff00fff... |
82a1273713df37375a75d6a700deef70c0d21360 | Analyze and fix the following issue in the Linux kernel code: s390/kvm: Interrupt injection bugfix | Problem Details:
EXTERNAL_CALL and EMERGENCY type interrupts need to preserve their interrupt
code parameter when being injected from user space.
Signed-off-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-of... | ```diff
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index ff1e2f8ef94a..c30615e605ac 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -629,10 +629,27 @@ int kvm_s390_inject_vcpu(struct kvm_vcpu *vcpu,
break;
case KVM_S390_SIGP_STOP:
case KVM_S390_RESTART:
+ VCPU_E... |
d151f63f20133aef9dbda209faddebcddbfccf31 | Analyze and fix the following issue in the Linux kernel code: KVM: change kvm_assign_device() to print return value when iommu_attach_device() fails | Problem Details:
Change existing kernel error message to include return value from
iommu_attach_device() when it fails. This will help debug device
assignment failures more effectively.
Signed-off-by: Shuah Khan <shuah.khan@hp.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> | ```diff
diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c
index 037cb6730e68..18e1e30019e3 100644
--- a/virt/kvm/iommu.c
+++ b/virt/kvm/iommu.c
@@ -168,11 +168,7 @@ int kvm_assign_device(struct kvm *kvm,
r = iommu_attach_device(domain, &pdev->dev);
if (r) {
- printk(KERN_ERR "assign device %x:%x:%x.%x failed",
- ... |
abce9ac292e13da367bbd22c1f7669f988d931ac | Analyze and fix the following issue in the Linux kernel code: tpm: Propagate error from tpm_transmit to fix a timeout hang | Problem Details:
tpm_write calls tpm_transmit without checking the return value and
assigns the return value unconditionally to chip->pending_data, even if
it's an error value.
This causes three bugs.
So if we write to /dev/tpm0 with a tpm_param_size bigger than
TPM_BUFSIZE=0x1000 (e.g. 0x100a)
and a bufsize also bigg... | ```diff
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 6724615a4fdd..4caef331a705 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1182,17 +1182,20 @@ ssize_t tpm_write(struct file *file, const char __user *buf,
size_t size, loff_t *off)
{
struct tpm_chip *chip = file->pr... |
899649b7d4ead76c19e39251ca886eebe3f811a8 | Analyze and fix the following issue in the Linux kernel code: vfio: Fix PCI INTx disable consistency | Problem Details:
The virq_disabled flag tracks the userspace view of INTx masking
across interrupt mode changes, but we're not consistently applying
this to the interrupt and masking handler notion of the device.
Currently if the user sets DisINTx while in MSI or MSIX mode, then
returns to INTx mode (ex. rebooting a qe... | ```diff
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
index c8139a598f84..3639371fa697 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -366,6 +366,17 @@ static int vfio_intx_enable(struct vfio_pci_device *vdev)
return -ENOMEM;
vdev->n... |
34002f54d2bd8e8ac04f0da0847f71a8a06a5d38 | Analyze and fix the following issue in the Linux kernel code: vfio: Fix PCI mmap after b3b9c293 | Problem Details:
Our mmap path mistakely relied on vma->vm_pgoff to get set in
remap_pfn_range. After b3b9c293, that path only applies to
copy-on-write mappings. Set it in our own code.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com> | ```diff
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 6d369fe9d30b..6c119944bbb6 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -408,7 +408,7 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma)
struct vfio_pci_device *vdev = device_d... |
1631cfb7cee28388b04aef6c0a73050f6fd76e4d | Analyze and fix the following issue in the Linux kernel code: driver/char/tpm: fix regression causesd by ppi | Problem Details:
This patch try to fix the S3 regression https://lkml.org/lkml/2012/10/5/433,
which includes below line:
[ 1554.684638] sysfs: cannot create duplicate filename '/devices/pnp0/00:0c/ppi'
The root cause is that ppi sysfs teardown code is MIA, so while S3 resume,
the ppi kobject will be created again upon... | ```diff
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index f26afdb1a702..b429f1ea1b97 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1259,6 +1259,7 @@ void tpm_remove_hardware(struct device *dev)
misc_deregister(&chip->vendor.miscdev);
sysfs_remove_group(&dev->kobj, chip->ven... |
dcd8f39230b9f724ba4f55f14ed2bb8119204385 | Analyze and fix the following issue in the Linux kernel code: hwmon: Add missing inclusions of <linux/jiffies.h> | Problem Details:
Many hwmon drivers use jiffies but omit the inclusion of the header
file. Fix that, and also fix one driver which was including the header
file but didn't need it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Luca Tettamanti <kronos.it@gmail.c... | ```diff
diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c
index 8b24d1a4a2b4..dafa477715e3 100644
--- a/drivers/hwmon/adm9240.c
+++ b/drivers/hwmon/adm9240.c
@@ -50,6 +50,7 @@
#include <linux/hwmon-vid.h>
#include <linux/err.h>
#include <linux/mutex.h>
+#include <linux/jiffies.h>
/* Addresses to scan... |
4d7e47bc83438e366195512fde34015b30ec5921 | Analyze and fix the following issue in the Linux kernel code: hwmon: Fix spelling of Celsius | Problem Details:
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org> | ```diff
diff --git a/Documentation/hwmon/da9052 b/Documentation/hwmon/da9052
index ef898553638e..5bc51346b689 100644
--- a/Documentation/hwmon/da9052
+++ b/Documentation/hwmon/da9052
@@ -56,6 +56,6 @@ The junction temperature is calculated:
The junction temperature attribute is supported by the driver.
The battery ... |
9292f05556becd639a91ae62f2041bf570a8bc2d | Analyze and fix the following issue in the Linux kernel code: hwmon: Update Alexey Fisher's name | Problem Details:
My name was change after migration.
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org> | ```diff
diff --git a/Documentation/hwmon/max1619 b/Documentation/hwmon/max1619
index d6f8d9cd7d7f..e6d87398cc8f 100644
--- a/Documentation/hwmon/max1619
+++ b/Documentation/hwmon/max1619
@@ -9,7 +9,7 @@ Supported chips:
http://pdfserv.maxim-ic.com/en/ds/MAX1619.pdf
Authors:
- Alexey Fisher <fi... |
7110005e8d5c3cd418fc4b64f9f124f004422a9a | Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix missing beep on ASUS X43U notebook | Problem Details:
Signed-off-by: Duncan Roe <duncan_roe@acslink.net.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de> | ```diff
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8568aee56e2d..7bec68c89c5d 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4245,6 +4245,7 @@ static void alc_auto_init_std(struct hda_codec *codec)
((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3... |
7386cdbf2f57ea8cff3c9fde93f206e58b9fe13f | Analyze and fix the following issue in the Linux kernel code: nohz: Fix idle ticks in cpu summary line of /proc/stat | Problem Details:
Git commit 09a1d34f8535ecf9 "nohz: Make idle/iowait counter update
conditional" introduced a bug in regard to cpu hotplug. The effect is
that the number of idle ticks in the cpu summary line in /proc/stat is
still counting ticks for offline cpus.
Reproduction is easy, just start a workload that keeps ... | ```diff
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 64c3b3172367..e296572c73ed 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -45,10 +45,13 @@ static cputime64_t get_iowait_time(int cpu)
static u64 get_idle_time(int cpu)
{
- u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL);
+ u64 idle, idle_time = ... |
dbadc17683e6c673a69b236c0f041b931cc55c42 | Analyze and fix the following issue in the Linux kernel code: X.509: Fix indefinite length element skip error handling | Problem Details:
asn1_find_indefinite_length() returns an error indicator of -1, which the
caller asn1_ber_decoder() places in a size_t (which is usually unsigned) and
then checks to see whether it is less than 0 (which it can't be). This can
lead to the following warning:
lib/asn1_decoder.c:320 asn1_ber_decoder()
... | ```diff
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c
index 2e4196ddf06f..de2c8b5a715b 100644
--- a/lib/asn1_decoder.c
+++ b/lib/asn1_decoder.c
@@ -46,12 +46,18 @@ static const unsigned char asn1_op_lengths[ASN1_OP__NR] = {
/*
* Find the length of an indefinite length object
+ * @data: The data buffer
+ * @... |
cf75446e69305307225e12f2eb2e856db268195e | Analyze and fix the following issue in the Linux kernel code: asymmetric keys: fix printk format warning | Problem Details:
Fix printk format warning in x509_cert_parser.c:
crypto/asymmetric_keys/x509_cert_parser.c: In function 'x509_note_OID':
crypto/asymmetric_keys/x509_cert_parser.c:113:3: warning: format '%zu' expects type 'size_t', but argument 2 has type 'long unsigned int'
Builds cleanly on i386 and x86_64.
Signed... | ```diff
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
index db07e8c9c883..7fabc4c01993 100644
--- a/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -110,7 +110,7 @@ int x509_note_OID(void *context, size_t hdrlen,
if (ctx... |
a5752d11b3853fcdb48b303573dd39b09d05e500 | Analyze and fix the following issue in the Linux kernel code: MODSIGN: Fix 32-bit overflow in X.509 certificate validity date checking | Problem Details:
The current choice of lifetime for the autogenerated X.509 of 100 years,
putting the validTo date in 2112, causes problems on 32-bit systems where a
32-bit time_t wraps in 2106. 64-bit x86_64 systems seem to be unaffected.
This can result in something like:
Loading module verification certificates
... | ```diff
diff --git a/crypto/asymmetric_keys/x509_cert_parser.c b/crypto/asymmetric_keys/x509_cert_parser.c
index 8fcac9493b7a..db07e8c9c883 100644
--- a/crypto/asymmetric_keys/x509_cert_parser.c
+++ b/crypto/asymmetric_keys/x509_cert_parser.c
@@ -434,11 +434,10 @@ int x509_process_extension(void *context, size_t hdrlen... |
48ba2462ace6072741fd8d0058207d630ce93bf1 | Analyze and fix the following issue in the Linux kernel code: MODSIGN: Implement module signature checking | Problem Details:
Check the signature on the module against the keys compiled into the kernel or
available in a hardware key store.
Currently, only RSA keys are supported - though that's easy enough to change,
and the signature is expected to contain raw components (so not a PGP or
PKCS#7 formatted blob).
The signatur... | ```diff
diff --git a/init/Kconfig b/init/Kconfig
index 00d45799dee1..abc6e63f2fb8 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1588,6 +1588,14 @@ config MODULE_SRCVERSION_ALL
config MODULE_SIG
bool "Module signature verification"
depends on MODULES
+ select KEYS
+ select CRYPTO
+ select ASYMMETRIC_KEY_TYPE
+ s... |
5a6ea4af0907f995dc06df21a9c9ef764c7cd3bc | Analyze and fix the following issue in the Linux kernel code: mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions() | Problem Details:
The pointer returned by kzalloc should be tested for NULL
to avoid potential NULL pointer dereference later. Incorrect
pointer was being tested for NULL. Bug introduced by commit fbcf62a3
(mtd: physmap_of: move parse_obsolete_partitions to become separate
parser).
This patch fixes this bug.
Cc: Dmitry... | ```diff
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 64be8f0848b0..d9127e2ed808 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -121,7 +121,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master,
nr_parts = plen / sizeof(part[0]);
*pparts = kzalloc(nr_parts * sizeof(*... |
92063cee118655d25b50d04eb77b012f3287357a | Analyze and fix the following issue in the Linux kernel code: ARM i.MX25: Fix PWM per clock lookups | Problem Details:
They are behind the gate pwm_ipg_per, not directly behind per10.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | ```diff
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 01e2f843bf2e..840fdfac52bc 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -203,13 +203,13 @@ int __init mx25_clocks_init(void)
clk_register_clkdev(clk[cspi2_ipg], NULL, "imx35-cspi.1");
clk_re... |
1f441c435eb6967489860a590d4aa63828cab5e5 | Analyze and fix the following issue in the Linux kernel code: ARM i.MX25 clk: Fix nfc_ipg_per parent | Problem Details:
It's per8, there is no ipg_per clk.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | ```diff
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index 334c839bcf90..01e2f843bf2e 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -128,7 +128,7 @@ int __init mx25_clocks_init(void)
clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0)... |
a4bb8e69b17c59669c9480ee9c2e078b5e8a238e | Analyze and fix the following issue in the Linux kernel code: ARM i.MX25: Fix lcdc_ipg_per parent clock | Problem Details:
It's per7, not per6.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | ```diff
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c
index d20d4795f4ea..334c839bcf90 100644
--- a/arch/arm/mach-imx/clk-imx25.c
+++ b/arch/arm/mach-imx/clk-imx25.c
@@ -127,7 +127,7 @@ int __init mx25_clocks_init(void)
clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_... |
973a6a76dc0b2a032b682ed7705828584bf87427 | Analyze and fix the following issue in the Linux kernel code: ARM: mxc: platform-mxc-mmc: Fix register region size | Problem Details:
Do not hardcode the register region to SZ_4K as this is not correct for mx31.
Use data->iosize instead which works for both mx27 and mx31 cases.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> | ```diff
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
index 540d3a7d92df..e7b920b58675 100644
--- a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
+++ b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c
@@ -55,7 +55,7 @@ struct platform_device *__init imx_add_mxc_mmc(... |
7fd5b1eb822e92ccbdb61325380b1fc429c8c993 | Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Remove AZX_DCAPS_POSFIX_COMBO | Problem Details:
It turned out that the COMBO position fix mode is rather more harmful,
and it got reverted (with the replacement of runtime->delay
calculation) recently. Hence we can get rid of AZX_DCAPS_POSFIX_COMBO
as well.
It's still possible to pass this mode via position_fix module option,
in case where this re... | ```diff
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index f09ff6c14041..6833835a218b 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -554,7 +554,6 @@ enum {
#define AZX_DCAPS_BUFSIZE (1 << 21) /* no buffer size alignment */
#define AZX_DCAPS_ALIGN_BUFSIZE (1 << 22) /* ... |
c5e0b6dbad9b4d18c561af90b384d02373f1c994 | Analyze and fix the following issue in the Linux kernel code: ALSA: hda - Fix memory leaks at error path in patch_cirrus.c | Problem Details:
The proper destructor should be called at the error path.
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de> | ```diff
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index fc92819838a1..f441f53f0306 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1444,7 +1444,7 @@ static int patch_cs420x(struct hda_codec *codec)
return 0;
error:
- kfree(codec->spec);
+ cs_free(cod... |
bc86cf7af2ebda88056538e8edff852ee627f76a | Analyze and fix the following issue in the Linux kernel code: mtd: nand: fix Samsung SLC NAND identification regression | Problem Details:
A combination of the following two commits caused a regression in 3.7-rc1
when identifying some Samsung NAND, so that some previously working NAND
were no longer detected properly:
commit e3b88bd604283ef83ae6e8f53622d5b1ffe9d43a
mtd: nand: add generic READ ID length calculation functions
... | ```diff
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ec6841d8e956..d5ece6ea6f98 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2983,13 +2983,14 @@ static void nand_decode_ext_id(struct mtd_info *mtd, struct nand_chip *chip,
/*
* Field definitions ... |
210ed9defffca13b909f040d7338d8062e5594a3 | Analyze and fix the following issue in the Linux kernel code: mm, slab: release slab_mutex earlier in kmem_cache_destroy() | Problem Details:
Commit 1331e7a1bbe1 ("rcu: Remove _rcu_barrier() dependency on
__stop_machine()") introduced slab_mutex -> cpu_hotplug.lock dependency
through kmem_cache_destroy() -> rcu_barrier() -> _rcu_barrier() ->
get_online_cpus().
Lockdep thinks that this might actually result in ABBA deadlock,
and reports it a... | ```diff
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 9c217255ac49..069a24e64403 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -168,6 +168,7 @@ void kmem_cache_destroy(struct kmem_cache *s)
list_del(&s->list);
if (!__kmem_cache_shutdown(s)) {
+ mutex_unlock(&slab_mutex);
if (s->flags & ... |
06db49e68ae70cf16819b85a14057acb2820776a | Analyze and fix the following issue in the Linux kernel code: ext4: fix metadata checksum calculation for the superblock | Problem Details:
The function ext4_handle_dirty_super() was calculating the superblock
on the wrong block data. As a result, when the superblock is modified
while it is mounted (most commonly, when inodes are added or removed
from the orphan list), the superblock checksum would be wrong. We
didn't notice because the ... | ```diff
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 3ab2539b7b2e..78971cfd9c7f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2063,8 +2063,7 @@ extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
extern int ext4_calculate_overhead(struct super_block *sb);
extern int ext4_super... |
588377d6199034c36d335e7df5818b731fea072c | Analyze and fix the following issue in the Linux kernel code: rbd: reset BACKOFF if unable to re-queue | Problem Details:
If ceph_fault() is unable to queue work after a delay, it sets the
BACKOFF connection flag so con_work() will attempt to do so.
In con_work(), when BACKOFF is set, if queue_delayed_work() doesn't
result in newly-queued work, it simply ignores this condition and
proceeds as if no backoff delay were des... | ```diff
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 159aa8bef9e7..cad0d17ec45e 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2300,10 +2300,11 @@ restart:
mutex_unlock(&con->mutex);
return;
} else {
- con->ops->put(con);
dout("con_work %p FAILED to back off %lu\n", ... |
35c2a7f4908d404c9124c2efc6ada4640ca4d5d5 | Analyze and fix the following issue in the Linux kernel code: tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking | Problem Details:
Fuzzing with trinity oopsed on the 1st instruction of shmem_fh_to_dentry(),
u64 inum = fid->raw[2];
which is unhelpfully reported as at the end of shmem_alloc_inode():
BUG: unable to handle kernel paging request at ffff880061cd3000
IP: [<ffffffff812190d0>] shmem_alloc_inode+0x40/0x40
Oops: 0000 [#1] ... | ```diff
diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index 8e1b60e557b6..02ce90972d81 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -99,7 +99,7 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
* FIXME: we should try harder by querying the mds for the ino.
*/
static struct d... |
aed976475bff939672b0e21595839c445dcec0fa | Analyze and fix the following issue in the Linux kernel code: dup3: Return an error when oldfd == newfd. | Problem Details:
I have tested the attached patch to fix the dup3 regression.
Rich.
From 0944e30e12dec6544b3602626b60ff412375c78f Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Tue, 9 Oct 2012 14:42:45 +0100
Subject: [PATCH] dup3: Return an error when oldfd == newfd.
The following comm... | ```diff
diff --git a/fs/file.c b/fs/file.c
index 0f1bda4bebfa..d3b5fa80b71b 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -922,6 +922,9 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
if ((flags & ~O_CLOEXEC) != 0)
return -EINVAL;
+ if (unlikely(oldfd == newfd))
+ return -EINVAL;
+
... |
36141e5692b42da5b010675b6e68e2292367eb9c | Analyze and fix the following issue in the Linux kernel code: drivers/video/exynos/exynos_mipi_dsi.c: fix error return code | Problem Details:
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != re... | ```diff
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index ef68228cfd70..1f5de896bd3f 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -375,6 +375,7 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
dsim... |
d63f2c532fb8885e481a7b626823a0c183694b53 | Analyze and fix the following issue in the Linux kernel code: drivers/video/savage/savagefb_driver.c: fix error return code | Problem Details:
Convert a nonnegative error return code to a negative one, as returned
elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != re... | ```diff
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c
index 0d0f52c18fd8..f4f53b082d05 100644
--- a/drivers/video/savage/savagefb_driver.c
+++ b/drivers/video/savage/savagefb_driver.c
@@ -2266,8 +2266,10 @@ static int __devinit savagefb_probe(struct pci_dev* dev,
lpitch ... |
b8c4321f3d194469007f5f5f2b34ec278c264a04 | Analyze and fix the following issue in the Linux kernel code: video/udlfb: fix line counting in fb_write | Problem Details:
Line 0 and 1 were both written to line 0 (on the display) and all subsequent
lines had an offset of -1. The result was that the last line on the display
was never overwritten by writes to /dev/fbN.
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
Acked-by: Bernie Thomp... | ```diff
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 8af64148294b..38fcfff3c911 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -647,7 +647,7 @@ static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf,
result = fb_sys_write(info, buf, count, ppos);
if (resu... |
d6d022e7382343b57184c83f5fea0532be240b98 | Analyze and fix the following issue in the Linux kernel code: Revert "[media] omap3isp: Replace cpu_is_omap3630() with ISP revision check" | Problem Details:
Reverted, as requested by Laurent:
I don't consider it as being ready yet, as Sakari pointed out we need
to investigate whether the right fix shouldn't be at the OMAP3 clocks
level instead.
This reverts commit 947c48086623d9ca2207dd0434bd58458af4ba86.
Requested-by: Laurent Pinchart <laurent.pinchart... | ```diff
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c
index 6034dca63404..d7aa513dcc8d 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -1345,7 +1345,10 @@ static int isp_enable_clocks(struct isp_device *isp)
* has to be tw... |
66415f6b50f5bcbc56c78df54aacee73f3d03a3d | Analyze and fix the following issue in the Linux kernel code: ext3: fix return values on parse_options() failure | Problem Details:
parse_options() in ext3 should return 0 when parse the mount options fails.
Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 17ae5c83d234..ebf8312c3a4e 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -1001,7 +1001,7 @@ static int parse_options (char *options, struct super_block *sb,
uid = make_kuid(current_user_ns(), option);
if (!uid_valid(uid)) {
ext3_msg(sb, K... |
ae2cf4284e198684cad8f654923dd8062ee46f88 | Analyze and fix the following issue in the Linux kernel code: ext2: fix return values on parse_options() failure | Problem Details:
parse_options() in ext2 should return 0 when parse the mount options fails.
Signed-off-by: Zhao Hongjiang <zhaohongjiang@huawei.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 6c205d0c565b..fa04d023177e 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -469,7 +469,7 @@ static int parse_options(char *options, struct super_block *sb)
uid = make_kuid(current_user_ns(), option);
if (!uid_valid(uid)) {
ext2_msg(sb, KERN... |
c3d59ad6ab0b3d01c10f326bbc9b089424a3a5c4 | Analyze and fix the following issue in the Linux kernel code: ext3: ext3_bread usage audit | Problem Details:
This is the ext3 version of the same patch applied to Ext4, where such goal is
to audit the usage of ext3_bread() due a possible misinterpretion of its return
value.
Focused on directory blocks, a NULL value returned from ext3_bread() means a
hole, which cannot exist into a directory inode. It can pas... | ```diff
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 7f6c9384ee72..890b8947c546 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -46,8 +46,7 @@ static struct buffer_head *ext3_append(handle_t *handle,
*block = inode->i_size >> inode->i_sb->s_blocksize_bits;
- bh = ext3_bread(handle, inode, *block, 1,... |
aa9660196b250b850c9d06046c9f3b1eb965a708 | Analyze and fix the following issue in the Linux kernel code: ext3: fix possible non-initialized variable on htree_dirblock_to_tree() | Problem Details:
This is a backport of ext4 commit 90b0a9732 which fixes a possible
non-initialized variable on htree_dirblock_to_tree().
Ext3 has the same non initialized variable, but, in any case it will be
initialized by ext3_get_blocks_handle(), which will avoid the bug to be
triggered, but, the non-initialized va... | ```diff
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 8f4fddac01a6..7f6c9384ee72 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -559,7 +559,7 @@ static int htree_dirblock_to_tree(struct file *dir_file,
{
struct buffer_head *bh;
struct ext3_dir_entry_2 *de, *top;
- int err, count = 0;
+ int err = 0, c... |
91312c53aff4c9863dca6080182091dc5c5824c6 | Analyze and fix the following issue in the Linux kernel code: hppfs: fix the return value of get_inode() | Problem Details:
In case of error, the function get_inode() returns ERR_PTR().
But the users hppfs_lookup() and hppfs_fill_super() use NULL
test for check the return value, not IS_ERR(), so we'd better
change the return value of get_inode() to NULL instead of
ERR_PTR().
dpatch engine is used to generated this patch.
(... | ```diff
diff --git a/fs/hppfs/hppfs.c b/fs/hppfs/hppfs.c
index a68cb2092512..78f21f8dc2ec 100644
--- a/fs/hppfs/hppfs.c
+++ b/fs/hppfs/hppfs.c
@@ -674,7 +674,7 @@ static struct inode *get_inode(struct super_block *sb, struct dentry *dentry)
if (!inode) {
dput(dentry);
- return ERR_PTR(-ENOMEM);
+ return NULL;
... |
bfbad32a63fa6287723961f07bcd043dc9c5965c | Analyze and fix the following issue in the Linux kernel code: ARM: pxa: armcore: fix PCI PIO warnings | Problem Details:
The it8152 PCI host used on the pxa/cm_x2xx machines
uses the old-style I/O window registration. This should
eventually get converted to pci_ioremap_io() but for
now, let's cast the IT8152_IO_BASE constant to an integer
type to get rid of the warnings.
Without this patch, building cm_x2xx_defconfig re... | ```diff
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
index c4110d1b1f2d..001f4913799c 100644
--- a/arch/arm/common/it8152.c
+++ b/arch/arm/common/it8152.c
@@ -284,11 +284,17 @@ int dma_set_coherent_mask(struct device *dev, u64 mask)
int __init it8152_pci_setup(int nr, struct pci_sys_data *sys)
{... |
5b3900cd409466c0070b234d941650685ad0c791 | Analyze and fix the following issue in the Linux kernel code: timekeeping: Cast raw_interval to u64 to avoid shift overflow | Problem Details:
We fixed a bunch of integer overflows in timekeeping code during the 3.6
cycle. I did an audit based on that and found this potential overflow.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Link: http://lkml.kernel.org/r/20121009071823.GA19159@elg... | ```diff
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 16280ff3cf82..3eb3fc7c1600 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1045,7 +1045,7 @@ static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,
accumulate_nsecs_to_secs(tk);
/* A... |
26cff4e2aa4d666dc6a120ea34336b5057e3e187 | Analyze and fix the following issue in the Linux kernel code: timers: Fix endless looping between cascade() and internal_add_timer() | Problem Details:
Adding two (or more) timers with large values for "expires" (they have
to reside within tv5 in the same list) leads to endless looping
between cascade() and internal_add_timer() in case CONFIG_BASE_SMALL
is one and jiffies are crossing the value 1 << 18. The bug was
introduced between 2.6.11 and 2.6.12... | ```diff
diff --git a/kernel/timer.c b/kernel/timer.c
index d5de1b2292aa..367d00858482 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -63,6 +63,7 @@ EXPORT_SYMBOL(jiffies_64);
#define TVR_SIZE (1 << TVR_BITS)
#define TVN_MASK (TVN_SIZE - 1)
#define TVR_MASK (TVR_SIZE - 1)
+#define MAX_TVAL ((unsigned long)((1ULL... |
f880b67dcbdedb49453f88d2ccb1a0937b046d82 | Analyze and fix the following issue in the Linux kernel code: ARM: Xen: fix initial build problems | Problem Details:
* The XEN_BALLOON code requires the balloon infrastructure that is not
getting built on ARM.
* The tmem hypercall is not available on ARM
* ARMv6 does not support cmpxchg on 16-bit words that are used in the
Xen grant table code, so we must ensure that Xen support is only
built on ARMv7-only ke... | ```diff
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 6d2f7f5c0036..e1d6ab2b3c93 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1846,6 +1846,7 @@ config XEN_DOM0
config XEN
bool "Xen guest support on ARM (EXPERIMENTAL)"
depends on EXPERIMENTAL && ARM && OF
+ depends on CPU_V7 && !CPU_V6
help
... |
31d2a638a91340d00502d397e558271f516b4f17 | Analyze and fix the following issue in the Linux kernel code: ARM: Fix another build warning in arch/arm/mm/alignment.c | Problem Details:
One such warning was recently fixed in a761cebf "ARM: Fix build warning
in arch/arm/mm/alignment.c" but only for the thumb2 case, this fixes
the other half.
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:327:15: error: 'offset.un' may be used uninitialized in this functio... | ```diff
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index b9f60ebe3bc4..023f443784ec 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -856,8 +856,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
if (thumb2_32b) {
offset.un = 0;
handler = d... |
5175a5e76bbdf20a614fb47ce7a38f0f39e70226 | Analyze and fix the following issue in the Linux kernel code: RDS: fix rds-ping spinlock recursion | Problem Details:
This is the revised patch for fixing rds-ping spinlock recursion
according to Venkat's suggestions.
RDS ping/pong over TCP feature has been broken for years(2.6.39 to
3.6.0) since we have to set TCP cork and call kernel_sendmsg() between
ping/pong which both need to lock "struct sock *sk". However, th... | ```diff
diff --git a/net/rds/send.c b/net/rds/send.c
index 96531d4033a2..88eace57dd6b 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -1122,7 +1122,7 @@ rds_send_pong(struct rds_connection *conn, __be16 dport)
rds_stats_inc(s_send_pong);
if (!test_bit(RDS_LL_SEND_FULL, &conn->c_flags))
- rds_send_xmit(conn);... |
50fb47ae4d812d5eabc57539701dc0fd6404495e | Analyze and fix the following issue in the Linux kernel code: farsync: fix support for over 30 cards | Problem Details:
We're trying to fill a 64 bit bitmap but only the lower 30 shifts work
because the shift wraps around.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net> | ```diff
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 1a623183cbe5..b6271325f803 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -597,7 +597,7 @@ fst_q_work_item(u64 * queue, int card_index)
* bottom half for the card. Note the limitation of 64 cards.
* That o... |
0f796579848f284705cef8c9348f8178b37e1abe | Analyze and fix the following issue in the Linux kernel code: pch_gbe: Fix build error by selecting all the possible dependencies. | Problem Details:
Fengguang reported a kernel build failure as following:
drivers/built-in.o: In function `pch_gbe_ioctl':
pch_gbe_main.c:(.text+0x510370): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x510393): undefined reference to `pch_ch_control_write'
pch_gbe_main.c:(.text+0x5103b3): undefin... | ```diff
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
index 97302419a377..5296cc8d3cba 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig
@@ -26,6 +26,9 @@ if PCH_GBE
config PCH_PTP
bool "PCH PTP ... |
790198f74c9d1b46b6a89504361b1a844670d050 | Analyze and fix the following issue in the Linux kernel code: firewire: cdev: fix user memory corruption (i386 userland on amd64 kernel) | Problem Details:
Fix two bugs of the /dev/fw* character device concerning the
FW_CDEV_IOC_GET_INFO ioctl with nonzero fw_cdev_get_info.bus_reset.
(Practically all /dev/fw* clients issue this ioctl right after opening
the device.)
Both bugs are caused by sizeof(struct fw_cdev_event_bus_reset) being 36
without natural a... | ```diff
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index 2783f69dada6..f8d22872d753 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -473,8 +473,8 @@ static int ioctl_get_info(struct client *client, union ioctl_arg *arg)
client->bus_reset_closure = a->bus_r... |
21c8715f0a1f4df8bfa2bd6f3915e5e33c1c2e6e | Analyze and fix the following issue in the Linux kernel code: ARM: integrator: use __iomem pointers for MMIO, part 2 | Problem Details:
Due to some interesting merges in the integrator code, not
all users of mmio pointers were converted before, this
fixes all warnings that got introduced as a consequence.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <rmk+kernel@arm.linux.or... | ```diff
diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h
index 1a78692e32a4..202e6a57f100 100644
--- a/arch/arm/mach-integrator/include/mach/cm.h
+++ b/arch/arm/mach-integrator/include/mach/cm.h
@@ -3,7 +3,7 @@
*/
void cm_control(u32, u32);
-#define CM_CTRL IO_AD... |
c6e9fbbf4c9aa837c0d39a097f96aaf4f90dfef1 | Analyze and fix the following issue in the Linux kernel code: ARM: assabet: fix bogus warning in get_assabet_scr (again) | Problem Details:
Russell fixed this bogus warning before in 2f3eca8b4f "Shut up gcc
warning in assabet.c", but apparently gcc has become smarter (or dumber)
since 2005, and the same warning came up again.
This uses the uninitialized_var() macro to convince gcc that the
variable is actually being initialized. 100 times... | ```diff
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index e1ccda6128eb..6a7ad3c2a3fc 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -388,7 +388,7 @@ static void __init map_sa1100_gpio_regs( void )
*/
static void __init get_assabet_scr(void)
{
- u... |
6e3a78d9474f54c0b2b5293a561548106243eeaf | Analyze and fix the following issue in the Linux kernel code: ARM: integrator_cp: fix build failure | Problem Details:
arch/arm/mach-integrator/integrator_cp.c:272:32: error: 'of_aliases'
undeclared (first use in this function)
Move the OF-only timer init under #ifdef CONFIG_OF, just like
integrator_ap has it.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net> | ```diff
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 6870a1fbcd78..5b08e8e4cc83 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -261,6 +261,8 @@ static void __init intcp_init_early(void)
#endif
}
+#ifde... |
f60b1b49f6f72abb8bedfd49b758773bbda043c8 | Analyze and fix the following issue in the Linux kernel code: Btrfs: fix page leakage | Problem Details:
Alloc_dummy_extent_buffer will not free the first page in the eb array if we
fail to allocate a page, fix this. Thanks,
Reported-by: David Sterba <dave@jikos.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com> | ```diff
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7dc69b38548d..64dc93f64bc0 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -4104,7 +4104,7 @@ struct extent_buffer *alloc_dummy_extent_buffer(u64 start, unsigned long len)
return eb;
err:
- for (i--; i > 0; i--)
+ for (i--; i >=... |
edd33c99c4ba26ebe17c1a3d65b4aba25482ed32 | Analyze and fix the following issue in the Linux kernel code: Btrfs: don't bug on enomem in readpage | Problem Details:
Get rid of the BUG_ON(ret == -ENOMEM) in __extent_read_full_page. Thanks,
Reported-by: Jérôme Poulin <jeromepoulin@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com> | ```diff
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index b82d244a2ef5..8c37cb64be7a 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2751,12 +2751,15 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
end_bio_extent_readpage, mirror_num,
*bio_flags,
thi... |
15e3004a0eb2c4879bc666d0e6a3acd973fb226c | Analyze and fix the following issue in the Linux kernel code: Btrfs: cleanup pages properly when ENOMEM in compression | Problem Details:
We were freeing non-existent pages which was causing a panic for a user who
was suffering from ENOMEM. This patch fixes the problem. Thanks,
Reported-by: Jérôme Poulin <jeromepoulin@gmail.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com> | ```diff
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 43d1c5a3a030..c6467aa88bee 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -577,6 +577,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
u64 em_start;
struct extent_map *em;
int ret = -ENOMEM;
... |
489406626c42c0176fddae2182d33be2cfb9840c | Analyze and fix the following issue in the Linux kernel code: btrfs: fix message printing | Problem Details:
Fix various messages to include newline and module prefix.
Signed-off-by: Daniel J Blueman <daniel@quora.org> | ```diff
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f8b803f30ed8..0fadcdba8ce4 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -243,7 +243,7 @@ void __btrfs_abort_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root, const char *function,
unsigned int line, int ... |
44734ed1ca0c2e66479cedbf773627a9b5a31364 | Analyze and fix the following issue in the Linux kernel code: Btrfs: don't commit instead of overcommitting | Problem Details:
I don't think we have the same problem that this was supposed to fix
originally since we can allocate chunks in the enospc path now. This code
is causing us to constantly commit the transaction as we get close to using
all of our available space in our currently allocated chunks, instead of
allocating... | ```diff
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index ca4aad96f814..3d3e2c17d8d1 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3907,7 +3907,6 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
int flush_state = FLUSH_DELAYED_ITEMS_NR;
int ret = 0;
bool flushi... |
221b831835421f9451182611fa25fa60f440662f | Analyze and fix the following issue in the Linux kernel code: btrfs: fix min csum item size warnings in 32bit | Problem Details:
commit 7ca4be45a0255ac8f08c05491c6add2dd87dd4f8 limited csum items to
PAGE_CACHE_SIZE. It used min() with incompatible types in 32bit which
generates warnings:
fs/btrfs/file-item.c: In function ‘btrfs_csum_file_blocks’:
fs/btrfs/file-item.c:717: warning: comparison of distinct pointer types lacks a c... | ```diff
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 54f03354bed1..1ad08e4e4a15 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -29,7 +29,8 @@
sizeof(struct btrfs_item) * 2) / \
size) - 1))
-#define MAX_CSUM_ITEMS(r, size) (min(__MAX_CSUM_ITEMS(r, size), PAGE_CACHE_SIZ... |
354aa0fb6d5b97b262e056f7ad7bfc88d7ce0004 | Analyze and fix the following issue in the Linux kernel code: Btrfs: fix orphan transaction on the freezed filesystem | Problem Details:
With the following debug patch:
static int btrfs_freeze(struct super_block *sb)
{
+ struct btrfs_fs_info *fs_info = btrfs_sb(sb);
+ struct btrfs_transaction *trans;
+
+ spin_lock(&fs_info->trans_lock);
+ trans = fs_info->running_transaction;
+ if (trans) {
+ printk("Transid %llu, use_count %d, num... | ```diff
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2c18a4eb4d5a..dcaf55695e6f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1657,9 +1657,10 @@ static int transaction_kthread(void *arg)
spin_unlock(&root->fs_info->trans_lock);
/* If the file system is aborted, this will always fail... |
e8830e606ffee383f073e32313f11fc5692813fe | Analyze and fix the following issue in the Linux kernel code: Btrfs: fix memory leak in start_transaction() | Problem Details:
This patch fixes memory leak of the transaction handle which happened
when starting transaction failed on a freezed fs.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> | ```diff
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 910ff8051ba9..35489644c247 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -351,8 +351,10 @@ again:
*/
if (type != TRANS_JOIN_NOLOCK &&
!__sb_start_write(root->fs_info->sb, SB_FREEZE_FS, false)) {
- if (type == TR... |
450e47da67499aeb6f1700e8f84747460c11ab56 | Analyze and fix the following issue in the Linux kernel code: s390/entry: fix svc number for TIF_SYSCALL system call restart | Problem Details:
The load of the svc number in the TIF_SYSCALL restart path needs to be
done with an instruction that loads all 64 bits of %r1, 'lh' only loads
32 bits. If the upper half of %r1 is not zero and has the msb set,
entry64.S will try to execute an svc with a really large number.
What will be in the upper ha... | ```diff
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 7549985402f7..8f211ad1c695 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -295,7 +295,7 @@ sysc_sigpending:
jno sysc_return
lmg %r2,%r7,__PT_R2(%r11) # load svc arguments
lghi %r8,0 # svc 0 returns -E... |
fc7e48aad35bf98c84cf21aed5c2f100c5ce009b | Analyze and fix the following issue in the Linux kernel code: s390/mm,vmem: fix vmem_add_mem()/vmem_remove_range() | Problem Details:
vmem_add_mem() should only then insert a large page if pmd_none() is true
for the specific entry. We might have a leftover from a previous mapping.
In addition make vmem_remove_range()'s page table walk code more complete
and fix a couple of potential endless loops (which can never happen :).
Signed-o... | ```diff
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index d402b19f1df2..387c7c60b5b8 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -109,8 +109,8 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
pm_dir = pmd_offset(pu_dir, address);
#if defined(CONFIG_64BIT) &&... |
8fe234d3c8d66771b327accb8eef26f70a8a8db8 | Analyze and fix the following issue in the Linux kernel code: s390/mm: fix mapping of read-only kernel text section | Problem Details:
Within the identity mapping the kernel text section is mapped read-only.
However when mapping the first and last page of the text section we must
round upwards and downwards respectively, if only parts of a page belong
to the section.
Otherwise potential rw data can be mapped read-only. So the rounding... | ```diff
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 5b70393911bd..d402b19f1df2 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -331,8 +331,8 @@ void __init vmem_map_init(void)
unsigned long start, end;
int i;
- ro_start = ((unsigned long)&_stext) & PAGE_MASK;
- ro_end = PFN_ALIGN((u... |
e76e82d772522b05ed93228478d2a4460754b6a4 | Analyze and fix the following issue in the Linux kernel code: s390/mm: add page table dumper | Problem Details:
This is more or less the same as the x86 page table dumper which was
merged four years ago: 926e5392 "x86: add code to dump the (kernel)
page tables for visual inspection by kernel developers".
We add a file at /sys/kernel/debug/kernel_page_tables for debugging
purposes so it's quite easy to see the k... | ```diff
diff --git a/arch/s390/Kconfig.debug b/arch/s390/Kconfig.debug
index d76cef3fef37..fc32a2df4974 100644
--- a/arch/s390/Kconfig.debug
+++ b/arch/s390/Kconfig.debug
@@ -31,6 +31,18 @@ config DEBUG_STRICT_USER_COPY_CHECKS
If unsure, or if you run an older (pre 4.4) gcc, say N.
+config S390_PTDUMP
+ bool "E... |
378b1e7a80a59325ca1036e892462db728126f84 | Analyze and fix the following issue in the Linux kernel code: s390/mm: fix pmd_huge() usage for kernel mapping | Problem Details:
pmd_huge() will always return 0 on !HUGETLBFS, however we use that helper
function when walking the kernel page tables to decide if we have a
1MB page frame or not.
Since we create 1MB frames for the kernel 1:1 mapping independently of
HUGETLBFS this can lead to incorrect storage accesses since the cod... | ```diff
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 979fe3dc0788..75b91bb772bd 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -507,6 +507,15 @@ static inline int pmd_none(pmd_t pmd)
return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL;
}
... |
547b1e81afe3119f7daf702cc03b158495535a25 | Analyze and fix the following issue in the Linux kernel code: Fix staging driver use of VM_RESERVED | Problem Details:
The VM_RESERVED flag was killed off in commit 314e51b9851b ("mm: kill
vma flag VM_RESERVED and mm->reserved_vm counter"), and replaced by the
proper semantic flags (eg "don't core-dump" etc). But there was a new
use of VM_RESERVED that got missed by the merge.
Fix the remaining use of VM_RESERVED in ... | ```diff
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 6968b7232232..6d369fe9d30b 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -461,7 +461,7 @@ static int vfio_pci_mmap(void *device_data, struct vm_area_struct *vma)
}
vma->vm_private_data = vdev;
- vm... |
f24b5cb818c6789e5d42d4881f34238a5fa0b40c | Analyze and fix the following issue in the Linux kernel code: [SCSI] qla2xxx: fix potential deadlock on ha->hardware_lock | Problem Details:
Lockdep reports:
=== [ cut here ] ===
=========================================================
[ INFO: possible irq lock inversion dependency detected ]
3.6.0-0.0.0.28.36b5ec9-default #1 Not tainted
---------------------------------------------------------
qla2xxx_1_dpc/368 just changed the stat... | ```diff
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 799a58bb9859..48fca47384b7 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2080,6 +2080,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
uint8_t domain;
char connect_type[22];
... |
bc977749e967daa56de1922cf4cb38525631c51c | Analyze and fix the following issue in the Linux kernel code: [SCSI] scsi_debug: Fix off-by-one bug when unmapping region | Problem Details:
Currently it is possible to unmap one more block than user requested to
due to the off-by-one error in unmap_region(). This is probably due to
the fact that the end variable despite its name actually points to the
last block to unmap + 1. However in the condition it is handled as the
last block of the ... | ```diff
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 57fbd5a3d4e2..5cda11c07c68 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -2055,7 +2055,7 @@ static void unmap_region(sector_t lba, unsigned int len)
block = lba + alignment;
rem = do_div(block, granularity... |
846a136881b8f73c1f74250bf6acfaa309cab1f2 | Analyze and fix the following issue in the Linux kernel code: ARM: vfp: fix saving d16-d31 vfp registers on v6+ kernels | Problem Details:
Michael Olbrich reported that his test program fails when built with
-O2 -mcpu=cortex-a8 -mfpu=neon, and a kernel which supports v6 and v7
CPUs:
volatile int x = 2;
volatile int64_t y = 2;
int main() {
volatile int a = 0;
volatile int64_t b = 0;
while (1) {
a = (a + x) % (1 << 30);
b = (b + y)... | ```diff
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
index a7aadbd9a6dd..6a6f1e485f41 100644
--- a/arch/arm/include/asm/vfpmacros.h
+++ b/arch/arm/include/asm/vfpmacros.h
@@ -28,7 +28,7 @@
ldr \tmp, =elf_hwcap @ may not have MVFR regs
ldr \tmp, [\tmp, #0]
tst \tmp, #HWCAP_... |
2a552d5e63d7fa602c9a9a0717008737f55625a6 | Analyze and fix the following issue in the Linux kernel code: ARM: 7549/1: HYP: fix boot on some ARM1136 cores | Problem Details:
It appears that performing a "movs pc, lr" to force the kernel into
SVC mode on the OMAP2420 (ARM1136) prevents the platform from booting
correctly (change introduced in 80c59da [ARM: virt: allow the kernel
to be entered in HYP mode]).
While the reason it fails is not understood yet (the same code run... | ```diff
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 683a1e6b6020..2ef95813fce0 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -254,16 +254,17 @@
mov lr , \reg
and lr , lr , #MODE_MASK
cmp lr , #HYP_MODE
- orr \reg , \reg , #PSR_A_... |
329a402cb052b233bc92aa34c4caf2f7dfb2d76e | Analyze and fix the following issue in the Linux kernel code: [SCSI] Shorten the path length of scsi_cmd_to_driver() | Problem Details:
This patch tries to shorten the path length of scsi_cmd_to_driver(). As only
REQ_TYPE_BLOCK_PC commands can be submitted without a driver, so we could
avoid the related NULL checking, as long as we make sure we don't use it for
REQ_TYPE_BLOCK_PC type commands. Plus, this fixes a bug where you get
diffe... | ```diff
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index de2337f255a7..c1b05a83d403 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -789,7 +789,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
int cmnd_size, int timeout, unsigned s... |
9da5f5ac6affad8dd8cd80f5cca26e4335e1728b | Analyze and fix the following issue in the Linux kernel code: [SCSI] virtio-scsi: fix LUNs greater than 255 | Problem Details:
virtio-scsi needs to report LUNs greater than 256 using the "flat"
format. Because the Linux SCSI layer just maps the SCSI LUN to
an u32, without any parsing, these end up in the range from 16640
to 32767. Fix max_lun to account for the possibility that logical
unit numbers are encoded with the "flat... | ```diff
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 7554d7856434..a7cf726bc747 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -677,7 +677,11 @@ static int __devinit virtscsi_probe(struct virtio_device *vdev)
cmd_per_lun = virtscsi_config_get(vdev, cmd_per_lu... |
23d3a86948b65055345dc1fe778513e4bf3b07d6 | Analyze and fix the following issue in the Linux kernel code: Bluetooth: don't attempt to free a channel that wasn't created | Problem Details:
We may currently attempt to free a channel which wasn't created due to
an error in the initialization path, this would cause a NULL ptr deref.
This would cause the following oops:
[ 12.919073] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
[ 12.919131] IP: [<ffffffff836... | ```diff
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index a71c4089d175..af467ce2cf2b 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1083,7 +1083,8 @@ static void l2cap_sock_destruct(struct sock *sk)
{
BT_DBG("sk %p", sk);
- l2cap_chan_put(l2cap_pi(sk)->chan);
... |
d760afd4d2570653891f94e13b848e97150dc5a6 | Analyze and fix the following issue in the Linux kernel code: memory-hotplug: suppress "Trying to free nonexistent resource <XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY>" warning | Problem Details:
When our x86 box calls __remove_pages(), release_mem_region() shows many
warnings. And x86 box cannot unregister iomem_resource.
"Trying to free nonexistent resource <XXXXXXXXXXXXXXXX-YYYYYYYYYYYYYYYY>"
release_mem_region() has been changed to be called in each
PAGES_PER_SECTION by commit de7f0cba... | ```diff
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 11d8e0544ac0..dc0a035e63bb 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -77,7 +77,8 @@ static int pseries_remove_memblock(... |
587af308cc30ec6b94bde9aeb322e85fe4363e32 | Analyze and fix the following issue in the Linux kernel code: mm: memcg: clean up mm_match_cgroup() signature | Problem Details:
It really should return a boolean for match/no match. And since it takes
a memcg, not a cgroup, fix that parameter name as well.
[akpm@linux-foundation.org: mm_match_cgroup() is not a macro]
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: And... | ```diff
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 8d9489fdab2e..fd0e6d53836e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -84,14 +84,14 @@ extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg);
extern struct mem_cgroup *mem_cgroup_from_con... |
8449d21fb49e9824e2736c5febd6b5d287cd2ba1 | Analyze and fix the following issue in the Linux kernel code: mm, thp: fix mlock statistics | Problem Details:
NR_MLOCK is only accounted in single page units: there's no logic to
handle transparent hugepages. This patch checks the appropriate number of
pages to adjust the statistics by so that the correct amount of memory is
reflected.
Currently:
$ grep Mlocked /proc/meminfo
Mlocked: 19636 kB
... | ```diff
diff --git a/mm/internal.h b/mm/internal.h
index f5f295fe11e1..a4fa284f6bc2 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -180,7 +180,8 @@ static inline int mlocked_vma_newpage(struct vm_area_struct *vma,
return 0;
if (!TestSetPageMlocked(page)) {
- inc_zone_page_state(page, NR_MLOCK);
+ mod_zone_p... |
b676b293fb48672904ee1b9828cb50b4eed01717 | Analyze and fix the following issue in the Linux kernel code: mm, thp: fix mapped pages avoiding unevictable list on mlock | Problem Details:
When a transparent hugepage is mapped and it is included in an mlock()
range, follow_page() incorrectly avoids setting the page's mlock bit and
moving it to the unevictable lru.
This is evident if you try to mlock(), munlock(), and then mlock() a
range again. Currently:
#define MAP_SIZE (4 << 30) /... | ```diff
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 6ab47af5a849..b31cb7da0346 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -11,7 +11,7 @@ extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
extern int do_huge_pmd_wp_page(struct mm_struct *mm, ... |
7a71932d5676b7410ab64d149bad8bde6b0d8632 | Analyze and fix the following issue in the Linux kernel code: kpageflags: fix wrong KPF_THP on non-huge compound pages | Problem Details:
KPF_THP can be set on non-huge compound pages (like slab pages or pages
allocated by drivers with __GFP_COMP) because PageTransCompound only
checks PG_head and PG_tail. Obviously this is a bug and breaks user space
applications which look for thp via /proc/kpageflags.
This patch rules out setting KPF... | ```diff
diff --git a/fs/proc/page.c b/fs/proc/page.c
index 7fcd0d60a968..b8730d9ebaee 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -115,7 +115,13 @@ u64 stable_page_flags(struct page *page)
u |= 1 << KPF_COMPOUND_TAIL;
if (PageHuge(page))
u |= 1 << KPF_HUGE;
- else if (PageTransCompound(page))
+ /*
+ * ... |
c462f179e4d273f0da0e7cf302e29b0edf43844e | Analyze and fix the following issue in the Linux kernel code: mm/memory.c: fix typo in comment | Problem Details:
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/mm/memory.c b/mm/memory.c
index 01ec048ece8b..45bb6d296b6f 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2148,7 +2148,7 @@ out:
* @addr: target user address of this page
* @pfn: source kernel pfn
*
- * Similar to vm_inert_page, this allows drivers to insert individual pages
+ * Similar to vm... |
5a883813845a2bb5ed2bd8c9240736c0740b156f | Analyze and fix the following issue in the Linux kernel code: memory-hotplug: fix zone stat mismatch | Problem Details:
During memory-hotplug, I found NR_ISOLATED_[ANON|FILE] are increasing,
causing the kernel to hang. When the system doesn't have enough free
pages, it enters reclaim but never reclaim any pages due to
too_many_isolated()==true and loops forever.
The cause is that when we do memory-hotadd after memory-... | ```diff
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index a5bb15018b5c..92a86b2cce33 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -198,6 +198,8 @@ extern void __dec_zone_state(struct zone *, enum zone_stat_item);
void refresh_cpu_vm_stats(int);
void refresh_zone_stat_thresholds... |
36e4f20af833d1ce196e6a4ade05dc26c44652d1 | Analyze and fix the following issue in the Linux kernel code: hugetlb: do not use vma_hugecache_offset() for vma_prio_tree_foreach | Problem Details:
Commit 0c176d52b0b2 ("mm: hugetlb: fix pgoff computation when unmapping
page from vma") fixed pgoff calculation but it has replaced it by
vma_hugecache_offset() which is not approapriate for offsets used for
vma_prio_tree_foreach() because that one expects index in page units
rather than in huge_page_s... | ```diff
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 8536741f069b..de5d1dcf34fe 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2480,7 +2480,8 @@ static int unmap_ref_private(struct mm_struct *mm, struct vm_area_struct *vma,
* from page cache lookup which is in HPAGE_SIZE units.
*/
address = address & huge_p... |
027ef6c87853b0a9df53175063028edb4950d476 | Analyze and fix the following issue in the Linux kernel code: mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP | Problem Details:
In many places !pmd_present has been converted to pmd_none. For pmds
that's equivalent and pmd_none is quicker so using pmd_none is better.
However (unless we delete pmd_present) we should provide an accurate
pmd_present too. This will avoid the risk of code thinking the pmd is non
present because i... | ```diff
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index fc9948465293..a1f780d45f76 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -146,8 +146,7 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
static inline int pmd_large(pmd_t pte)
{
- return ... |
957f822a0ab95e88b146638bad6209bbc315bedd | Analyze and fix the following issue in the Linux kernel code: mm, numa: reclaim from all nodes within reclaim distance | Problem Details:
RECLAIM_DISTANCE represents the distance between nodes at which it is
deemed too costly to allocate from; it's preferred to try to reclaim from
a local zone before falling back to allocating on a remote node with such
a distance.
To do this, zone_reclaim_mode is set if the distance between any two
nod... | ```diff
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d240efa8f846..a5578871d033 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -709,6 +709,7 @@ typedef struct pglist_data {
unsigned long node_spanned_pages; /* total size of physical page
range, including holes */
... |
a0c5e813f087dffc0d9b173d2e7d3328b1482fd5 | Analyze and fix the following issue in the Linux kernel code: mm: remove free_page_mlock | Problem Details:
We should not be seeing non-0 unevictable_pgs_mlockfreed any longer. So
remove free_page_mlock() from the page freeing paths: __PG_MLOCKED is
already in PAGE_FLAGS_CHECK_AT_FREE, so free_pages_check() will now be
checking it, reporting "BUG: Bad page state" if it's ever found set.
Comment UNEVICTABLE_... | ```diff
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 57f7b1091511..ede4ddd46695 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -52,7 +52,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
UNEVICTABLE_PGMUNLOCKED,
UNEVICTABLE_PGCLEARED... |
ec4d9f626d5908b6052c2973f37992f1db52e967 | Analyze and fix the following issue in the Linux kernel code: mm: fix invalidate_complete_page2() lock ordering | Problem Details:
In fuzzing with trinity, lockdep protested "possible irq lock inversion
dependency detected" when isolate_lru_page() reenabled interrupts while
still holding the supposedly irq-safe tree_lock:
invalidate_inode_pages2
invalidate_complete_page2
spin_lock_irq(&mapping->tree_lock)
clear_page_mlo... | ```diff
diff --git a/mm/truncate.c b/mm/truncate.c
index 75801acdaac7..f38055cb8af6 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -394,11 +394,12 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page)
if (page_has_private(page) && !try_to_release_page(page, GFP_KERNEL))
return 0;
+ cl... |
1939c557b5c3c0e800328e3589ae3d27fdfea29e | Analyze and fix the following issue in the Linux kernel code: memcg: trivial fixes for Documentation/cgroups/memory.txt | Problem Details:
While reading through Documentation/cgroups/memory.txt, I found a number
of minor wordos and typos. The patch below is a conservative handling of
some of these: it provides just a number of "obviously correct" fixes to
the English that improve the readability of the document somewhat.
Obviously some m... | ```diff
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt
index 4372e6b8a353..c07f7b4fb88d 100644
--- a/Documentation/cgroups/memory.txt
+++ b/Documentation/cgroups/memory.txt
@@ -18,16 +18,16 @@ from the rest of the system. The article on LWN [12] mentions some probable
uses of the memo... |
7f1290f2f2a4d2c3f1b7ce8e87256e052ca23125 | Analyze and fix the following issue in the Linux kernel code: mm: fix-up zone present pages | Problem Details:
I think zone->present_pages indicates pages that buddy system can management,
it should be:
zone->present_pages = spanned pages - absent pages - bootmem pages,
but is now:
zone->present_pages = spanned pages - absent pages - memmap pages.
spanned pages: total size, including holes.
absent pages: h... | ```diff
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 082e383c1b6f..acd5b68e8871 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -637,6 +637,7 @@ mem_init (void)
high_memory = __va(max_low_pfn * PAGE_SIZE);
+ reset_zone_present_pages();
for_each_online_pgdat(pgdat)
if (pgdat->bda... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.