id stringlengths 40 40 | instruction stringlengths 68 308 | input stringlengths 17 33.4k | output stringlengths 100 30k |
|---|---|---|---|
b31d42a5af1818bdf31a5f023abe4d8b212542f2 | Analyze and fix the following issue in the Linux kernel code: Fix compile brekage with !CONFIG_BLOCK | Problem Details:
Today's git tree fails to build on !CONFIG_BLOCK, due to upstream commit
367a51a33902 ("fs: Add FITRIM ioctl"):
include/linux/fs.h:36: error: expected specifier-qualifier-list before ‘uint64_t’
include/linux/fs.h:36: error: expected specifier-qualifier-list before ‘uint64_t’
include/linux/fs.h:36: ... | ```diff
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6ed7ace74b7c..1c73b50e81ff 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
#include <linux/limits.h>
#include <linux/ioctl.h>
#include <linux/blk_types.h>
+#include <linux/types.h>
/*
* It's silly to have NR_OPEN bigger ... |
7c7298cffc8f4417c95117c2a432f962c066499d | Analyze and fix the following issue in the Linux kernel code: fs/9p: mkdir fix for setting S_ISGID bit as per parent directory | Problem Details:
The current implementation of 9p client mkdir function does not
set the S_ISGID mode bit for the directory being created if the
parent directory has this bit set. This patch fixes this problem
so that the newly created directory inherits the gid from parent
directory and not from the process creating t... | ```diff
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index 88efc161743b..c3d200d41dca 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -876,6 +876,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, struct dentry *dentry,
v9ses = v9fs_inode2v9ses(dir);
mode |= S_IFDIR;
+ if (dir->i_mode & S_ISGI... |
3834b12a18d51d6c535ea52e16355d75806ffe38 | Analyze and fix the following issue in the Linux kernel code: fs/9p: setrlimit fix for 9p write | Problem Details:
Current 9p client file write code does not check for RLIMIT_FSIZE resource.
This bug was found by running LTP test case for setrlimit. This bug is fixed
by calling generic_write_checks before sending the write request to the
server.
Without this patch: the write function is allowed to write above the
R... | ```diff
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index e97c92bd6f16..89c44e92022c 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -219,7 +219,9 @@ static ssize_t
v9fs_file_write(struct file *filp, const char __user * data,
size_t count, loff_t * offset)
{
- int n, rsize, total = 0;
+ ssize_t retval... |
91bad2f8d3057482b9afb599f14421b007136960 | Analyze and fix the following issue in the Linux kernel code: jump label: Fix deadlock b/w jump_label_mutex vs. text_mutex | Problem Details:
register_kprobe() downs the 'text_mutex' and then calls
jump_label_text_reserved(), which downs the 'jump_label_mutex'.
However, the jump label code takes those mutexes in the reverse
order.
Fix by requiring the caller of jump_label_text_reserved() to do
the jump label locking via the newly added: jum... | ```diff
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index b67cb180e6e9..1947a1212678 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -18,6 +18,8 @@ struct module;
extern struct jump_entry __start___jump_table[];
extern struct jump_entry __stop___jump_table[];
+ex... |
b842f8faf6c7dc2005c6a70631c1a91bac02f180 | Analyze and fix the following issue in the Linux kernel code: jump label: Fix module __init section race | Problem Details:
Jump label uses is_module_text_address() to ensure that the module
__init sections are valid before updating them. However, between the
check for a valid module __init section and the subsequent jump
label update, the module's __init section could be freed out from under
us.
We fix this potential race... | ```diff
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 7be868bf25c6..be9e105345eb 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -168,7 +168,8 @@ void jump_label_update(unsigned long key, enum jump_label_type type)
count = e_module->nr_entries;
iter = e_module->table;
while (cou... |
4e54d93d3c9846ba1c2644ad06463dafa690d1b7 | Analyze and fix the following issue in the Linux kernel code: ARM: 6464/2: fix spinlock recursion in adjust_pte() | Problem Details:
When running following code in a machine which has VIVT caches and
USE_SPLIT_PTLOCKS is not defined:
fd = open("/etc/passwd", O_RDONLY);
addr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0);
addr2 = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0);
v = *((int *)addr);
we will hang in spinlock... | ```diff
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index c493d7244d3d..83e59f870426 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -66,6 +66,30 @@ static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address,
return ret;
}
+#if USE_SPLIT_PTLOCKS
+/*
+ * ... |
7ab5118d7c2be650bc936894f159dc1c597badae | Analyze and fix the following issue in the Linux kernel code: block: cciss: fix information leak to userland | Problem Details:
Structure IOCTL_Command_struct is copied to userland with
some padding fields at the end of the struct unitialized.
It leads to leaking of contents of kernel stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com> | ```diff
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index f09e6df15aa7..13d87a031c88 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1184,6 +1184,7 @@ static int cciss_ioctl32_big_passthru(struct block_device *bdev, fmode_t mode,
int err;
u32 cp;
+ memset(&arg64, 0, sizeof(arg64)... |
027b180d7405f2b2df25e2a8b1b796b00f3773cf | Analyze and fix the following issue in the Linux kernel code: drivers/block/aoe/aoeblk.c: ratelimit a warning printk | Problem Details:
As described in https://bugzilla.kernel.org/show_bug.cgi?id=19922
: I had an AoE device go down overnight, and while a server was trying to
: write to it, it was also writing this message to its logs:
:
: 209 printk(KERN_INFO "aoe: device %ld.%d is not up\n",
: 210 ... | ```diff
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index f21c237a9e5e..541e18879965 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -4,12 +4,14 @@
* block device routines
*/
+#include <linux/kernel.h>
#include <linux/hdreg.h>
#include <linux/blkdev.h>
#incl... |
2027ae1fa914640c287171035cb607a03ad36e95 | Analyze and fix the following issue in the Linux kernel code: drivers/block/drbd/drbd_main.c: fix error path | Problem Details:
Failure to create drbd_ee_mempool appears not to get checked. Looks like
a copy-and-paste problem to me.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.... | ```diff
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index c5dfe6486cf3..25c7a73c5062 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2982,7 +2982,7 @@ static int drbd_create_mempools(void)
drbd_ee_mempool = mempool_create(number,
mempool_alloc... |
c7213fc4ed592070f1010da39b0bf0eb2395b619 | Analyze and fix the following issue in the Linux kernel code: CRIS: Fix RS485 delay handling. | Problem Details:
Very recently, the RS485 interface has been fixed by adding two further
fields (see commit 1b6331848b69d1ed165a6bdc75c4046d68767563).
Check the value of the flag SER_RS485_RTS_BEFORE_SEND before delaying.
Signed-off-by: Claudio Scordino <claudio@evidence.eu.com>
Signed-off-by: Jesper Nilsson <jesper.... | ```diff
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 20402c604c10..fa62578fcd20 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -1411,11 +1411,12 @@ e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r)
CONFIG_ETRAX_RS485_LTC1387_RXEN_PORT_G_BIT, 1... |
4600d7c493f354a3e338a35bcf8a3bfbe815776a | Analyze and fix the following issue in the Linux kernel code: genirq: Fix up irq_node() for irq_data changes. | Problem Details:
Now that the node ID is tracked in the irq_data structure, update the
irq_node() definition accordingly. This fixes up irq_node() usage under
GENERIC_HARDIRQS_NO_DEPRECATED && SMP.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
LKML-Reference: <20101028023031.GB10365@linux-sh.org>
Signed-off-by: Thom... | ```diff
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 05aa8c23483f..3bc4dcab6e82 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -43,7 +43,7 @@ unsigned int irq_get_next_irq(unsigned int offset);
else
#ifdef CONFIG_SMP
-#define irq_node(irq) (irq_to_desc(irq)->node)
+#define i... |
23886839a752401aba66517bff8a8b91549279ce | Analyze and fix the following issue in the Linux kernel code: power_supply: Mark twl4030_charger as broken | Problem Details:
The driver is not buildable without MFD changes. For now, let's
disable the driver as it breaks build for major platforms (i.e. x86).
CC [M] drivers/power/twl4030_charger.o
drivers/power/twl4030_charger.c: In function 'twl4030_clear_set_boot_bci':
drivers/power/twl4030_charger.c:105: error: 'TWL403... | ```diff
diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 60d83d983a36..ec444774b9ee 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -182,6 +182,7 @@ config CHARGER_ISP1704
config CHARGER_TWL4030
tristate "OMAP TWL4030 BCI charger driver"
depends on TWL4030_CORE
+ depends on BROKEN... |
a167f663243662aa9153c01086580a11cde9ffdc | Analyze and fix the following issue in the Linux kernel code: md: use separate bio pool for each md device. | Problem Details:
bio_clone and bio_alloc allocate from a common bio pool.
If an md device is stacked with other devices that use this pool, or under
something like swap which uses the pool, then the multiple calls on
the pool can cause deadlocks.
So allocate a local bio pool for each md array and use that rather
than ... | ```diff
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index 1a8987884614..339fdc670751 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -210,7 +210,7 @@ static int make_request(mddev_t *mddev, struct bio *bio)
}
}
if (failit) {
- struct bio *b = bio_clone(bio, GFP_NOIO);
+ struct bio *b =... |
1c4588e9c19cae6209a28c9da2f16a18a610b935 | Analyze and fix the following issue in the Linux kernel code: md/raid1: perform mem allocation before disabling writes during resync. | Problem Details:
Though this mem alloc is GFP_NOIO an so will not deadlock, it seems
better to do the allocation before 'raise_barrier' which stops any IO
requests while the resync proceeds.
raid10 always uses this order, so it is at least consistent to do the
same in raid1.
Signed-off-by: NeilBrown <neilb@suse.de> | ```diff
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 40f58d3b67ff..6cb6cae1b386 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1749,11 +1749,11 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
msleep_interruptible(1000);
bitmap_cond_end_sync(mddev->b... |
4e78064f42ad474ce9c31760861f7fb0cfc22532 | Analyze and fix the following issue in the Linux kernel code: md: Fix possible deadlock with multiple mempool allocations. | Problem Details:
It is not safe to allocate from a mempool while holding an item
previously allocated from that mempool as that can deadlock when the
mempool is close to exhaustion.
So don't use a bio list to collect the bios to write to multiple
devices in raid1 and raid10.
Instead queue each bio as it becomes availa... | ```diff
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index a4b85a947532..3362cfc8073c 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -306,6 +306,28 @@ static void raid1_end_read_request(struct bio *bio, int error)
rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev);
}
+static void r1_bio... |
e804ac780e2f01cb3b914daca2fd4780d1743db1 | Analyze and fix the following issue in the Linux kernel code: md: fix and update workqueue usage | Problem Details:
Workqueue usage in md has two problems.
* Flush can be used during or depended upon by memory reclaim, but md
uses the system workqueue for flush_work which may lead to deadlock.
* md depends on flush_scheduled_work() to achieve exclusion against
completion of removal of previous instances. flus... | ```diff
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2399168b6315..0b6fa2a1882a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -67,6 +67,8 @@ static DEFINE_SPINLOCK(pers_lock);
static void md_print_devices(void);
static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
+static struct workqueue_struct *md_wq;
+st... |
d97a41dc9c44f5829b7af7aa69fda10fd82b6b4e | Analyze and fix the following issue in the Linux kernel code: md: Fix regression with raid1 arrays without persistent metadata. | Problem Details:
A RAID1 which has no persistent metadata, whether internal or
external, will hang on the first write.
This is caused by commit 070dc6dd7103b6b3f7e4d46e754354a5c15f366e
In that case, MD_CHANGE_PENDING never gets cleared.
So during md_update_sb, is neither persistent or external,
clear MD_CHANGE_PENDIN... | ```diff
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 225815197a3d..64f97168cefa 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2108,6 +2108,8 @@ repeat:
if (!mddev->persistent) {
clear_bit(MD_CHANGE_CLEAN, &mddev->flags);
clear_bit(MD_CHANGE_DEVS, &mddev->flags);
+ if (!mddev->external)
+ cle... |
c1758012971e0410790b2bc96a77e26d7b286593 | Analyze and fix the following issue in the Linux kernel code: igb: Fix unused variable warning. | Problem Details:
Commit eab6d18d "vlan: Don't check for vlan group before
vlan_tx_tag_present" removed the need for the adapter variable
in igb_xmit_frame_ring_adv(). This removes the variable as well
to avoid the compiler warning.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jesse Gross <jesse... | ```diff
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 14db09e2fa8b..892d196f17ac 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -4107,7 +4107,6 @@ static inline int igb_maybe_stop_tx(struct igb_ring *tx_ring, int size)
netdev_tx_t igb_xmit_frame_ring_adv(struct... |
fb41a49d96cd0fb6c63362ff1c8de22e9e7399af | Analyze and fix the following issue in the Linux kernel code: sh: fix up cpu hotplug IRQ migration for irq_data changes. | Problem Details:
This fixes up the __cpu_disable() path's IRQ migration for the
irq_data changes.
Signed-off-by: Paul Mundt <lethal@linux-sh.org> | ```diff
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c
index 995301afa36d..68ecbe6c881a 100644
--- a/arch/sh/kernel/irq.c
+++ b/arch/sh/kernel/irq.c
@@ -296,13 +296,16 @@ int __init arch_probe_nr_irqs(void)
#endif
#ifdef CONFIG_HOTPLUG_CPU
-static void route_irq(struct irq_desc *desc, unsigned int irq, un... |
beed5ecbaa377fa8bb6a54a6608e8725a21efdbc | Analyze and fix the following issue in the Linux kernel code: ext4: fix unbalanced mutex unlock in error path of ext4_li_request_new | Problem Details:
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ```diff
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 158d1bca8769..3b4984d37a68 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2902,28 +2902,26 @@ static int ext4_register_li_request(struct super_block *sb,
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_li_request *elr;
ext4_group_t ngroups =... |
51a0bb0c2e614659132fce272c8a1815a12c5c2a | Analyze and fix the following issue in the Linux kernel code: loop: Properly clear sysfs in autoclear mode | Problem Details:
In autoclear mode bdev is NULL but the sysfs
entry should be destroyed otherwise this warning appears:
WARNING: at fs/sysfs/dir.c:451 sysfs_add_one+0x82/0x95()
sysfs: cannot create duplicate filename '/devices/virtual/block/loop0/loop'
Fixes commit ee86273062cbb310665fe49e1f1937d2cf85b0b9
Signed-off... | ```diff
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 450c958b514f..1e5284ef65fa 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1049,9 +1049,9 @@ static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev)
if (bdev)
invalidate_bdev(bdev);
set_capacity(lo->lo_disk,... |
a6371b636f9f007ee5c90f85de048bc1b675424a | Analyze and fix the following issue in the Linux kernel code: ext4: fix compile error in ext4_fallocate() | Problem Details:
When I compiled 2.6.36-rc3 kernel with EXT4FS_DEBUG definition, I got
the following compile error.
CC [M] fs/ext4/extents.o
fs/ext4/extents.c: In function 'ext4_fallocate':
fs/ext4/extents.c:3772: error: 'block' undeclared (first use in this function)
fs/ext4/extents.c:3772: error: (Each undeclared... | ```diff
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 20e6c3c65fa1..a17a676a3106 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3668,7 +3668,7 @@ retry:
printk(KERN_ERR "%s: ext4_ext_map_blocks "
"returned error inode#%lu, block=%u, "
"max_blocks=%u", __func__,
- inod... |
61d08673de1fe68bfba86203258377bf39f234b6 | Analyze and fix the following issue in the Linux kernel code: ext4: rename mark_bitmap_end() to ext4_mark_bitmap_end() | Problem Details:
Fix a namespace leak from fs/ext4
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ```diff
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index a12cefc20c76..14c3af26c671 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -171,7 +171,8 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
* less than the blocksize * 8 ( which is the size
* of bitmap ), set ... |
4a873a472b3bbcfd425d7ae210afdec28c04e2e5 | Analyze and fix the following issue in the Linux kernel code: ext4: move flush_completed_IO to fs/ext4/fsync.c and make it static | Problem Details:
Fix a namespace leak by moving the function to the file where it is
used and making it static.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ```diff
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ac1afc148b36..c0570a68a2bc 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1721,7 +1721,6 @@ extern int ext4_block_truncate_page(handle_t *handle,
struct address_space *mapping, loff_t from);
extern int ext4_page_mkwrite(struct vm_area_struct *vma, str... |
7f93cff90fa9be6ed45f6189e136153d1d8631b0 | Analyze and fix the following issue in the Linux kernel code: ext4: fix kernel oops if the journal superblock has a non-zero j_errno | Problem Details:
Commit 84061e0 fixed an accounting bug only to introduce the
possibility of a kernel OOPS if the journal has a non-zero j_errno
field indicating that the file system had detected a fs inconsistency.
After the journal replay, if the journal superblock indicates that the
file system has an error, this in... | ```diff
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 9ce3b67b7269..c9e06c647ce8 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3964,9 +3964,12 @@ static int ext4_commit_super(struct super_block *sb, int sync)
else
es->s_kbytes_written =
cpu_to_le64(EXT4_SB(sb)->s_kbytes_written);
- ext4_free_bl... |
bbd08344e3df8c7c1d7aa04bc0c8c9367806e12d | Analyze and fix the following issue in the Linux kernel code: ext4: tidy up a void argument in inode.c | Problem Details:
This doesn't fix anything at all, it just removes a vestige
of prior use from __mpage_da_writepage()
__mpage_da_writepage() had a *void argument leftover from
its previous life as a callback; make it reflect the actual type.
Fixing this up makes it slightly more obvious to read, and
enables proper t... | ```diff
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 077c3c9c432e..6671fcbb5293 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2424,9 +2424,9 @@ static int ext4_bh_delay_or_unwritten(handle_t *handle, struct buffer_head *bh)
* The function finds extents of pages and scan them for all blocks.
*/
sta... |
4d5476164a052e80d4ef430e368e76dbde96801f | Analyze and fix the following issue in the Linux kernel code: ext4: fix oops in trace_ext4_mb_release_group_pa | Problem Details:
Our QA reported an oops in the ext4_mb_release_group_pa tracing,
and Josef Bacik pointed out that it was because we may have a
non-null but uninitialized ac_inode in the allocation context.
I can reproduce it when running xfstests with ext4 tracepoints on,
on a CONFIG_SLAB_DEBUG kernel.
We call trac... | ```diff
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 6a1fcff95f7c..fbdfa3a6bbd8 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -432,7 +432,6 @@ TRACE_EVENT(ext4_mb_release_group_pa,
TP_STRUCT__entry(
__field( dev_t, dev )
- __field( ino_t, ino )... |
0c9169ccad4aed233fdd49e95da4eada2536a06d | Analyze and fix the following issue in the Linux kernel code: ext4: fix potential infinite loop in ext4_da_writepages() | Problem Details:
On linux-2.6.36-rc2, if we execute the following script, we can hang
the system when the /bin/sync command is executed:
========================================================================
#!/bin/sh
echo -n "HANG UP TEST: "
/bin/dd if=/dev/zero of=/tmp/img bs=1k count=1 seek=1M 2> /dev/null
/sbin... | ```diff
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 50f3bba68a25..1e824a3ec538 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2105,7 +2105,7 @@ static void mpage_put_bnr_to_bhs(struct mpage_da_data *mpd,
} while ((bh = bh->b_this_page) != head);
do {
- if (cur_logical >= map->m_lblk + bloc... |
a1c6c5698d53db4c47a25c3a8d11731a4d7b8370 | Analyze and fix the following issue in the Linux kernel code: ext4: fix NULL pointer dereference in print_daily_error_info() | Problem Details:
Fix NULL pointer dereference in print_daily_error_info, when
called on unmounted fs (EXT4_SB(sb) returns NULL), by removing error
reporting timer in ext4_put_super.
Google-Bug-Id: 3017663
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.ed... | ```diff
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 26147746c272..751997d2cefe 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -719,6 +719,7 @@ static void ext4_put_super(struct super_block *sb)
ext4_abort(sb, "Couldn't clean up the journal");
}
+ del_timer(&sbi->s_err_report);
ext4_release_sys... |
53fdcf992d616484d388a8ab9dad07dc8b8f1178 | Analyze and fix the following issue in the Linux kernel code: ext4: don't hold spinlock while calling ext4_issue_discard() | Problem Details:
We can't hold the block group spinlock because we ext4_issue_discard()
calls wait and hence can get rescheduled.
Google-Bug-Id: 3017678
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> | ```diff
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 53472e27b327..ccdfec6acb75 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4696,12 +4696,12 @@ do_more:
* with group lock held. generate_buddy look at
* them with group lock_held
*/
+ if (test_opt(sb, DISCARD))
+ ext4_issue_disca... |
fb1813f4a8a27bbd4735967e46931e61fc837a3e | Analyze and fix the following issue in the Linux kernel code: ext4: use dedicated slab caches for group_info structures | Problem Details:
ext4_group_info structures are currently allocated with kmalloc().
With a typical 4K block size, these are 136 bytes each -- meaning
they'll each consume a 256-byte slab object. On a system with many
ext4 large partitions, that's a lot of wasted kernel slab space.
(E.g., a single 1TB partition will ha... | ```diff
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 889ec9d5e6ad..b364b9df09b3 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -205,6 +205,7 @@ typedef struct ext4_io_end {
#define EXT4_MIN_BLOCK_SIZE 1024
#define EXT4_MAX_BLOCK_SIZE 65536
#define EXT4_MIN_BLOCK_LOG_SIZE 10
+#define EXT4_MAX_BLOCK_LOG_... |
b853fd364810a241050778124842a8c415c72a69 | Analyze and fix the following issue in the Linux kernel code: ext4: avoid null dereference in trace_ext4_mballoc_discard | Problem Details:
ac->inode is set to null in function ext4_mb_release_group_pa(),
and then trace_ext4_mballoc_discard(ac) is called, the kernel
will panic.
BUG: unable to handle kernel NULL pointer dereference at 000000a4
IP: [<f87e1714>] ftrace_raw_event_ext4__mballoc+0x54/0xc0 [ext4]
*pdpt = 0000000000abd001 *pde = ... | ```diff
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 01e9e0076a92..6a1fcff95f7c 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -796,8 +796,9 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
),
TP_fast_assign(
- __entry->dev = ac->ac_inode->i_sb->s_dev;
- __en... |
2c7d81acf432fad02073c139355e94a6f7e4df45 | Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: fix tiled db height calculation on 6xx/7xx | Problem Details:
Calculate height based on the slice bitfield rather than the size.
Same as Dave's CB fix.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com> | ```diff
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
index 7b294c127c5f..37cc2aa9f923 100644
--- a/drivers/gpu/drm/radeon/r600_cs.c
+++ b/drivers/gpu/drm/radeon/r600_cs.c
@@ -310,7 +310,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
/* Check depth buffer */
if (G... |
43b93fbffc2c080dba2e84df6fce8d7e6c0a2581 | Analyze and fix the following issue in the Linux kernel code: drm/radeon/kms: fix handling of tex lookup disable in cs checker on r2xx | Problem Details:
There are cases when multiple texture units have to be enabled,
but not actually used to sample. This patch checks to see if
the lookup_disable bit is set and if so, skips the texture check.
Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=25544
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>... | ```diff
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 6d1540c0bfed..0e8f28a68927 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3180,6 +3180,8 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev,
for (u = 0; u < track->num_texture... |
39e3ac2599a5f9aba499b5f8af809108e70a6163 | Analyze and fix the following issue in the Linux kernel code: jbd2: Fix I/O hang in jbd2_journal_release_jbd_inode | Problem Details:
This fixes a hang seen in jbd2_journal_release_jbd_inode
on a lot of Power 6 systems running with ext4. When we get
in the hung state, all I/O to the disk in question gets blocked
where we stay indefinitely. Looking at the task list, I can see
we are stuck in jbd2_journal_release_jbd_inode waiting on a... | ```diff
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index 7c068c189d80..6494c81e3b0a 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -26,7 +26,9 @@
#include <linux/backing-dev.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
+#include <linux/bitops.h>
#include <trace/events/jbd2.h>
+#include <asm/sy... |
58590b06d79f7ce5ab64ff3b6d537180fa50dc84 | Analyze and fix the following issue in the Linux kernel code: ext4: fix EOFBLOCKS_FL handling | Problem Details:
It turns out we have several problems with how EOFBLOCKS_FL is
handled. First of all, there was a fencepost error where we were not
clearing the EOFBLOCKS_FL when fill in the last uninitialized block,
but rather when we allocate the next block _after_ the uninitalized
block. Secondly we were not test... | ```diff
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 06328d3e5717..820278410220 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3180,6 +3180,57 @@ static void unmap_underlying_metadata_blocks(struct block_device *bdev,
unmap_underlying_metadata(bdev, block + i);
}
+/*
+ * Hand... |
55f335a8857db2ee22c068e7ab7141fc79928296 | Analyze and fix the following issue in the Linux kernel code: fasync: Fix placement of FASYNC flag comment | Problem Details:
In commit f7347ce4ee7c ("fasync: re-organize fasync entry insertion to
allow it under a spinlock") Arnd took an earlier patch of mine that had
the comment about the FASYNC flag above the wrong function.
When the fasync_add_entry() function was split to introduce the new
fasync_insert_entry() helper fu... | ```diff
diff --git a/fs/fcntl.c b/fs/fcntl.c
index dcdbc6f5c33b..ecc8b3954ed6 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -684,6 +684,9 @@ void fasync_free(struct fasync_struct *new)
/*
* Insert a new entry into the fasync list. Return the pointer to the
* old one if we didn't use the new one.
+ *
+ * NOTE! It is... |
c3b92ce9e75f6353104fc7f8e32fb9fdb2550ad0 | Analyze and fix the following issue in the Linux kernel code: ramoops: use the platform data structure instead of module params | Problem Details:
As each board and system has different memory for ramoops. It's better to
define the platform data instead of module params.
[akpm@linux-foundation.org: fix ramoops_remove() return type]
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marco Stornelli <marco.stornelli@gmail.com>
Signed-of... | ```diff
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c
index 74f00b5ffa36..73dcb0ee41fd 100644
--- a/drivers/char/ramoops.c
+++ b/drivers/char/ramoops.c
@@ -25,6 +25,8 @@
#include <linux/time.h>
#include <linux/io.h>
#include <linux/ioport.h>
+#include <linux/platform_device.h>
+#include <linux/ramoops... |
144ecf310eb52d9df607b9b7eeb096743e232a96 | Analyze and fix the following issue in the Linux kernel code: kfifo: fix kfifo_alloc() to return a signed int value | Problem Details:
Add a new __kfifo_int_must_check_helper() helper function, which is needed
for kfifo_alloc() to return the right signed integer value.
The origin __kfifo_must_check_helper() helper was renamed into
__kfifo_uint_must_check_helper() to show the sign which is expected and
returned.
(And revert the tempo... | ```diff
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index c238ad2f82ea..10308c6a3d1c 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -171,8 +171,17 @@ struct kfifo_rec_ptr_2 __STRUCT_KFIFO_PTR(unsigned char, 2, void);
}
-/* __kfifo_must_check_helper() is temporarily disabled becau... |
db9e5679d6aecb17253f41bd06d98194800f9c01 | Analyze and fix the following issue in the Linux kernel code: delay-accounting: reimplement -c for getdelays.c to report information on a target command | Problem Details:
Task delay-accounting was identified as one means of determining how long
a process spends in congestion_wait() without adding new statistics. For
example, if the workload should not be doing IO, delay-accounting could
reveal how long it was spending in unexpected IO or delays.
Unfortunately, on close... | ```diff
diff --git a/Documentation/accounting/getdelays.c b/Documentation/accounting/getdelays.c
index 6e25c2659e0a..a2976a6de033 100644
--- a/Documentation/accounting/getdelays.c
+++ b/Documentation/accounting/getdelays.c
@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
+#inclu... |
1548bf316f18090576f611c7318447c512ddbdd2 | Analyze and fix the following issue in the Linux kernel code: rapidio: fix destructive port EM initialization for Tsi568 | Problem Details:
Replace possibly damaging broadcast writes into the per-port SP_MODE
registers with individual writes for each port. This will preserve
individual port configurations in case if ports are configured
differently.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel... | ```diff
diff --git a/drivers/rapidio/switches/tsi568.c b/drivers/rapidio/switches/tsi568.c
index f7fd7898606e..b9a389b9f812 100644
--- a/drivers/rapidio/switches/tsi568.c
+++ b/drivers/rapidio/switches/tsi568.c
@@ -29,7 +29,7 @@
#define SPP_ROUTE_CFG_DESTID(n) (0x11070 + 0x100*n)
#define SPP_ROUTE_CFG_PORT(n) (0x1107... |
2d4da0fc0940625d59f014c3f85370f9b60ba7f4 | Analyze and fix the following issue in the Linux kernel code: rapidio: fix maximum port number in tsi57x EM initialization | Problem Details:
Replace hardcoded maximum port number with actual reported number of
switch ports.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.... | ```diff
diff --git a/drivers/rapidio/switches/tsi57x.c b/drivers/rapidio/switches/tsi57x.c
index d9e94920e8b0..2003fb63c404 100644
--- a/drivers/rapidio/switches/tsi57x.c
+++ b/drivers/rapidio/switches/tsi57x.c
@@ -166,7 +166,8 @@ tsi57x_em_init(struct rio_dev *rdev)
pr_debug("TSI578 %s [%d:%d]\n", __func__, destid... |
388c45ccfaeec68e334ad79edeb0b5b0a43197ff | Analyze and fix the following issue in the Linux kernel code: rapidio: fix IDLE2 bits corruption | Problem Details:
RapidIO spec v.2.1 adds Idle Sequence 2 into LP-Serial Physical Layer.
The fix ensures that corresponding bits are not corrupted during error
handling.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc:... | ```diff
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 7f18a65c4ed0..68cf0c99138a 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -871,15 +871,10 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg)
rdev->em_efptr + RIO_EM_LTL_ERR_DETECT, 0);
}
- /* Clear remaining error b... |
2c70f022e2e1b1493e157dbc3796b1f70a3ff162 | Analyze and fix the following issue in the Linux kernel code: rapidio: fix RapidIO sysfs hierarchy | Problem Details:
This set of RapidIO patches extends support for standard error recovery
mechanism and adds new IDT Gen2 sRIO switch devices - CPS-1848 and
CPS-1616. Implementation of the standard error-stopped state recovery
mechanism (as defined by the RapidIO specification) is required for the
new switches.
Versio... | ```diff
diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c
index 3222fa3c808c..0f4a53bdaa3c 100644
--- a/drivers/rapidio/rio-driver.c
+++ b/drivers/rapidio/rio-driver.c
@@ -192,7 +192,7 @@ static int rio_match_bus(struct device *dev, struct device_driver *drv)
out:return 0;
}
-static str... |
e89d67cfbcc1ee32339da9e816489f69742c3a6e | Analyze and fix the following issue in the Linux kernel code: drivers/char/mxser.c: fix compilation warning in mxser.c | Problem Details:
Both mxser_disable_must_enchance_mode() and mxser_get_must_hardware_id()
called from function CheckIsMoxaMust(), when CONFIG_PCI=y. So mark both
the functions under CONFIG_PCI.
We were warned by the following warning.
drivers/char/mxser.c:306: warning: `mxser_disable_must_enchance_mode' defined but ... | ```diff
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 463df27494bd..dd9d75351cd6 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -303,6 +303,7 @@ static void mxser_enable_must_enchance_mode(unsigned long baseio)
outb(oldlcr, baseio + UART_LCR);
}
+#ifdef CONFIG_PCI
static void mxs... |
ed77ed6112f2d4b650f4be7dbaf14e06e1d393a5 | Analyze and fix the following issue in the Linux kernel code: drivers/char/synclink_gt.c: fix information leak to userland | Problem Details:
Structures tmp_params and new_line are copied to userland with some
padding fields unitialized. It leads to leaking of stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by:... | ```diff
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 11999784383e..9f7fc71474b4 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -1132,6 +1132,7 @@ static long get_params32(struct slgt_info *info, struct MGSL_PARAMS32 __user *us
struct MGSL_PARAMS32 tmp_params;... |
b9b1134260e036fb75c468514569864dd6722f3e | Analyze and fix the following issue in the Linux kernel code: drivers/char/ppdev.c: fix information leak to userland | Problem Details:
Structure par_timeout is copied to userland with some padding fields
unitialized. Field tv_usec has type __kernel_suseconds_t, it differs from
tv_sec's type on some architectures. It leads to leaking of stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Andrew Morton <ak... | ```diff
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 723152d978a9..f176dbaeb15a 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -613,6 +613,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case PPGETTIME:
to_jiffies = pp->pdev->timeout;
+ mems... |
19714a8af8fe8618a9beace1f7a3bb10d55d5e2f | Analyze and fix the following issue in the Linux kernel code: drivers/char/applicom.c: fix information leak to userland | Problem Details:
Structure st_loc is copied to userland with some fields unitialized. It
leads to leaking of stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index e7ba774beda6..25373df1dcf8 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -566,6 +566,7 @@ static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_
struct mailbox mailbox;
/* Got a pac... |
ffd7d6baa65e6161cfd996a59d55c48571c2a5f3 | Analyze and fix the following issue in the Linux kernel code: synclink_gt: fix per device locking | Problem Details:
Fix a long standing bug with per device locking.
Each device has an associated spinlock for synchronizing access to
hardware and state information with the ISR. A single hardware card has
one or more devices.
Bug: Non ISR code correctly acquires and releases the per device lock.
ISR incorrectly alwa... | ```diff
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 1746d91205f7..11999784383e 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -2357,26 +2357,27 @@ static irqreturn_t slgt_interrupt(int dummy, void *dev_id)
DBGISR(("slgt_interrupt irq=%d entry\n", info->irq... |
60ee6d5faf5f7920ba88b82c072864596f5b88af | Analyze and fix the following issue in the Linux kernel code: ipmi: fix __init and __exit attribute locations | Problem Details:
__init and __exit belong after the return type on functions, not
before.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 1fc8876af1f5..2aa3977aae5e 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -916,7 +916,7 @@ static struct ipmi_smi_watcher smi_watcher =
.smi_gone = ipmi_smi_gone,
};
-static __ini... |
478735e38887077ac77a9756121b6ce0cb956e2f | Analyze and fix the following issue in the Linux kernel code: /proc/stat: fix scalability of irq sum of all cpu | Problem Details:
In /proc/stat, the number of per-IRQ event is shown by making a sum each
irq's events on all cpus. But we can make use of kstat_irqs().
kstat_irqs() do the same calculation, If !CONFIG_GENERIC_HARDIRQ,
it's not a big cost. (Both of the number of cpus and irqs are small.)
If a system is very big and ... | ```diff
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index b80c620565bf..e15a19c93bae 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -31,7 +31,6 @@ static int show_stat(struct seq_file *p, void *v)
u64 sum_softirq = 0;
unsigned int per_softirq_sums[NR_SOFTIRQS] = {0};
struct timespec boottime;
- unsigned int... |
19cd56c48da58bebc3a638e036bcab69469acd27 | Analyze and fix the following issue in the Linux kernel code: procfs: fix /proc/softirqs formatting | Problem Details:
The length of the BLOCK_IPOLL string is making i's value be printed too
far to the right. This patch fixes this and makes the output a bit
neater.
Currently:
CPU0
HI: 0
TIMER: 599792
NET_TX: 2
NET_RX: 6
BLOCK: 80807
BLOCK_IOPOLL: ... | ```diff
diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c
index 1807c2419f17..37994737c983 100644
--- a/fs/proc/softirqs.c
+++ b/fs/proc/softirqs.c
@@ -10,13 +10,13 @@ static int show_softirqs(struct seq_file *p, void *v)
{
int i, j;
- seq_printf(p, " ");
+ seq_printf(p, " ");
... |
1b0d300bd0f047e2edaf9d4b6784189e6c67c3d1 | Analyze and fix the following issue in the Linux kernel code: core_pattern: fix truncation by core_pattern handler with long parameters | Problem Details:
We met a parameter truncated issue, consider following:
> echo "|/root/core_pattern_pipe_test %p /usr/libexec/blah-blah-blah \
%s %c %p %u %g 11 12345678901234567890123456789012345678 %t" > \
/proc/sys/kernel/core_pattern
This is okay because the strings is less than CORENAME_MAX_SIZE. "cat
/proc/sys... | ```diff
diff --git a/fs/exec.c b/fs/exec.c
index 9722909c4d88..ca01d2d0a6d4 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -66,6 +66,12 @@ char core_pattern[CORENAME_MAX_SIZE] = "core";
unsigned int core_pipe_limit;
int suid_dumpable = 0;
+struct core_name {
+ char *corename;
+ int used, size;
+};
+static atomic_t call_... |
0a3d763f1a68c97daae57e40c6d698986d1b38f4 | Analyze and fix the following issue in the Linux kernel code: ptrace: cleanup arch_ptrace() on um | Problem Details:
Remove unnecessary castings using void pointer and fix copy_to_user()
return value. Also add missing __user markup on the argument of
arch_ptrctl().
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by... | ```diff
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 963d82bdec06..a5e33f29bbeb 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -47,6 +47,7 @@ long arch_ptrace(struct task_struct *child, long request,
{
int i, ret;
unsigned long __user *p = (void __user *)data;
+ void ... |
475a4b813816fe9af4cdf7833799036b679f46d0 | Analyze and fix the following issue in the Linux kernel code: ptrace: cleanup arch_ptrace() on cris | Problem Details:
Use new 'regno' variable in order to remove redandunt expression and
remove checking @addr less than 0 because @addr is now unsigned. Also
update 'datap' on PTRACE_GET/SETREGS to fix a bug on arch-v10.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Acked-by: Mikael Starvik <starvik@axis.com>
Cc: Je... | ```diff
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index d411e024e05f..320065f3cbe5 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -80,6 +80,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long addr, unsig... |
eb5a3699311ba8ed22b7b38ceb3bb1411e438e2a | Analyze and fix the following issue in the Linux kernel code: ptrace: cleanup arch_ptrace() on x86 | Problem Details:
Remove checking @addr less than 0 because @addr is now unsigned and
use new udescp variable in order to remove unnecessary castings.
[akpm@linux-foundation.org: fix unused variable 'udescp']
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <ming... | ```diff
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 1a7ca045920d..45892dc4b72a 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -813,8 +813,7 @@ long arch_ptrace(struct task_struct *child, long request,
unsigned long tmp;
ret = -EIO;
- if ((addr & (sizeof(data)... |
9b05a69e0534ec70bc94921936ffa05b330507cb | Analyze and fix the following issue in the Linux kernel code: ptrace: change signature of arch_ptrace() | Problem Details:
Fix up the arguments to arch_ptrace() to take account of the fact that
@addr and @data are now unsigned long rather than long as of a preceding
patch in this series.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Acked-by: Roland McGrath <roland@redhat.com>
Acked-by:... | ```diff
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index baa903602f6a..e2af5eb59bb4 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -269,7 +269,8 @@ void ptrace_disable(struct task_struct *child)
user_disable_single_step(child);
}
-long arch_ptrace(struct task_... |
1489ebad8b5b20300562f634f279cb9c435fd90b | Analyze and fix the following issue in the Linux kernel code: memcg: cpu hotplug aware quick acount_move detection | Problem Details:
An event counter MEM_CGROUP_ON_MOVE is used for quick check whether file
stat update can be done in async manner or not. Now, it use percpu
counter and for_each_possible_cpu to update.
This patch replaces for_each_possible_cpu to for_each_online_cpu and adds
necessary synchronization logic at CPU HOT... | ```diff
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 31a1d3b71eee..52840adae62a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1132,11 +1132,14 @@ static unsigned int get_swappiness(struct mem_cgroup *memcg)
static void mem_cgroup_start_move(struct mem_cgroup *mem)
{
int cpu;
- /* Because this is fo... |
32047e2a85f06633ee4c53e2d0346fbcd34e480b | Analyze and fix the following issue in the Linux kernel code: memcg: avoid lock in updating file_mapped (Was fix race in file_mapped accouting flag management | Problem Details:
At accounting file events per memory cgroup, we need to find memory cgroup
via page_cgroup->mem_cgroup. Now, we use lock_page_cgroup() for guarantee
pc->mem_cgroup is not overwritten while we make use of it.
But, considering the context which page-cgroup for files are accessed,
we can use alternative... | ```diff
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0e3fdbd809c7..dd845d25827a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -90,6 +90,7 @@ enum mem_cgroup_stat_index {
MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */
MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */
MEM_CGROUP_EVEN... |
0c270f8f9988fb0d93ea214fdcff7ab90eb3d894 | Analyze and fix the following issue in the Linux kernel code: memcg: fix race in file_mapped accouting flag management | Problem Details:
Presently memory cgroup accounts file-mapped by counter and flag. counter
is working in the same way with zone_stat but FileMapped flag only exists
in memcg (for helping move_account).
This flag can be updated wrongly in a case. Assume CPU0 and CPU1 and a
thread mapping a page on CPU0, another threa... | ```diff
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 9be3cf8a5da4..0e3fdbd809c7 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1485,7 +1485,8 @@ void mem_cgroup_update_file_mapped(struct page *page, int val)
SetPageCgroupFileMapped(pc);
} else {
__this_cpu_dec(mem->stat->count[MEM_CGROUP_STAT_FI... |
f4a2589feaef0a9b737a3e582b37ee96695bb25f | Analyze and fix the following issue in the Linux kernel code: cgroups: add check for strcpy destination string overflow | Problem Details:
Function "strcpy" is used without check for maximum allowed source string
length and could cause destination string overflow. Check for string
length is added before using "strcpy". Function now is return error if
source string length is more than a maximum.
akpm: presently considered NotABug, but a... | ```diff
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3e6517e51fd3..5cf366965d0c 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1922,6 +1922,8 @@ static int cgroup_release_agent_write(struct cgroup *cgrp, struct cftype *cft,
const char *buffer)
{
BUILD_BUG_ON(sizeof(cgrp->root->release_agen... |
32a8cf235e2f192eb002755076994525cdbaa35a | Analyze and fix the following issue in the Linux kernel code: cgroup: make the mount options parsing more accurate | Problem Details:
Current behavior:
=================
(1) When we mount a cgroup, we can specify the 'all' option which
means to enable all the cgroup subsystems. This is the default option
when no option is specified.
(2) If we want to mount a cgroup with a subset of the supported cgroup
subsystems, we h... | ```diff
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4b218a46ddd3..3e6517e51fd3 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1074,7 +1074,8 @@ struct cgroup_sb_opts {
*/
static int parse_cgroupfs_options(char *data, struct cgroup_sb_opts *opts)
{
- char *token, *o = data ?: "all";
+ char *token, *... |
2d3cbf8bc852ac1bc3d098186143c5973f87b753 | Analyze and fix the following issue in the Linux kernel code: cgroup_freezer: update_freezer_state() does incorrect state transitions | Problem Details:
There are 4 state transitions possible for a freezer. Only FREEZING ->
FROZEN transaction is done lazily. This patch allows update_freezer_state
only to perform this transaction and renames the function to
update_if_frozen.
Moreover is_task_frozen_enough function is removed and its every occurence
i... | ```diff
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index c287627bed3d..e7bebb7c6c38 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -153,13 +153,6 @@ static void freezer_destroy(struct cgroup_subsys *ss,
kfree(cgroup_freezer(cgroup));
}
-/* Task is frozen or will freeze im... |
0bdba580ab052a21e3eda2764ed22d9ee962392b | Analyze and fix the following issue in the Linux kernel code: cgroup_freezer: fix can_attach() to prohibit moving from/to freezing/frozen cgroups | Problem Details:
It is possible to move a task from its cgroup even if this group is
'FREEZING'. This results in a nasty bug - the moved task will become
frozen OUTSIDE its original cgroup and will remain in a permanent 'D'
state.
This patch allows to migrate the task only between THAWED cgroups.
This behavior was o... | ```diff
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 321e2a007d25..c287627bed3d 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -173,24 +173,25 @@ static int freezer_can_attach(struct cgroup_subsys *ss,
/*
* Anything frozen can't move or be moved to/from.
- *
- * S... |
f35691062a138484b51bf53b36ae8a4495d8fb91 | Analyze and fix the following issue in the Linux kernel code: drivers/video/gbefb.c: eliminate memory leak | Problem Details:
This code is preceded by a call to framebuffer_alloc, which allocates
memory, so this memory should be freed before leaving the function in an
error case. out_release_framebuffer just frees the frame buffer and
returns.
A simplified version of the semantic match that finds this problem is:
(http://co... | ```diff
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index ca3355e430bf..933899dca33a 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -1143,8 +1143,10 @@ static int __devinit gbefb_probe(struct platform_device *p_dev)
return -ENOMEM;
#ifndef MODULE
- if (fb_get_options("gbefb", &op... |
f11b478d461b7113eb4603b3914aaf15b7788e87 | Analyze and fix the following issue in the Linux kernel code: fbmem: fix fb_read, fb_write unaligned accesses | Problem Details:
fb_{read,write} access the framebuffer using lots of fb_{read,write}l's
but don't check that the file position is aligned which can cause problems
on some architectures which do not support unaligned accesses.
Since the operations are essentially memcpy_{from,to}io, new
fb_memcpy_{from,to}fb macros ha... | ```diff
diff --git a/arch/sparc/include/asm/io_32.h b/arch/sparc/include/asm/io_32.h
index 2889574608db..c2ced21c9dc1 100644
--- a/arch/sparc/include/asm/io_32.h
+++ b/arch/sparc/include/asm/io_32.h
@@ -207,6 +207,21 @@ _memset_io(volatile void __iomem *dst, int c, __kernel_size_t n)
#define memset_io(d,c,sz) _memse... |
c9c62dce35e7fc54beebafb071393a0008989e49 | Analyze and fix the following issue in the Linux kernel code: fbmem: fix whitespace | Problem Details:
Change a few lines of indentation to tabs.
Signed-off-by: James Hogan <james@albanarts.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ```diff
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 42e303ff862a..a43442341ddd 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -877,13 +877,13 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
if ((err = info->fbops->fb_pan_display(var, info)))
return e... |
847fb8aca3b79d03ef6c5f87f0843a30ed9e6627 | Analyze and fix the following issue in the Linux kernel code: drivers/video/matrox/matroxfb_maven.c: fix unsigned return type | Problem Details:
The function has an unsigned return type, but returns a negative constant
to indicate an error condition. The result of calling the function is
only tested by comparison to 0, and thus unsigned is not needed and can be
dropped from the return type.
A sematic match that finds this problem is as follow... | ```diff
diff --git a/drivers/video/matrox/matroxfb_maven.c b/drivers/video/matrox/matroxfb_maven.c
index 1e3e8f19783e..31b8f67477b7 100644
--- a/drivers/video/matrox/matroxfb_maven.c
+++ b/drivers/video/matrox/matroxfb_maven.c
@@ -280,7 +280,7 @@ static int matroxfb_PLL_mavenclock(const struct matrox_pll_features2* pll... |
f0a2f357d46a51f8066eb47b3dba40f87a680804 | Analyze and fix the following issue in the Linux kernel code: savagefb: fix DDC for Savage 4 | Problem Details:
I tested savagefb on 3 different Savage 4 cards:
Diamond Stealth III S520
Number Nine SR9
Datapath Horizon 2S (two savage chips on a PCI card)
it worked except the DDC which did not work on any of them.
Looking at the BIOS code, it does not use MMIO register 0xff20 but CRT
register 0xa0 or 0xb1 - dep... | ```diff
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c
index ed371c868b3a..b16e6138fdd4 100644
--- a/drivers/video/savage/savagefb-i2c.c
+++ b/drivers/video/savage/savagefb-i2c.c
@@ -181,6 +181,15 @@ void savagefb_create_i2c_busses(struct fb_info *info)
par->chan.algo.getscl =... |
09cd9527d621640d4dd231dff77b681e711d8e4b | Analyze and fix the following issue in the Linux kernel code: gpiolib: fix HAVE_GPIO_LIB leftovers in asm-generic/gpio.h | Problem Details:
commit 7444a72effa632fcd8edc566f88 ("gpiolib: allow user-selection")
removed HAVE_GPIO_LIB Kconfig symbol, but the header file still uses the
name [to confuse readers wrt #ifdef/#else/#endif location].
The real Kconfig symbol nowadays is CONFIG_GPIOLIB.
Signed-off-by: Anton Vorontsov <cbouatmailru@gm... | ```diff
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index 8ca18e26d7e3..ff5c66080c8c 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -210,7 +210,7 @@ extern void gpio_unexport(unsigned gpio);
#endif /* CONFIG_GPIO_SYSFS */
-#else /* !CONFIG_HAVE_GPIO_LIB */
+#el... |
d0f744c8cbd19a8d07eccb15bb08e6a29c4d5192 | Analyze and fix the following issue in the Linux kernel code: drivers/rtc/rtc-jz4740.c: add alarm function | Problem Details:
Add the "alarm" function to the jz4740 RTC. Interrupts will now be raised
when the "alarm" time is reached.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Lars-P... | ```diff
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index 2619d57b91d7..2e16f72c9056 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
+ * Copyright (C) 2010, Paul Cercueil <paul@crapouillou.n... |
e1df962e6cdc431acb6a8da409b6a7d89c4f782e | Analyze and fix the following issue in the Linux kernel code: rtc: rtc-s3c: fix RTC initialization method | Problem Details:
Change RTC initialization method in probe(). The 'rtc_valid_tm(tm)' can
check whether RTC BCD is valid or not. And change the method of checking
because the previous method cannot validate RTC BCD registers properly.
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <k... | ```diff
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index ead217b1857a..d0498a223f40 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -456,8 +456,8 @@ static int __devexit s3c_rtc_remove(struct platform_device *dev)
static int __devinit s3c_rtc_probe(struct platform_device *pdev)
{
s... |
30ffc40cf52cd68782b50cb699b5eca076ca23ab | Analyze and fix the following issue in the Linux kernel code: rtc: rtc-s3c: Fix debug message format on RTC | Problem Details:
Fix debug message format.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linu... | ```diff
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index a53c27f30745..ead217b1857a 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -171,8 +171,8 @@ static int s3c_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
goto retry_get_time;
}
- pr_debug("read time %02x.%02x.%02... |
e6eb524e6e6df4027530b36f76b84a6a076a3249 | Analyze and fix the following issue in the Linux kernel code: rtc: rtc-s3c: fix on support RTC Alarm | Problem Details:
The alarm_irq_enable function should be implemented to support RTC alarm.
And fix tabs instead of white space around the proc field.
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <mcuo... | ```diff
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 75b009a17e5b..a53c27f30745 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -379,7 +379,8 @@ static const struct rtc_class_ops s3c_rtcops = {
.set_alarm = s3c_rtc_setalarm,
.irq_set_freq = s3c_rtc_setfreq,
.irq_set_state = s... |
dd061d1abe4e637bf755865f776f8088dacd1c0b | Analyze and fix the following issue in the Linux kernel code: rtc: rtc-s3c: fix setting missing field of getalarm | Problem Details:
Current s3c_rtc_getalarm() sets missing field of alarm time with 0xff.
But this value should be -1 according to drivers/rtc/interface.c.
Signed-off-by: Changhwan Youn <chaos.youn@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Wan ZongShun <... | ```diff
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index a87982d7cb70..75b009a17e5b 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -242,34 +242,34 @@ static int s3c_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm)
if (alm_en & S3C2410_RTCALM_SECEN)
alm_tm->tm_sec = bcd2b... |
f61ae6711d69717558e882a78487527705603a74 | Analyze and fix the following issue in the Linux kernel code: rtc: rtc-s3c: fix access unit from byte to word on RTCCON | Problem Details:
S3C2410_RTCCON of TYPE_S3C64XX RTC should be read/written by readw and
writew, because TYPE_S3C64XX RTC uses bit 8 and 9. And TYPE_S3C2410 RTC
also can access it by readw and writew.
[atul.dahiya@samsung.com: tested on smdk2416]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Changhwan... | ```diff
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index f57a87f4ae96..a87982d7cb70 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -100,7 +100,7 @@ static int s3c_rtc_setpie(struct device *dev, int enabled)
spin_lock_irq(&s3c_rtc_pie_lock);
if (s3c_rtc_cpu_type == TYPE_S3C64XX) ... |
59cca865f21e9e7beab73fcf79ba4eb776a4c228 | Analyze and fix the following issue in the Linux kernel code: drivers/rtc/class.c: fix device_register() error handling | Problem Details:
If device_register() fails then call put_device(). See comment to
device_register.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torval... | ```diff
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 565562ba6ac9..e6539cbabb35 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -158,8 +158,10 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
rtc_dev_prepare(rtc);
err = device_register(&rtc->dev);
- if ... |
d7c7ef908b6497bb871e2e113e66e8fb0f757543 | Analyze and fix the following issue in the Linux kernel code: rtc-bfin: add debug markers to suspend/resume paths | Problem Details:
The rest of the driver had debug markings already. This also standardizes
the usage of "dev" a bit.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linu... | ```diff
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 3506f330e97e..b4b6087f2234 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -2,7 +2,7 @@
* Blackfin On-Chip Real Time Clock Driver
* Supports BF51x/BF52x/BF53[123]/BF53[467]/BF54x
*
- * Copyright 2004-2009 Analog Device... |
1e0ad2881d50becaeea70ec696a80afeadf944d2 | Analyze and fix the following issue in the Linux kernel code: drivers/char/vt_ioctl.c: fix VT_OPENQRY error value | Problem Details:
When all VT's are in use, VT_OPENQRY casts -1 to unsigned char before
returning it to userspace as an int. VT255 is not the next available
console.
Signed-off-by: Graham Gower <graham.gower@gmail.com>
Cc: Greg KH <greg@kroah.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-founda... | ```diff
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 38df8c19e74c..6b68a0fb4611 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -503,6 +503,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
struct kbd_struct * kbd;
unsigned int console;
unsigned char ucval... |
20273941f2129aa5a432796d98a276ed73d60782 | Analyze and fix the following issue in the Linux kernel code: mm: fix race in kunmap_atomic() | Problem Details:
Christoph reported a nice splat which illustrated a race in the new stack
based kmap_atomic implementation.
The problem is that we pop our stack slot before we're completely done
resetting its state -- in particular clearing the PTE (sometimes that's
CONFIG_DEBUG_HIGHMEM). If an interrupt happens bef... | ```diff
diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c
index c00f119babbf..c435fd9e1da9 100644
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -89,7 +89,7 @@ void __kunmap_atomic(void *kvaddr)
int idx, type;
if (kvaddr >= (void *)FIXADDR_START) {
- type = kmap_atomic_idx_pop();
+ type = k... |
a8e23a291852cd7c4fb5ca696dbb93912185ad10 | Analyze and fix the following issue in the Linux kernel code: mm,x86: fix kmap_atomic_push vs ioremap_32.c | Problem Details:
It appears i386 uses kmap_atomic infrastructure regardless of
CONFIG_HIGHMEM which results in a compile error when highmem is disabled.
Cure this by providing the needed few bits for both CONFIG_HIGHMEM and
CONFIG_X86_32.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: Chris Wilso... | ```diff
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 8a85ec109a3a..102f76be90da 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -37,27 +37,6 @@ extern unsigned long totalhigh_pages;
void kmap_flush_unused(void);
-DECLARE_PER_CPU(int, __kmap_atomic_idx);
-
-static inlin... |
4408ea41c0ab4b711d4da44dd954fb06dce6c3f8 | Analyze and fix the following issue in the Linux kernel code: quota: Fix possible oops in __dquot_initialize() | Problem Details:
When quotaon(8) races with __dquot_initialize() or dqget() fails because
of EIO, ENOSPC, or similar error, we could possibly dereference NULL pointer
in inode->i_dquot[cnt]. Add proper checking.
Reported-by: Dmitry Monakhov <dmonakhov@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 1bc38f56fa7c..0fed41e6efcd 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1386,6 +1386,9 @@ static void __dquot_initialize(struct inode *inode, int type)
/* Avoid races with quotaoff() */
if (!sb_has_quota_active(sb, cnt))
continue;
+ /... |
a4c18ad2eed93194a667cb9f6662c3b3e8f0bba9 | Analyze and fix the following issue in the Linux kernel code: ext3: Update kernel-doc comments | Problem Details:
Update missing/broken argument descriptions and fix formatting.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index a49ce4a7c23d..b3db22649426 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -810,8 +810,9 @@ find_next_usable_block(ext3_grpblk_t start, struct buffer_head *bh,
/**
* claim_block()
+ * @lock: the spin lock for this block group
* @block: the ... |
db50d20b1da6ebb62bc28172de142efd9e7b5d89 | Analyze and fix the following issue in the Linux kernel code: ext3: Fix debug messages in ext3_group_extend() | Problem Details:
Fix a typo, break long lines and use E3FSBLK on ext3_fsblk_t.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index 0ccd7b12b73c..e746d30b1232 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -977,7 +977,8 @@ int ext3_group_extend(struct super_block *sb, struct ext3_super_block *es,
o_blocks_count = le32_to_cpu(es->s_blocks_count);
if (test_opt(sb, DEBUG))
-... |
b8ea49fa9baff99523aa51e680e76e8ccb5f25f3 | Analyze and fix the following issue in the Linux kernel code: jbd: Fix debug message in do_get_write_access() | Problem Details:
'buffer_head' should be 'journal_head'.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index c9bb7a73f8fd..846a3f314111 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -526,7 +526,7 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
transaction = handle->h_transaction;
journal = transaction->t_journal;
-... |
df0d6b8ff152b1a1aaae17c27a445ad025a358bd | Analyze and fix the following issue in the Linux kernel code: ext3: Cleanup ext3_setup_super() | Problem Details:
Fix mount-count check to emit warning only if s_max_mnt_count
is greater than 0 according to man tune2fs(8). Also removes
unnecessary casts.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 3ef272488ac9..daf34b1c4fb5 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -1306,9 +1306,9 @@ static int ext3_setup_super(struct super_block *sb, struct ext3_super_block *es,
ext3_msg(sb, KERN_WARNING,
"warning: mounting fs with errors, "
"ru... |
86f3cbec4a193c04d0a31c13132c5956731af6ff | Analyze and fix the following issue in the Linux kernel code: quota: Fix issuing of warnings from dquot_transfer | Problem Details:
__dquot_transfer accidentally called flush_warnings for a wrong set of
dquots which could result in quota warnings being issued with a wrong
identification. Also when operation fails because of EDQUOT, there's no
need check for issuing information message about user getting below limits
(no transfer ha... | ```diff
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index ed14beea8fe3..1bc38f56fa7c 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1805,20 +1805,19 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
mark_all_dquot_dirty(transfer_from);
mark_all_dquot_dirty(transfer_to);
+ flu... |
9e32784b71c2c84895016ca6ab271591669c02aa | Analyze and fix the following issue in the Linux kernel code: quota: fix dquot_disable vs dquot_transfer race v2 | Problem Details:
I've got following lockup:
dquot_disable dquot_transfer
->dqget()
sb_has_quota_active
dqopt->flags &= ~dquot_state_flag(f, cnt) atomic_inc(dq->dq_count)
->drop_dquot_ref(sb, cnt);
down_write(dqptr_sem)
in... | ```diff
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index aad1316a977f..ed14beea8fe3 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1736,6 +1736,7 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
qsize_t rsv_space = 0;
struct dquot *transfer_from[MAXQUOTAS] = {};
int cnt, re... |
dff6825e9fde93891e60751e01480337a991235e | Analyze and fix the following issue in the Linux kernel code: ext3/jbd: Avoid WARN() messages when failing to write the superblock | Problem Details:
This fixes a WARN backtrace in mark_buffer_dirty() that occurs during unmount
when the underlying block device is removed. This bug has been seen on System
Z when removing all paths from a multipath-backed ext3 mount; on System P when
injecting enough PCI EEH errors to make the SCSI controller go offl... | ```diff
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 5dbf4dba03c4..3ef272488ac9 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -2361,6 +2361,21 @@ static int ext3_commit_super(struct super_block *sb,
if (!sbh)
return error;
+
+ if (buffer_write_io_error(sbh)) {
+ /*
+ * Oh, dear. A previous at... |
c5639bef63a241d8d5a00e5243d7f304d7563c46 | Analyze and fix the following issue in the Linux kernel code: jbd: Move debug message into #ifdef area | Problem Details:
Move call to jbd_debug() into #ifdef CONFIG_JBD_DEBUG block because
'dropped' is declared there. The code could be compiled without this
change anyway, simply because jbd_debug() expands to nothing if
!CONFIG_JBD_DEBUG but IMHO it doesn't look good in general.
Signed-off-by: Namhyung Kim <namhyung@gma... | ```diff
diff --git a/fs/jbd/recovery.c b/fs/jbd/recovery.c
index 81051dafebf5..5b43e96788e6 100644
--- a/fs/jbd/recovery.c
+++ b/fs/jbd/recovery.c
@@ -296,10 +296,10 @@ int journal_skip_recovery(journal_t *journal)
#ifdef CONFIG_JBD_DEBUG
int dropped = info.end_transaction -
be32_to_cpu(journal->j_superbl... |
26f78b7a423aea094c536e94cbe1f1fa4641dd7b | Analyze and fix the following issue in the Linux kernel code: ext2: fix comment on ext2_try_to_allocate() | Problem Details:
@handle doesn't exist in ext2. Remove it.
Also, fit comment header into kernel-doc format.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz> | ```diff
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index c6c684b44ea1..0d06f4e75699 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -646,10 +646,9 @@ find_next_usable_block(int start, struct buffer_head *bh, int maxblocks)
return here;
}
-/*
+/**
* ext2_try_to_allocate()
* @sb: superblock
- * @... |
062c1825a5f6673746efe5f0a5ea3803b0c316a9 | Analyze and fix the following issue in the Linux kernel code: Coccinelle: Add contextual message | Problem Details:
Change the message displayed to the user according
to the current mode used.
Fix trailing white-space and spelling
Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz> | ```diff
diff --git a/scripts/coccicheck b/scripts/coccicheck
index 7529af15672d..1bb1a1bd2daa 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -32,7 +32,7 @@ if [ "$MODE" = "" ] ; then
fi
MODE="chain"
elif [ "$MODE" = "report" -o "$MODE" = "org" ] ; then
- FLAGS="$FLAGS -no_show_diff"
+ ... |
9dcf7990c2b8afe865d59f809a35a84d10f241f8 | Analyze and fix the following issue in the Linux kernel code: Coccinelle: Fix documentation | Problem Details:
A file used as example has been moved elsewhere.
Update the documentation accordingly
Signed-off-by: Nicolas Palix <npalix.work@gmail.com>
Reported-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Michal Marek <mmarek@suse.cz> | ```diff
diff --git a/Documentation/coccinelle.txt b/Documentation/coccinelle.txt
index de51a3eb17b3..4a276ea7001c 100644
--- a/Documentation/coccinelle.txt
+++ b/Documentation/coccinelle.txt
@@ -139,7 +139,7 @@ Example:
Running
- make coccicheck MODE=report COCCI=scripts/coccinelle/err_cast.cocci
+ make coccicheck... |
24a54f7974a616385b96cd939e004592e2cea484 | Analyze and fix the following issue in the Linux kernel code: namespace: add source file location exceptions | Problem Details:
Teach namespace checker about some special case files where the
source is in unusual location. This fixes many of the source file
not found errors (more can be added), and also prevents false positives
for functions not being used.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-b... | ```diff
diff --git a/scripts/namespace.pl b/scripts/namespace.pl
index a71be6b7cdec..fd2d946fae23 100755
--- a/scripts/namespace.pl
+++ b/scripts/namespace.pl
@@ -141,6 +141,26 @@ my %nameexception = (
'VDSO32_sigreturn' => 1,
);
+# Files with exceptions to source file location
+my %sourceloc = (
+ 'net/dccp... |
893eead092f14e42cac054a394a86e3c6e016b68 | Analyze and fix the following issue in the Linux kernel code: drm/i915: Fix hangcheck to handle multiple rings | Problem Details:
Currently, we believe the GPU is idle if just the RENDER ring is idle.
This is obviously wrong if we only using either the BLT or the BSD
rings and so masking genuine hangs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> | ```diff
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 8acdd6d857d3..23b28528c642 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1307,12 +1307,29 @@ int i915_vblank_swap(struct drm_device *dev, void *data,
return -EINVAL;
}
-static struc... |
7e318e18f248416a3d32a1649a9b4538e7f8b0eb | Analyze and fix the following issue in the Linux kernel code: drm/i915: Move object to GPU domains after dispatching execbuffer | Problem Details:
In the event that we fail to dispatch the execbuffer, for example if
there is insufficient space on the ring, we were leaving the objects in
an inconsistent state. Notably they were marked as being in the GPU
write domain, but were not added to the ring or any list. This would
lead to inevitable oops:
... | ```diff
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 00e901483ba5..580244c1e793 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3085,9 +3085,6 @@ i915_gem_object_set_to_gpu_domain(struct drm_gem_object *obj,
struct drm_i915_gem_object *obj... |
532cf2907ac3b9c2345d76251764f4f4e602c921 | Analyze and fix the following issue in the Linux kernel code: scripts/extract-ikconfig: add support for bzip2, lzma and lzo | Problem Details:
Add support for kernels compressed with bzip2, lzma or lzo to the
extract-ikconfig script.
Fixes kernel bugzilla #19852:
https://bugzilla.kernel.org/show_bug.cgi?id=19852
Signed-off-by: Dick Streefland <dick@streefland.net>
Tested-by: Justin <jlec@gentoo.org>
Signed-off-by: Michal Marek <mmarek@suse.... | ```diff
diff --git a/scripts/extract-ikconfig b/scripts/extract-ikconfig
index 37f30d36c944..1512c0a755ac 100755
--- a/scripts/extract-ikconfig
+++ b/scripts/extract-ikconfig
@@ -7,12 +7,10 @@
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line ins... |
e8cf981346b78ee50c2bfce83be9ee55704b3d4f | Analyze and fix the following issue in the Linux kernel code: scripts/namespace.pl: some bug fixes | Problem Details:
1. Teach namespace.pl to understand "V" and "v"
2. cond_syscalls are moved into kernel/sys_ni.c
Signed-off-by: Amerigo Wang <amwang@redhat.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal... | ```diff
diff --git a/scripts/namespace.pl b/scripts/namespace.pl
index c8d0922c3b4f..bccf61044eda 100755
--- a/scripts/namespace.pl
+++ b/scripts/namespace.pl
@@ -266,6 +266,7 @@ sub do_nm
# T global label/procedure
# U external reference
# W weak external reference to text that has been resolved
+ # V simila... |
c25f415751c0c5507561d997fe5f7f05f4342912 | Analyze and fix the following issue in the Linux kernel code: scripts/namespace.pl: fix wrong source path | Problem Details:
File::Find will do chdir automatically, so we need to get the absolute
patch with $File::Find::dir.
Reported-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Amerigo Wang <amwang@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-o... | ```diff
diff --git a/scripts/namespace.pl b/scripts/namespace.pl
index 361d0f71184b..fb4e24560736 100755
--- a/scripts/namespace.pl
+++ b/scripts/namespace.pl
@@ -167,11 +167,11 @@ sub do_nm
printf STDERR "$fullname is not an object file\n";
return;
}
- ($source = $fullname) =~ s/\.o$//;
- if (-e "$objtree$sour... |
8f28f54aad8bcf52a47afb6447fac34f96597b6f | Analyze and fix the following issue in the Linux kernel code: i915: signedness bug in check_overlay_src() | Problem Details:
"depth" should be signed in case packed_depth_bytes() returns -EINVAL.
This probably doesn't make a difference at runtime. In the original
code we would return -EINVAL later if (rec->offset_Y % 4294967274) is
non-zero.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Chris Wilson <chr... | ```diff
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c
index afb96d25219a..02ff0a481f47 100644
--- a/drivers/gpu/drm/i915/intel_overlay.c
+++ b/drivers/gpu/drm/i915/intel_overlay.c
@@ -946,7 +946,9 @@ static int check_overlay_src(struct drm_device *dev,
{
int uv_hscale = uv_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.