id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
9b00147d9f2ba137ce74b66b768a8312be0b6781
Analyze and fix the following issue in the Linux kernel code: drm/radeon: fix regression in UMS CS ioctl
Problem Details: radeon_cs_parser_init is called by both the legacy UMS CS ioctl and the KMS CS ioctl. Protect KMS specific pieces of the code by checking that rdev is not NULL. Reported-by: Michael Burian <michael.burian@sbg.at> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jerome Glisse <jgl...
```diff diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 0137689ed461..142f89462aa4 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -147,6 +147,7 @@ static int radeon_cs_sync_rings(struct radeon_cs_parser *p) sync_to_ring, p-...
0824db38e515644f8d1bfd64adbd7cb2c6ea7c62
Analyze and fix the following issue in the Linux kernel code: drm/vmwgfx: Fix nasty write past alloced memory area
Problem Details: Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c index 51c9ba5cd2fb..21ee78226560 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_gmr.c @@ -66,7 +66,7 @@ static int vmw_gmr2_bind(struct vmw_private *dev_priv, cmd += sizeof(remap_cmd) /...
a8ff3ee211fccf708e1911bbc096625453ebf759
Analyze and fix the following issue in the Linux kernel code: drm/ttm: Fix spinlock imbalance
Problem Details: This imbalance may cause hangs when TTM is trying to swap out a buffer that is already on the delayed delete list. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 36792bd4da77..b67cfcaa661f 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1834,6 +1834,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) spin_unlock(&glob->lru_lock); (void) ttm_b...
66be71ff477389ff12c9c43dc6ee176cf8e1dd3a
Analyze and fix the following issue in the Linux kernel code: ACPICA: Add FADT error message for GAS BitWidth overflow
Problem Details: Error for possible overflow during conversion from 32-bit legacy register addresses to GAS format. The GAS struct contains a one-byte BitWidth field, meaning that the maximum length of a register is 255 bits. ACPICA BZ 953. https://www.acpica.org/bugzilla/show_bug.cgi?id=953 Signed-off-by: Bob Moore ...
```diff diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c index 4c9c760db4a4..d919f4055dba 100644 --- a/drivers/acpi/acpica/tbfadt.c +++ b/drivers/acpi/acpica/tbfadt.c @@ -49,9 +49,10 @@ ACPI_MODULE_NAME("tbfadt") /* Local prototypes */ -static ACPI_INLINE void +static void acpi_tb_init_gene...
c6e1733e6fc384ff1a219d7dfcb8b072030ae792
Analyze and fix the following issue in the Linux kernel code: ACPICA: iASL: Improved pathname support
Problem Details: For include files, merge the prefix pathname with the file pathname. Convert backslashes in all pathnames to forward slashes, for readability. Include file pathname changes affect both #include and Include() type operators. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <m...
```diff diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index 925ccf22101b..5035327ebccc 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h @@ -460,6 +460,8 @@ acpi_ut_short_divide(u64 in_dividend, /* * utmisc */ +void ut_convert_backslashes(char *pathname); +...
5134abfcfb4a8a9ef42c82dabad05762fbf04376
Analyze and fix the following issue in the Linux kernel code: ACPICA: Lint fixes for acpi_write, no functional changes
Problem Details: acpi_write was widened to 64-bit data, this change eliminates some lint warnings. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c index 29e859293edd..3680c45b0827 100644 --- a/drivers/acpi/acpica/hwesleep.c +++ b/drivers/acpi/acpica/hwesleep.c @@ -117,7 +117,8 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) /* Clear wake status (WAK_STS) */ ...
6af1c4fc5227af65092ebc848989693562bfa3e8
Analyze and fix the following issue in the Linux kernel code: ACPICA: AML Parser: Fix two possible memory leaks in error path
Problem Details: Fixes a couple of memory leaks in the error recovery path. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
```diff diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c index 5ac36aba507c..a683d6606e2e 100644 --- a/drivers/acpi/acpica/psargs.c +++ b/drivers/acpi/acpica/psargs.c @@ -618,6 +618,7 @@ static union acpi_parse_object *acpi_ps_get_next_field(struct acpi_parse_state arg = acpi_ps_alloc_op(...
53039f222c548bfc119eea6df4dca2b57550e271
Analyze and fix the following issue in the Linux kernel code: toshiba_acpi: Fix mis-merge
Problem Details: I managed to screw up the various backlight changes and ended up memsetting the props structure after it had already been populated. This should fix it. Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index f88b9d22f39e..dab10f6edcd4 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -1095,9 +1095,9 @@ static int __devinit toshiba_acpi_setup_backlight(struct toshiba_acpi_dev *dev)...
95c4b23ec4e2fa5604df229ddf134e31d7b3b378
Analyze and fix the following issue in the Linux kernel code: drm/radeon: fix HD6790, HD6570 backend programming
Problem Details: Without this bit sets we get broken rendering and lockups. fglrx sets this bit. Bugs that should be fixed by this patch : https://bugs.freedesktop.org/show_bug.cgi?id=49792 https://bugzilla.kernel.org/show_bug.cgi?id=43207 https://bugs.freedesktop.org/show_bug.cgi?id=39282 Signed-off-by: Jerome Glis...
```diff diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 0408ac27a863..6a57f0d4dae8 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -2178,9 +2178,9 @@ static void evergreen_gpu_init(struct radeon_device *rdev) WREG32(CC_SYS_RB_BACK...
29d654067a98c1cb8874c774e5fd799a038af8a6
Analyze and fix the following issue in the Linux kernel code: drm/radeon: fix bank information in tiling config
Problem Details: While there are cards with more than 8 mem banks, the max number of banks from a tiling perspective is 8, so cap the tiling config at 8 banks. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=43448 Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Signed-off-by: Da...
```diff diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 58991af90502..5d9c2c64a8e2 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -2136,9 +2136,12 @@ static void evergreen_gpu_init(struct radeon_device *rdev) /* num banks is 8 on ...
e22004235a900213625acd6583ac913d5a30c155
Analyze and fix the following issue in the Linux kernel code: libceph: rename kvec_reset and kvec_add functions
Problem Details: The functions ceph_con_out_kvec_reset() and ceph_con_out_kvec_add() are entirely private functions, so drop the "ceph_" prefix in their name to make them slightly more wieldy. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com> Reviewed-by: Sage Weil <sage@inkt...
```diff diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 545255823de2..2ca491fc50e2 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c @@ -486,14 +486,14 @@ static u32 get_global_seq(struct ceph_messenger *msgr, u32 gt) return ret; } -static void ceph_con_out_kvec_reset(struct ceph_connecti...
28c0254ede13ab575d2df5c6585ed3d4817c3e6b
Analyze and fix the following issue in the Linux kernel code: ceph: check PG_Private flag before accessing page->private
Problem Details: I got lots of NULL pointer dereference Oops when compiling kernel on ceph. The bug is because the kernel page migration routine replaces some pages in the page cache with new pages, these new pages' private can be non-zero. Signed-off-by: Zheng Yan <zheng.z.yan@intel.com> Signed-off-by: Sage Weil <sag...
```diff diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 173b1d22e59b..8b67304e4b80 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -54,7 +54,12 @@ (CONGESTION_ON_THRESH(congestion_kb) - \ (CONGESTION_ON_THRESH(congestion_kb) >> 2)) - +static inline struct ceph_snap_context *page_snap_context(struct pag...
dedc14e2a6e85b357c2274e03af354201e0b5626
Analyze and fix the following issue in the Linux kernel code: drm/cirrus: kick out conflicting framebuffers earlier
Problem Details: It appears that grub2 will pass framebuffer info via EFI, this causes the vram reserve to fail, so kick out efifb earlier before cirrus loads. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=826983 Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/cirrus/cirrus_drv.c b/drivers/gpu/drm/cirrus/cirrus_drv.c index d7038230b71e..7053140c6596 100644 --- a/drivers/gpu/drm/cirrus/cirrus_drv.c +++ b/drivers/gpu/drm/cirrus/cirrus_drv.c @@ -35,9 +35,28 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist) = { {0,} }; + +static void cirrus_k...
98fd81cd64674545a30a4f95388f086a626d37d2
Analyze and fix the following issue in the Linux kernel code: drm/i915: initialize the parity work only once
Problem Details: This fixes an (albeit really hard to hit) race resulting in an oops: - The parity work get scheduled. - We re-init the irq state and call INIT_WORK again. - The workqueue code tries to run the work item and stumbles over a work item that should be on it's runlist. Also initiliaze the work item uncon...
```diff diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 53356f44aba3..6553dcc2ca79 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -1723,10 +1723,6 @@ static void ironlake_irq_preinstall(struct drm_device *dev) atomic_set(&dev_priv->irq_rece...
95599968d19db175829fb580baa6b68939b320fb
Analyze and fix the following issue in the Linux kernel code: ext4: remove mb_groups before tearing down the buddy_cache
Problem Details: We can't have references held on pages in the s_buddy_cache while we are trying to truncate its pages and put the inode. All the pages must be gone before we reach clear_inode. This can only be gauranteed if we can prevent new users from grabbing references to s_buddy_cache's pages. The original bug...
```diff diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 3d9277c48bc8..1cd6994fc446 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2517,6 +2517,9 @@ int ext4_mb_release(struct super_block *sb) struct ext4_sb_info *sbi = EXT4_SB(sb); struct kmem_cache *cachep = get_groupinfo_cache(sb->s_blocksize...
5963e317b1e9d2a4511503916d8fd664bb8fa8fb
Analyze and fix the following issue in the Linux kernel code: ftrace/x86: Do not change stacks in DEBUG when calling lockdep
Problem Details: When both DYNAMIC_FTRACE and LOCKDEP are set, the TRACE_IRQS_ON/OFF will call into the lockdep code. The lockdep code can call lots of functions that may be traced by ftrace. When ftrace is updating its code and hits a breakpoint, the breakpoint handler will call into lockdep. If lockdep happens to cal...
```diff diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 320852d02026..7d65133b51be 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -190,6 +190,44 @@ ENDPROC(native_usergs_sysret64) #endif .endm +/* + * When dynamic function tracer is enabled it will add a break...
f8988175fd70874d1fb3712b1c5d3bfc6d455202
Analyze and fix the following issue in the Linux kernel code: x86: Allow nesting of the debug stack IDT setting
Problem Details: When the NMI handler runs, it checks if it preempted a debug handler and if that handler is using the debug stack. If it is, it changes the IDT table not to update the stack, otherwise it will reset the debug stack and corrupt the debug handler it preempted. Now that ftrace uses breakpoints to change ...
```diff diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 82f29e70d058..6b9333b429ba 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1101,14 +1101,20 @@ int is_debug_stack(unsigned long addr) addr > (__get_cpu_var(debug_stack_addr) - DEBUG_STKSZ)); } ...
c0525a6972d3f1fb83058ef503e183475d6e4e26
Analyze and fix the following issue in the Linux kernel code: x86: Reset the debug_stack update counter
Problem Details: When an NMI goes off and it sees that it preempted the debug stack, to keep the debug stack safe, it changes the IDT to point to one that does not modify the stack on breakpoint (to allow breakpoints in NMIs). But the variable that gets set to know to undo it on exit never gets cleared on exit. Thus e...
```diff diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index 90875279ef3d..a0b2f84457be 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c @@ -444,14 +444,16 @@ static inline void nmi_nesting_preprocess(struct pt_regs *regs) */ if (unlikely(is_debug_stack(regs->sp))) { debug_stack_set_ze...
0a4dd35c67b144d8ef9432120105f1aab9293ee9
Analyze and fix the following issue in the Linux kernel code: kconfig: update compression algorithm info
Problem Details: There have been new compression algorithms added without updating nearby relevant descriptive text that refers to (a) the number of compression algorithms and (b) the most recent one. Fix these inconsistencies. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Reported-by: <qasdfgtyuiop@gmail.com> C...
```diff diff --git a/init/Kconfig b/init/Kconfig index 81816b82860b..7dca2cebec99 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -167,7 +167,7 @@ config KERNEL_BZIP2 depends on HAVE_KERNEL_BZIP2 help Its compression ratio and speed is intermediate. - Decompression speed is slowest among the three. The kerne...
d97b46a64674a267bc41c9e16132ee2a98c3347d
Analyze and fix the following issue in the Linux kernel code: syscalls, x86: add __NR_kcmp syscall
Problem Details: While doing the checkpoint-restore in the user space one need to determine whether various kernel objects (like mm_struct-s of file_struct-s) are shared between tasks and restore this state. The 2nd step can be solved by using appropriate CLONE_ flags and the unshare syscall, while there's currently n...
```diff diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index 29f9f0554f7d..7a35a6e71d44 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl @@ -355,3 +355,4 @@ 346 i386 setns sys_setns 347 i386 process_vm_readv sys_process_vm_readv compat_sys_proce...
00c10bc13cdb58447d6bb2a003afad7bd60f5a5f
Analyze and fix the following issue in the Linux kernel code: pidns: make killed children autoreap
Problem Details: Force SIGCHLD handling to SIG_IGN so that signals are not generated and so that the children autoreap. This increases the parallelize and in general the speed of network namespace shutdown. Note self reaping childrean can exist past zap_pid_ns_processess but they will all be reaped before we allow th...
```diff diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index 57bc1fd35b3c..fd3c44986191 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -149,7 +149,12 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) { int nr; int rc; - struct task_struct *task; + struct task_struct *tas...
ce2d52cc1364a22fc1a161781e60ee3cbb499a6d
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue: add rbtree node caching support
Problem Details: When I wrote the first patch that added the rbtree support for message queue insertion, it sped up the case where the queue was very full drastically from the original code. It, however, slowed down the case where the queue was empty (not drastically though). This patch caches the last freed rbtree n...
```diff diff --git a/ipc/mqueue.c b/ipc/mqueue.c index af1692556c52..8ce57691e7b6 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -69,6 +69,7 @@ struct mqueue_inode_info { wait_queue_head_t wait_q; struct rb_root msg_tree; + struct posix_msg_tree_node *node_cache; struct mq_attr attr; struct sigevent notify...
7820b0715b6fb1378fab41b27fb7aa3950852cb7
Analyze and fix the following issue in the Linux kernel code: tools/selftests: add mq_perf_tests
Problem Details: Add the mq_perf_tests tool I used when creating my mq performance patch. Also add a local .gitignore to keep the binaries from showing up in git status output. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Doug Ledford <dledford@redhat.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc...
```diff diff --git a/tools/testing/selftests/mqueue/.gitignore b/tools/testing/selftests/mqueue/.gitignore new file mode 100644 index 000000000000..d8d42377205a --- /dev/null +++ b/tools/testing/selftests/mqueue/.gitignore @@ -0,0 +1,2 @@ +mq_open_tests +mq_perf_tests diff --git a/tools/testing/selftests/mqueue/Makefil...
113289cc086f80f28acd06f160a7c6423cdd4191
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue: strengthen checks on mqueue creation
Problem Details: We already check the mq attr struct if it's passed in, but now that the admin can set system wide defaults separate from maximums, it's actually possible to set the defaults to something that would overflow. So, if there is no attr struct passed in to the open call, check the default values. While we...
```diff diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 076399ce363a..af1692556c52 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -680,26 +680,26 @@ static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr) unsigned long total_size; if (attr->mq_maxmsg <= 0 || attr->mq_msgsize <= 0) - return 0; +...
2c12ea498f349207c28840c0ed9654321aab7720
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue: correct mq_attr_ok test
Problem Details: While working on the other parts of the mqueue stuff, I noticed that the calculation for overflow in mq_attr_ok didn't actually match reality (this is especially true since my last patch which changed how we account memory slightly). In particular, we used to test for overflow using: msgs * msgsize ...
```diff diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 3c72a05dc326..076399ce363a 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -676,6 +676,9 @@ static void remove_notification(struct mqueue_inode_info *info) static int mq_attr_ok(struct ipc_namespace *ipc_ns, struct mq_attr *attr) { + int mq_treesize; + unsigned...
d6629859b36d953a4b1369b749f178736911bf10
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue: improve performance of send/recv
Problem Details: The existing implementation of the POSIX message queue send and recv functions is, well, abysmal. Even worse than abysmal. I submitted a patch to increase the maximum POSIX message queue limit to 65536 due to customer needs, however, upon looking over the send/recv implementation, I realized that my ...
```diff diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 609d53f7a915..3c72a05dc326 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -50,6 +50,12 @@ #define STATE_PENDING 1 #define STATE_READY 2 +struct posix_msg_tree_node { + struct rb_node rb_node; + struct list_head msg_list; + int priority; +}; + struct ext_wa...
5b5c4d1a1440e94994c73dddbad7be0676cd8b9a
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue: update maximums for the mqueue subsystem
Problem Details: Commit b231cca4381e ("message queues: increase range limits") changed the maximum size of a message in a message queue from INT_MAX to 8192*128. Unfortunately, we had customers that relied on a size much larger than 8192*128 on their production systems. After reviewing POSIX, we found that it is silen...
```diff diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index bde094ee7b0e..6e1dd08194fd 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h @@ -90,18 +90,41 @@ static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {} #ifdef CONFIG_POSIX_MQUEUE exter...
858ee3784e8105467f1f3017f4ece51cb51d4830
Analyze and fix the following issue in the Linux kernel code: ipc/mqueue: switch back to using non-max values on create
Problem Details: Commit b231cca4381e ("message queues: increase range limits") changed how we create a queue that does not include an attr struct passed to open so that it creates the queue with whatever the maximum values are. However, if the admin has set the maximums to allow flexibility in creating a queue (aka, bo...
```diff diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 1372b566e1e1..bde094ee7b0e 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h @@ -95,9 +95,11 @@ extern int mq_init_ns(struct ipc_namespace *ns); #define DFLT_QUEUESMAX 256 /* max number of message ...
137d1a26c842a384c98dd2a6a605014fddf5c777
Analyze and fix the following issue in the Linux kernel code: um: fix possible race on task->mm
Problem Details: Checking for task->mm is dangerous as ->mm might disappear (exit_mm() assigns NULL under task_lock(), so tasklist lock is not enough). We can't use get_task_mm()/mmput() pair as mmput() might sleep, so let's take the task lock while we care about its mm. Note that we should also use find_lock_task_mm...
```diff diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 66d754c46e7b..1411f4e79f9a 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c @@ -25,10 +25,13 @@ static void kill_off_processes(void) read_lock(&tasklist_lock); for_each_process(p) { - if (p->mm == NULL) + task_loc...
af1be5a578a1ccc9961c55290f8c509a00a69036
Analyze and fix the following issue in the Linux kernel code: blackfin: fix possible deadlock in decode_address()
Problem Details: Oleg Nesterov found an interesting deadlock possibility: > sysrq_showregs_othercpus() does smp_call_function(showacpu) > and showacpu() show_stack()->decode_address(). Now suppose that IPI > interrupts the task holding read_lock(tasklist). To fix this, blackfin should not grab the write_ variant of t...
```diff diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c index d08f0e3e2dcc..f7f7a18abca9 100644 --- a/arch/blackfin/kernel/trace.c +++ b/arch/blackfin/kernel/trace.c @@ -29,7 +29,7 @@ void decode_address(char *buf, unsigned long address) { struct task_struct *p; struct mm_struct *mm; - uns...
2214f707de257c35773d5cd68cec9e31b91e01ca
Analyze and fix the following issue in the Linux kernel code: blackfin: a couple of task->mm handling fixes
Problem Details: The patch fixes two problems: 1. Working with task->mm w/o getting mm or grabing the task lock is dangerous as ->mm might disappear (exit_mm() assigns NULL under task_lock(), so tasklist lock is not enough). We can't use get_task_mm()/mmput() pair as mmput() might sleep, so we have to tak...
```diff diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin/kernel/trace.c index 44bbf2f564cb..d08f0e3e2dcc 100644 --- a/arch/blackfin/kernel/trace.c +++ b/arch/blackfin/kernel/trace.c @@ -10,6 +10,8 @@ #include <linux/hardirq.h> #include <linux/thread_info.h> #include <linux/mm.h> +#include <linux/oom.h> +#in...
1198c8b9af611bb697d92259095d7cc20f5c961d
Analyze and fix the following issue in the Linux kernel code: sh: use clear_tasks_mm_cpumask()
Problem Details: Checking for process->mm is not enough because process' main thread may exit or detach its mm via use_mm(), but other threads may still have a valid mm. To fix this we would need to use find_lock_task_mm(), which would walk up all threads and returns an appropriate task (with task lock held). clear_t...
```diff diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index b86e9ca79455..2062aa88af41 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c @@ -123,7 +123,6 @@ void native_play_dead(void) int __cpu_disable(void) { unsigned int cpu = smp_processor_id(); - struct task_struct *p; int ret; ret ...
73863ab028579ed98c4f1f36d016536b1b415344
Analyze and fix the following issue in the Linux kernel code: powerpc: use clear_tasks_mm_cpumask()
Problem Details: Current CPU hotplug code has some task->mm handling issues: 1. Working with task->mm w/o getting mm or grabing the task lock is dangerous as ->mm might disappear (exit_mm() assigns NULL under task_lock(), so tasklist lock is not enough). We can't use get_task_mm()/mmput() pair as mmput() mig...
```diff diff --git a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c index 5b63bd3da4a9..e779642c25e5 100644 --- a/arch/powerpc/mm/mmu_context_nohash.c +++ b/arch/powerpc/mm/mmu_context_nohash.c @@ -333,9 +333,7 @@ static int __cpuinit mmu_context_cpu_notify(struct notifier_block *self, ...
3eaa73bde2fb475b731a0fde7dd11c3ecfb8679c
Analyze and fix the following issue in the Linux kernel code: arm: use clear_tasks_mm_cpumask()
Problem Details: Checking for process->mm is not enough because process' main thread may exit or detach its mm via use_mm(), but other threads may still have a valid mm. To fix this we would need to use find_lock_task_mm(), which would walk up all threads and returns an appropriate task (with task lock held). clear_t...
```diff diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index b735521a4a54..2c7217d971db 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -109,7 +109,6 @@ static void percpu_timer_stop(void); int __cpu_disable(void) { unsigned int cpu = smp_processor_id(); - struct task_struct *p; int ...
2344bec788b097b2d1198758bd29c583812b864e
Analyze and fix the following issue in the Linux kernel code: proc: use mm_access() instead of ptrace_may_access()
Problem Details: mm_access() handles this much better, and avoids some race conditions. Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-o...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index cca635d252d4..155dee600ed4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2022,11 +2022,8 @@ static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd) if (!task) goto out_notask; - if (!ptrace_may_access(task, PTRACE_MODE_READ)...
b409e578d9a4ec95913e06d8fea2a33f1754ea69
Analyze and fix the following issue in the Linux kernel code: proc: clean up /proc/<pid>/environ handling
Problem Details: Similar to e268337dfe26 ("proc: clean up and fix /proc/<pid>/mem handling"), move the check of permission to open(), this will simplify read() code. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Alexey Dobriyan...
```diff diff --git a/fs/proc/base.c b/fs/proc/base.c index d7d711876b6a..e2d234243269 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -679,7 +679,7 @@ static const struct file_operations proc_single_file_operations = { .release = single_release, }; -static int mem_open(struct inode* inode, struct file* file) +...
43e13cc107cf6cd3c15fbe1cef849435c2223d50
Analyze and fix the following issue in the Linux kernel code: cred: remove task_is_dead() from __task_cred() validation
Problem Details: Commit 8f92054e7ca1 ("CRED: Fix __task_cred()'s lockdep check and banner comment"): add the following validation condition: task->exit_state >= 0 to permit the access if the target task is dead and therefore unable to change its own credentials. OK, but afaics currently this can...
```diff diff --git a/include/linux/cred.h b/include/linux/cred.h index 917dc5aeb1d4..ebbed2ce6637 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -277,17 +277,13 @@ static inline void put_cred(const struct cred *_cred) * @task: The task to query * * Access the objective credentials of a task. The...
9b3c98cd663750c33434572ff76ba306505eba5a
Analyze and fix the following issue in the Linux kernel code: kmod.c: fix kernel-doc warning
Problem Details: Warning(kernel/kmod.c:419): No description found for parameter 'depth' Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/kmod.c b/kernel/kmod.c index 1f596e4de306..ff2c7cb86d77 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -409,7 +409,7 @@ EXPORT_SYMBOL_GPL(usermodehelper_read_unlock); /** * __usermodehelper_set_disable_depth - Modify usermodehelper_disabled. - * depth: New value to assign to usermode...
a1d494495c69ef0810cd008f59310d2b9db28e36
Analyze and fix the following issue in the Linux kernel code: pipe: return -ENOIOCTLCMD instead of -EINVAL on unknown ioctl command
Problem Details: As described in commit 07d106d0a33d ("vfs: fix up ENOIOCTLCMD error handling"), drivers should return -ENOIOCTLCMD if they receive an ioctl command which they don't understand. Doing so will result in -ENOTTY being returned to userspace, which matches the behaviour of the compat layer if it fails to t...
```diff diff --git a/fs/pipe.c b/fs/pipe.c index fec5e4ad071a..95ebb56de494 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -693,7 +693,7 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return put_user(count, (int __user *)arg); default: - return -EINVAL; + return -ENOIOCTLCMD; ...
133fd9f5cda2d86904126f4b9fa4e8f4330c9569
Analyze and fix the following issue in the Linux kernel code: vsprintf: further optimize decimal conversion
Problem Details: Previous code was using optimizations which were developed to work well even on narrow-word CPUs (by today's standards). But Linux runs only on 32-bit and wider CPUs. We can use that. First: using 32x32->64 multiply and trivial 32-bit shift, we can correctly divide by 10 much larger numbers, and thu...
```diff diff --git a/include/asm-generic/bitsperlong.h b/include/asm-generic/bitsperlong.h index 4ae54e07de83..a7b0914348fd 100644 --- a/include/asm-generic/bitsperlong.h +++ b/include/asm-generic/bitsperlong.h @@ -28,5 +28,9 @@ #error Inconsistent word size. Check asm/bitsperlong.h #endif +#ifndef BITS_PER_LONG_LO...
725fe002d315c2501c110b7245d3eb4f4535f4d6
Analyze and fix the following issue in the Linux kernel code: vsprintf: correctly handle width when '#' flag used in %#p format
Problem Details: The '%p' output of the kernel's vsprintf() uses spec.field_width to determine how many digits to output based on 2 * sizeof(void*) so that all digits of a pointer are shown. ie. a pointer will be output as "001A2B3C" instead of "1A2B3C". However, if the '#' flag is used in the format (%#p), then the...
```diff diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 5391299c1e78..b8fbd275bc46 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -870,13 +870,15 @@ static noinline_for_stack char *pointer(const char *fmt, char *buf, char *end, void *ptr, struct printf_spec spec) { + int default_width = 2 * sizeof(voi...
d84970bbaf9a09b3fc60c18ee6d59bc9cb4c3b8a
Analyze and fix the following issue in the Linux kernel code: kernel/cpu_pm.c: fix various typos
Problem Details: Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Colin Cross <ccross@android.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/cpu_pm.c b/kernel/cpu_pm.c index 249152e15308..9656a3c36503 100644 --- a/kernel/cpu_pm.c +++ b/kernel/cpu_pm.c @@ -81,7 +81,7 @@ int cpu_pm_unregister_notifier(struct notifier_block *nb) EXPORT_SYMBOL_GPL(cpu_pm_unregister_notifier); /** - * cpm_pm_enter - CPU low power entry notifier + ...
97fd75b7b8e0f4e6d3f06b819c89b2555f626fcf
Analyze and fix the following issue in the Linux kernel code: kernel/irq/manage.c: use the pr_foo() infrastructure to prefix printks
Problem Details: Use the module-wide pr_fmt() mechanism rather than open-coding "genirq: " everywhere. Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index bb32326afe87..7c475cd3f6e6 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -7,6 +7,8 @@ * This file contains driver APIs to the irq subsystem. */ +#define pr_fmt(fmt) "genirq: " fmt + #include <linux/irq.h> #include <linux/kthrea...
a3860c1c5dd1137db23d7786d284939c5761d517
Analyze and fix the following issue in the Linux kernel code: introduce SIZE_MAX
Problem Details: ULONG_MAX is often used to check for integer overflow when calculating allocation size. While ULONG_MAX happens to work on most systems, there is no guarantee that `size_t' must be the same size as `long'. This patch introduces SIZE_MAX, the maximum value of `size_t', to improve portability and reada...
```diff diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index f04c0961f993..e5206fc76562 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -331,7 +331,7 @@ static int build_snap_context(struct ceph_snap_realm *realm) /* alloc new snap context */ err = -ENOMEM; - if (num > (ULONG_MAX - sizeof(*snapc)) / sizeof(u64)...
6eccece90b6addf80ef9e6db79b0bc873301034b
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix, consolidate client_has_state
Problem Details: Whoops: first, I reimplemented the already-existing has_resources without noticing; second, I got the test backwards. I did pick a better name, though. Combine the two.... Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c91e26d84f06..0a6901d45349 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1537,9 +1537,9 @@ static bool client_has_state(struct nfs4_client *clp) * * Also note we should probably be using this in 4.0 case too. */ - return list...
0f1ba0ef213193aecf9baf8b4a3919cff4907e5d
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix exchange_id to return confirm flag
Problem Details: Otherwise nfsd4_set_ex_flags writes over the return flags. Reported-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e4d9b56a770a..83a68983aa26 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1617,7 +1617,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, goto expire_client; } if (verfs_match) { /* case 2 */ - exid->flags |= EXCHGID4_FLAG_CONF...
7447758be712e891aa4c57f8fa11902ccfdff151
Analyze and fix the following issue in the Linux kernel code: nfsd4: clarify that renewing expired client is a bug
Problem Details: This can't happen: - cl_time is zeroed only by unhash_client_locked, which is only ever called under both the state lock and the client lock. - every caller of renew_client() should have looked up a (non-expired) client and then called renew_client() all without dropping the state lock. - t...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 991a8a7414f7..e4d9b56a770a 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1022,7 +1022,8 @@ static inline void renew_client_locked(struct nfs4_client *clp) { if (is_client_expired(clp)) { - dprintk("%s: client (clientid %08x/%08x)...
8695b90ac3c37278010c76ab3680f35ab358caf9
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix error return in non-matching-creds case
Problem Details: Note CLID_INUSE is for the case where two clients are trying to use the same client-provided long-form client identifiers. But what we're looking at here is the server-returned shorthand client id--if those clash there's a bug somewhere. Fix the error return, pull the check out into common code, and ...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 0f108f68da77..8a1dfb20a3de 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2229,59 +2229,49 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, if (STALE_CLIENTID(clid)) return nfserr_stale_clientid; - /* - * XXX The Duplicate...
788c1eba50133777df5ca2972cda3c9a8f78f52f
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix setclientid_confirm same_cred check
Problem Details: New clients are created only by nfsd4_setclientid(), which always gives any new client a unique clientid. The only exception is in the "callback update" case, in which case it may create an unconfirmed client with the same clientid as a confirmed client. In that case it also checks that the confirmed...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 9d7e3eb0f5db..0f108f68da77 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2243,7 +2243,7 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, status = nfserr_clid_inuse; if (conf && unconf && same_verf(&confirm, &unconf->cl_confirm...
3ddbe8794ff1bcba5af09f2e6949755d6251958f
Analyze and fix the following issue in the Linux kernel code: svcrpc: fix a comment typo
Problem Details: Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 8195c6acba12..37a1f664d108 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -976,7 +976,7 @@ void svc_close_net(struct svc_serv *serv, struct net *net) svc_clear_pools(serv, net); /* * At this point the sp_sockets lists wil...
8dbf28e495337b0c66657e3e278ae0ff175b7140
Analyze and fix the following issue in the Linux kernel code: LockD: add debug message to start and stop functions
Problem Details: Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index b47bf7755008..80938fda67e0 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c @@ -266,6 +266,7 @@ static int lockd_up_net(struct svc_serv *serv, struct net *net) error = make_socks(serv, net); if (error < 0) goto err_socks; + dprintk("lockd_up_net: per-net...
91c427ac3a61ccabae0fdef53563edf40394b6c9
Analyze and fix the following issue in the Linux kernel code: sunrpc: do array overrun check in svc_recv before allocating pages
Problem Details: There's little point in waiting until after we allocate all of the pages to see if we're going to overrun the array. In the event that this calculation is really off we could end up scribbling over a bunch of memory and make it tougher to debug. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-o...
```diff diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 4bda09d7e1a4..8195c6acba12 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -601,6 +601,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) /* now allocate needed pages. If we get a failure, sleep briefly */ pages = (se...
e7a0444aef4a1649bc155fd5c6d6ab3f8bdc88ab
Analyze and fix the following issue in the Linux kernel code: nfsd: add IPv6 addr escaping to fs_location hosts
Problem Details: The fs_location->hosts list is split on colons, but this doesn't work when IPv6 addresses are used (they contain colons). This patch adds the function nfsd4_encode_components_esc() to allow the caller to specify escape characters when splitting on 'sep'. In order to fix referrals, this patch must be us...
```diff diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 61555e756410..30817e9f1bb7 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1744,15 +1744,16 @@ static void encode_seqid_op_tail(struct nfsd4_compoundres *resp, __be32 *save, _ } /* Encode as an array of strings the string given with compone...
45eaa1c1a16122a98bf995c004c23806759d2e5f
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix change attribute endianness
Problem Details: Though actually this doesn't matter much, as NFSv4.0 clients are required to treat the change attribute as opaque. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index f839be1a202c..61555e756410 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1674,12 +1674,12 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) static void write32(__be32 **p, u32 n) { - *(*p)++ = n; + *(*p)++ = htonl(n); } static...
d1829b38241394c0c66d407a165fbd6d9897c241
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix free_stateid return endianness
Problem Details: Cc: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index f7cc41144dc1..f839be1a202c 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3362,7 +3362,7 @@ nfsd4_encode_destroy_session(struct nfsd4_compoundres *resp, __be32 nfserr, } static __be32 -nfsd4_encode_free_stateid(struct nfsd4_compoundres *re...
57b7b43b403136dc18d067909050e8677f97aeed
Analyze and fix the following issue in the Linux kernel code: nfsd4: int/__be32 fixes
Problem Details: In each of these cases there's a simple unambiguous correct choice, and no actual bug. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 3ccebdc4812c..064f61acfe00 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -886,7 +886,7 @@ static struct nfsd4_session *alloc_init_session(struct svc_rqst *rqstp, struct n struct nfsd4_session *new; struct nfsd4_channel_attrs *fchan...
2355c59644def5950f982fc1509dd45037e79ded
Analyze and fix the following issue in the Linux kernel code: nfsd4: fix missing "static"
Problem Details: Signed-off-by: J. Bruce Fields <bfields@redhat.com>
```diff diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index dcb52b884519..ec16364f782e 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -706,7 +706,7 @@ static struct cache_head *svc_export_alloc(void) return NULL; } -struct cache_detail svc_export_cache_template = { +static struct cache_detail svc_expo...
cc9b17ad29ecaa20bfe426a8d4dbfb94b13ff1cc
Analyze and fix the following issue in the Linux kernel code: net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
Problem Details: We need to validate the number of pages consumed by data_len, otherwise frags array could be overflowed by userspace. So this patch validate data_len and return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. M...
```diff diff --git a/net/core/sock.c b/net/core/sock.c index 653f8c0aedc5..9e5b71fda6ec 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -1592,6 +1592,11 @@ struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, gfp_t gfp_mask; long timeo; int err; + int npages = (data_len + (PAGE_SI...
0cfd32b736ae0c36b42697584811042726c07cba
Analyze and fix the following issue in the Linux kernel code: bql: Fix POSDIFF() to integer overflow aware.
Problem Details: POSDIFF() fails to take into account integer overflow case. Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> Cc: Tom Herbert <therbert@google.com> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: Denys Fedoryshchenko <denys@visp.net.lb> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by...
```diff diff --git a/lib/dynamic_queue_limits.c b/lib/dynamic_queue_limits.c index 6ab4587d052b..c87eb76f2fd4 100644 --- a/lib/dynamic_queue_limits.c +++ b/lib/dynamic_queue_limits.c @@ -10,7 +10,7 @@ #include <linux/jiffies.h> #include <linux/dynamic_queue_limits.h> -#define POSDIFF(A, B) ((A) > (B) ? (A) - (B) : ...
401453a31ea8192eb94f9337f5608de907681bfb
Analyze and fix the following issue in the Linux kernel code: net/mlx4_core: Fix obscure mlx4_cmd_box parameter in QUERY_DEV_CAP
Problem Details: The "!mlx4_is_slave" is totally confusing. Fix with constant MLX4_CMD_NATIVE, which is the intended behavior. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 7f2a4a659627..9c83bb8151ea 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c @@ -412,7 +412,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap ...
6230bb234dd17b4c92518e848368ce03f9802323
Analyze and fix the following issue in the Linux kernel code: net/mlx4_core: Check port out-of-range before using in mlx4_slave_cap
Problem Details: The range check was performed after using the port number. Reverse this to prevent a potential array overflow. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 7f71be0ca5f2..ee6f4fe00837 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -485,15 +485,15 @@ static int mlx4_slave_cap(struct mlx4_dev *dev) dev->...
b91cb3ebcd5ef8db956b8caa486d780dc52b07f1
Analyze and fix the following issue in the Linux kernel code: net/mlx4_core: Fixes for VF / Guest startup flow
Problem Details: - pass the following parameters: - firmware version (added QUERY_FW paravirtualization for that) - disable Blueflame on slaves. KVM disables write combining on guests, and we get better performance without BF in this case. (This requires QUERY_DEV_CAP paravirtualization, also in this commi...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 1bcead1fa2f6..842c8ce9494e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c @@ -617,7 +617,7 @@ static struct mlx4_cmd_info cmd_info[] = { .out_is_imm = f...
13bf58b7604d9adfebb8b7c95e6cfb31ec17c699
Analyze and fix the following issue in the Linux kernel code: net/mlx4_en: Fix improper use of "port" parameter in mlx4_en_event
Problem Details: Port is used as an array index before we know if that is proper. For example, in the catas event case, port is zero; however, the port index should lie in the range (1..2). Fix this by using 'port' only in the events where it is of interest. Test for port out of range in the default (unhandled event...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c index 988b2424e1c6..69ba57270481 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c @@ -136,13 +136,12 @@ static void mlx4_en_event(struct mlx4_dev *...
3fc929e2d693185aac2686e5e64e24eae10642a4
Analyze and fix the following issue in the Linux kernel code: net/mlx4_core: Fix number of EQs used in ICM initialisation
Problem Details: In SRIOV mode, the number of EQs used when computing the total ICM size was incorrect. To fix this, we do the following: 1. We add a new structure to mlx4_dev, mlx4_phys_caps, to contain physical HCA capabilities. The PPF uses the phys capabilities when it computes things like ICM size. The...
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 2e024a68fa81..2fe9fe5f7cfb 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -142,12 +142,6 @@ struct mlx4_port_config { struct pci_dev *pdev; }; ...
30f7c73bed749814f4985b1ce4566fe64b9c25f0
Analyze and fix the following issue in the Linux kernel code: net/mlx4_core: Fix the slave_id out-of-range test in mlx4_eq_int
Problem Details: Ths fixes the comparison in the FLR (Function Level Reset) event case. Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 3b6f8efbf141..bce98d9c0039 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c @@ -426,7 +426,7 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq) ...
b3b02ae5865c2dcd506322e0fc6def59a042e72f
Analyze and fix the following issue in the Linux kernel code: NFSv4.1: Fix a request leak on the back channel
Problem Details: If the call to svc_process_common() fails, then the request needs to be freed before we can exit bc_svc_process. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org
```diff diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 017c0117d154..074df5a564db 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c @@ -1377,7 +1377,8 @@ bc_svc_process(struct svc_serv *serv, struct rpc_rqst *req, sizeof(req->rq_snd_buf)); return bc_send(req); } else { - /* Nothing to do to drop...
fde86d310886372a377213251e72fb87aaa406c9
Analyze and fix the following issue in the Linux kernel code: tty: add lockdep annotations
Problem Details: tty_lock_pair() do the right thing to avoid deadlocks, but should instruct LOCKDEP of this to avoid a splat. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
```diff diff --git a/drivers/tty/tty_mutex.c b/drivers/tty/tty_mutex.c index 69adc80c98cd..67feac9e6ebb 100644 --- a/drivers/tty/tty_mutex.c +++ b/drivers/tty/tty_mutex.c @@ -6,11 +6,17 @@ /* Legacy tty mutex glue */ +enum { + TTY_MUTEX_NORMAL, + TTY_MUTEX_NESTED, +}; + /* * Getting the big tty mutex. */ -v...
050eff39af6a395104df85b7ca59f0a4245e04f8
Analyze and fix the following issue in the Linux kernel code: acer-wmi: add 3 laptops to video backlight vendor mode quirk table
Problem Details: Acer Extensa 5235, TravelMate 5760 and Aspire 5750 laptop have broken _BCM implemenation, the AML code wrote value to EC register but firmware didn't change brighenss. Fortunately, the brightness control works on those machines with vendor mode. So, add this machine to video backlight vendor mode quir...
```diff diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index c1a3fd8e1243..ce875dc365e5 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -523,6 +523,30 @@ static const struct dmi_system_id video_vendor_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "...
ae188715ac3215f33ea6a8b829529225bf67deaa
Analyze and fix the following issue in the Linux kernel code: sony-laptop: additional debug statements
Problem Details: Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 4420353cfb68..89e5cf9b1914 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -713,8 +713,13 @@ static union acpi_object *__call_snc_method(acpi_handle handle, char *method, par...
3398241b0567c662a6fcf7e61c72c74aa9cee3e8
Analyze and fix the following issue in the Linux kernel code: sony-laptop: fix return path when no ACPI buffer is allocated
Problem Details: The goto target location would still try to free a buffer that was never allocated. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index c6dc3f741ccd..455beeb98be1 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -1349,8 +1349,8 @@ static void sony_nc_rfkill_setup(struct acpi_device *device) device_enum = (uni...
a5c3892f56df57e2e1c0a069d72d1b20a1db202d
Analyze and fix the following issue in the Linux kernel code: ideapad: remove unused define and fix a typo
Problem Details: After review the current ideapad-laptop, found an unused define and a typo. Signed-off-by: Ike Panhc <ike.pan@canonical.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index ac902f7a9baa..00d82f168c58 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -194,7 +194,6 @@ static int write_ec_cmd(acpi_handle handle, int cmd, unsigned long data) ...
e4332e8e69e31cf6e6b1e17a1be25f5b8dde977e
Analyze and fix the following issue in the Linux kernel code: hdaps: Jesper Juhl: Fix outdated email address
Problem Details: I haven't had a working gmail address for many years - update to my actual working address. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/hdaps.c b/drivers/platform/x86/hdaps.c index 7387f97a2941..24a3ae065f1b 100644 --- a/drivers/platform/x86/hdaps.c +++ b/drivers/platform/x86/hdaps.c @@ -2,7 +2,7 @@ * hdaps.c - driver for IBM's Hard Drive Active Protection System * * Copyright (C) 2005 Robert Love <rml@no...
ff413195e830541afeae469fc866ecd0319abd7e
Analyze and fix the following issue in the Linux kernel code: thinkpad-acpi: fix issuing duplicated key events for brightness up/down
Problem Details: The tp_features.bright_acpimode will not be set correctly for brightness control because ACPI_VIDEO_HID will not be located in ACPI. As a result, a duplicated key event will always be sent. acpi_video_backlight_support() is sufficient to detect standard ACPI brightness control. Signed-off-by: Alex Hun...
```diff diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index d68c0002f4a2..8b5610d88418 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -3402,7 +3402,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) /* Do not iss...
bc7ab495c7532f06bc03021c0d78ac384fb13c14
Analyze and fix the following issue in the Linux kernel code: xo1-rfkill: only act when blocked state is changed
Problem Details: The XO-1 rfkill driver should only send EC commands when changing between blocked/unblocked state. The rfkill switch is asked to be unblocked on every resume (even when the card was never blocked before) and sending a EC_WLAN_LEAVE_RESET command here upsets the resume sequence of the libertas driver. ...
```diff diff --git a/drivers/platform/x86/xo1-rfkill.c b/drivers/platform/x86/xo1-rfkill.c index 41781ed8301c..b57ad8641480 100644 --- a/drivers/platform/x86/xo1-rfkill.c +++ b/drivers/platform/x86/xo1-rfkill.c @@ -15,15 +15,26 @@ #include <asm/olpc.h> +static bool card_blocked; + static int rfkill_set_block(void...
14b234b10544046544a81095c9ab372842f80eea
Analyze and fix the following issue in the Linux kernel code: fujitsu-tablet: correct quirks for Lifebook and Stylistic tablets
Problem Details: This patch adds a quirk to fix the dock detection for Fujitsu Stylistic devices and fixes an bug in which tablet mode state was not correctly reported in Fujitsu Lifebook and Stylistic models. Signed-off-by: Robert Gerlach <khnz@gmx.de> Signed-off-by: Matthew Garrett <mjg@redhat.com>
```diff diff --git a/drivers/platform/x86/fujitsu-tablet.c b/drivers/platform/x86/fujitsu-tablet.c index 8b74fdfc77cd..da267eae8ba8 100644 --- a/drivers/platform/x86/fujitsu-tablet.c +++ b/drivers/platform/x86/fujitsu-tablet.c @@ -36,7 +36,8 @@ #define ACPI_FUJITSU_CLASS "fujitsu" #define INVERT_TABLET_MODE_BIT ...
c31931088fd6cf953bd0868a2647b6c3928e6c96
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix tree mod log rewinded level and rewinding of moved keys
Problem Details: When we rewind REMOVE_WHILE_FREEING operations, there's code that allocates a fresh buffer instead of cloning the old one. Setting that buffer's level correctly was missing in this case. When rewinding a MOVE_KEYS operation, btrfs_node_key_ptr_offset(slot) was missing for memmove_extent_buffer()'s arg...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 63147c1315a7..b4534d918e42 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -1076,7 +1076,9 @@ __tree_mod_log_rewind(struct extent_buffer *eb, u64 time_seq, n--; break; case MOD_LOG_MOVE_KEYS: - memmove_extent_buffer(eb, tm->slot, tm->mo...
f395694c2cd76cb1882fa82dd37e761598367fe9
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix tree mod log del_ptr
Problem Details: Logging for del_ptr when we're not deleting the last pointer was wrong. This fixes both, duplicate log entries and log sequence. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c7c48489b963..63147c1315a7 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -540,9 +540,8 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, int ret; int i; - ret = tree_mod_alloc(fs_info, flags, &tm); - if (ret <= 0) - return ret; + i...
cb7225feec627e91d598198996429e9ee6804f8d
Analyze and fix the following issue in the Linux kernel code: perf: Remove duplicate invocation on perf_event_for_each
Problem Details: The @func callback was invoked twice for group leader when perf_event_for_each() called. It seems the commit 75f937f24bd9 ("perf_counter: Fix ctx->mutex vs counter ->mutex inversion") made the mistake during the change. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Acked-by: Peter Zijlstra <a.p.z...
```diff diff --git a/kernel/events/core.c b/kernel/events/core.c index 5b06cbbf6931..f85c0154b333 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -3181,7 +3181,6 @@ static void perf_event_for_each(struct perf_event *event, event = event->group_leader; perf_event_for_each_child(event, func); - func...
37073f9e449bc430e6c40b9cffc2558002a0256a
Analyze and fix the following issue in the Linux kernel code: perf evsel: Fix 32 bit values endianity swap for sample_id_all header
Problem Details: We swap the sample_id_all header by u64 pointers. Some members of the header happen to be 32 bit values. We need to handle them separatelly. Together with other endianity patches, this change fixies perf report discrepancies on origin and target systems as described in test 1 below, e.g. following per...
```diff diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 91d19138f3ec..9f6cebd798ee 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -494,16 +494,24 @@ int perf_evsel__open_per_thread(struct perf_evsel *evsel, } static int perf_event__parse_id_sample(const union perf_event *...
268fb20f832e1eb4afd5113ee31fef9332986b13
Analyze and fix the following issue in the Linux kernel code: perf session: Handle endianity swap on sample_id_all header data
Problem Details: Adding endianity swapping for event header attached via sample_id_all. Currently we dont do that and it's causing wrong data to be read when running report on architecture with different endianity than the record. The perf is currently able to process 32-bit PPC samples on 32-bit and 64-bit x86. Tog...
```diff diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 04d1e33f4592..2600916efa83 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -454,37 +454,65 @@ void mem_bswap_64(void *src, int byte_size) } } -static void perf_event__all64_swap(union perf_event *event) +stat...
8db4841fc72acc58254029f050226ea5f8103854
Analyze and fix the following issue in the Linux kernel code: perf symbols: Handle different endians properly during symbol load
Problem Details: Currently we dont care about the file object's endianness. It's possible we read buildid file object from different architecture than we are currentlly running on. So we need to care about properly reading such object's data - handle different endianness properly. Adding: needs_swap DSO field dso__s...
```diff diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index e2ba8858f3e1..9d04dcd91815 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -323,6 +323,7 @@ struct dso *dso__new(const char *name) dso->sorted_by_name = 0; dso->has_build_id = 0; dso->kernel = DSO_TYPE_USER; ...
114067b69e7b2c691faace0e33db2f04096f668d
Analyze and fix the following issue in the Linux kernel code: perf tools: Check if callchain is corrupted
Problem Details: We faced segmentation fault on perf top -G at very high sampling rate due to a corrupted callchain. While the root cause was not revealed (I failed to figure it out), this patch tries to protect us from the segfault on such cases. Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: ...
```diff diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index f32578634d9d..1817d4015e5f 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -555,6 +555,8 @@ enum perf_event_type { PERF_RECORD_MAX, /* non-ABI */ }; +#define PERF_MAX_STACK_DEPTH 255 + enum perf_callc...
9e612a008fa7fe493a473454def56aa321479495
Analyze and fix the following issue in the Linux kernel code: drm/i915/crt: Do not rely upon the HPD presence pin
Problem Details: Whilst most monitors do wire up the HPD presence pin, it seems quite a few KVM do not. Therefore if we simply rely on the HPD pin being asserted to indicate a connected monitor we fail miserable, so fall back to performing a DCC query for the EDID. Reported-and-tested-by: Matthieu LAVIE <boiteamadmax@...
```diff diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 75a70c46ef1b..844e93e1e395 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c @@ -453,13 +453,15 @@ intel_crt_detect(struct drm_connector *connector, bool force) struct intel_load_detect_pi...
3c9c708c9fc967e389f85bc735e4c1f65d67334e
Analyze and fix the following issue in the Linux kernel code: block: avoid infinite loop in get_task_io_context()
Problem Details: Calling get_task_io_context() on a exiting task which isn't %current can loop forever. This triggers at boot time on my dev machine. BUG: soft lockup - CPU#3 stuck for 22s ! [mountall.1603] Fix this by making create_task_io_context() returns -EBUSY in this case to break the loop. Signed-off-by: Eric...
```diff diff --git a/block/blk-ioc.c b/block/blk-ioc.c index 1e2d53b04858..893b8007c657 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -235,6 +235,7 @@ void ioc_clear_queue(struct request_queue *q) int create_task_io_context(struct task_struct *task, gfp_t gfp_flags, int node) { struct io_context *ioc; + int...
7c8d51848a88aafdb68f42b6b650c83485ea2f84
Analyze and fix the following issue in the Linux kernel code: crypto: aesni-intel - fix unaligned cbc decrypt for x86-32
Problem Details: The 32 bit variant of cbc(aes) decrypt is using instructions requiring 128 bit aligned memory locations but fails to ensure this constraint in the code. Fix this by loading the data into intermediate registers with load unaligned instructions. This fixes reported general protection faults related to a...
```diff diff --git a/arch/x86/crypto/aesni-intel_asm.S b/arch/x86/crypto/aesni-intel_asm.S index be6d9e365a80..3470624d7835 100644 --- a/arch/x86/crypto/aesni-intel_asm.S +++ b/arch/x86/crypto/aesni-intel_asm.S @@ -2460,10 +2460,12 @@ ENTRY(aesni_cbc_dec) pxor IN3, STATE4 movaps IN4, IV #else - pxor (INP), STATE2 ...
121daad8fd1dce63076fa55aaedd5dc3f981b334
Analyze and fix the following issue in the Linux kernel code: hwrng: atmel-rng - fix race condition leading to repeated bits
Problem Details: Data valid gets cleared by reading the ISR (status register) and NOT from reading ODATA (data register). A new data word can become available between checking ISR and reading ODATA, causing us to reuse the same data word next time atmel_trng_read() gets called, if that happens before the following data...
```diff diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c index f518b99f53f5..6289f0eee24c 100644 --- a/drivers/char/hw_random/atmel-rng.c +++ b/drivers/char/hw_random/atmel-rng.c @@ -36,6 +36,13 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max, /* data ready? ...
e36891900855b3bed5d9cc9209655e6dfa435a5f
Analyze and fix the following issue in the Linux kernel code: drm/i915: Dynamic Parity Detection handling
Problem Details: On IVB hardware we are given an interrupt whenever a L3 parity error occurs in the L3 cache. The L3 cache is used by internal GPU clients only. This is a very rare occurrence (in fact to test this I need to use specially instrumented silicon). When a row in the L3 cache detects a parity error the HW ...
```diff diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index a17e31e91951..504f53ee2f8a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -816,6 +816,8 @@ typedef struct drm_i915_private { struct drm_property *broadcast_rgb_property; struct drm_p...
5cd5d7c44990658df6ab49f6253c39617c53b03d
Analyze and fix the following issue in the Linux kernel code: ALSA: usb-audio: fix rate_list memory leak
Problem Details: The array of sample rates is reallocated every time when opening the PCM device, but was freed only once when unplugging the device. Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <t...
```diff diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 24839d932648..cdf8b7601973 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -788,6 +788,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime, int count = 0, needs_knot = 0; int err; + kfree(subs->rate_list.list); + subs->rate_list...
e602878fd89dab0af2af995a6bef0fbe97b20dc8
Analyze and fix the following issue in the Linux kernel code: mtip32xx: Fix to support more than one sector in exec_drive_command()
Problem Details: Fix to support more than one sector in exec_drive_command(). Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index bfee50d1b319..cd271d5e1b73 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -1890,13 +1890,33 @@ static int exec_drive_command(struct mtip_port *port, u8 *command, void __user *...
d02e1f0ad098b3b36853d639e9befeb273c63cc5
Analyze and fix the following issue in the Linux kernel code: mtip32xx: Fix to handle TFE for PIO(IOCTL/internal) commands
Problem Details: If a PIO (IOCTL/internal) command resulted in TFE, signal the wait event or break out of polling. Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 73d7caa3cae1..4e7275cb67b0 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -781,13 +781,24 @@ static void mtip_handle_tfe(struct driver_data *dd) /* Stop the timer to prevent co...
6bb688c048c9625030fc911dc93d49bcd15feb1f
Analyze and fix the following issue in the Linux kernel code: mtip32xx: fix clearing an incorrect register in mtip_init_port
Problem Details: Fix clearing an incorrect register in mtip_init_port Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
```diff diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 304000c3d433..0809e259b223 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -436,8 +436,7 @@ static void mtip_init_port(struct mtip_port *port) writel(0xFFFFFFFF, port->completed[...
aba336bd1d46d6b0404b06f6915ed76150739057
Analyze and fix the following issue in the Linux kernel code: md: raid1/raid10: fix problem with merge_bvec_fn
Problem Details: The new merge_bvec_fn which calls the corresponding function in subsidiary devices requires that mddev->merge_check_needed be set if any child has a merge_bvec_fn. However were were only setting that when a device was hot-added, not when a device was present from the start. This bug was introduced in...
```diff diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 835de7168cd3..a9c7981ddd24 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2550,6 +2550,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) err = -EINVAL; spin_lock_init(&conf->device_lock); rdev_for_each(rdev, mddev) { + stru...
4ad310b836d5c61ac6e9b5fd7db12d0cd57136d7
Analyze and fix the following issue in the Linux kernel code: ia64 perfmon: fix get_unmapped_area() use there
Problem Details: get_unmapped_area() returns -E... on failure, not 0. Moreover, the wrapper around it is completely pointless. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index f00ba025375d..d7f558c1e711 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -604,12 +604,6 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f) spin_unlock(&(x)->ctx_lock); } -static inline unsign...
46ce341b2f176c2611f12ac390adf862e932eb02
Analyze and fix the following issue in the Linux kernel code: pipe: return -ENOIOCTLCMD instead of -EINVAL on unknown ioctl command
Problem Details: As described in commit 07d106d0a ("vfs: fix up ENOIOCTLCMD error handling"), drivers should return -ENOIOCTLCMD if they receive an ioctl command which they don't understand. Doing so will result in -ENOTTY being returned to userspace, which matches the behaviour of the compat layer if it fails to trans...
```diff diff --git a/fs/pipe.c b/fs/pipe.c index fec5e4ad071a..95ebb56de494 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -693,7 +693,7 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return put_user(count, (int __user *)arg); default: - return -EINVAL; + return -ENOIOCTLCMD; ...
7732a557b1342c6e6966efb5f07effcf99f56167
Analyze and fix the following issue in the Linux kernel code: vfs: stop d_splice_alias creating directory aliases
Problem Details: A directory should never have more than one dentry pointing to it. But d_splice_alias() will add one if it finds a directory with an already-existing non-DISCONNECTED dentry. I can't find an obvious reproducer, but I also can't see what prevents d_splice_alias() from encountering such a case. It the...
```diff diff --git a/fs/dcache.c b/fs/dcache.c index 40469044088d..3d4be6f8e49e 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1650,9 +1650,8 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) if (inode && S_ISDIR(inode->i_mode)) { spin_lock(&inode->i_lock); - new = __d_find_alias(inod...
1ab46fd319bcf1fcd9fb6311727d532b580e4eba
Analyze and fix the following issue in the Linux kernel code: x86, amd, xen: Avoid NULL pointer paravirt references
Problem Details: Stub out MSR methods that aren't actually needed. This fixes a crash as Xen Dom0 on AMD Trinity systems. A bigger patch should be added to remove the paravirt machinery completely for the methods which apparently have no users! Reported-by: Andre Przywara <andre.przywara@amd.com> Link: http://lkml.k...
```diff diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 75f33b2a5933..e74df9548a02 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -1116,7 +1116,10 @@ static const struct pv_cpu_ops xen_cpu_ops __initconst = { .wbinvd = native_wbinvd, .read_msr = native_read_msr_safe...
2da06af8106f8f35318bb084baf8448797ef058a
Analyze and fix the following issue in the Linux kernel code: x86, mtrr: Fix a type overflow in range_to_mtrr func
Problem Details: When boot on sun G5+ with 4T mem, see an overflow in mtrr cleanup as below. *BAD*gran_size: 2G chunk_size: 2G num_reg: 10 lose cover RAM: -18014398505283592M This is because 1<<31 sign extended. Use an unsigned long constant to fix it. Useful for mem larger than or equal to 4T. -v2: Use 6...
```diff diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c index ac140c7be396..bdda2e6c673b 100644 --- a/arch/x86/kernel/cpu/mtrr/cleanup.c +++ b/arch/x86/kernel/cpu/mtrr/cleanup.c @@ -266,7 +266,7 @@ range_to_mtrr(unsigned int reg, unsigned long range_startk, if (align > max_align)...
8c9ce606a60e4a0cb447bdc082ce383b96b227b4
Analyze and fix the following issue in the Linux kernel code: xen/blkback: Copy id field when doing BLKIF_DISCARD.
Problem Details: We weren't copying the id field so when we sent the response back to the frontend (especially with a 64-bit host and 32-bit guest), we ended up using a random value. This lead to the frontend crashing as it would try to pass to __blk_end_request_all a NULL 'struct request' (b/c it would use the 'id' to...
```diff diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h index 773cf27dc23f..9ad3b5ec1dc1 100644 --- a/drivers/block/xen-blkback/common.h +++ b/drivers/block/xen-blkback/common.h @@ -257,6 +257,7 @@ static inline void blkif_get_x86_32_req(struct blkif_request *dst, break; case B...
9d32d1653db10eaba3140dd1a2f8dad51122f0b5
Analyze and fix the following issue in the Linux kernel code: drm/i915: don't write 0 to DIP control at HDMI init
Problem Details: At this time, the HDMI port is enabled, and the DIP control register specification says we need to disable the port *before* disabling the DIPs. Also, while doing this we risk telling the HW to send the AVI DIPs once (not every VSync), which really seems to confuse the HW and trigger bugs where the DIP...
```diff diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index c858da986fdd..65af12ee98b1 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -816,7 +816,6 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) struct intel_encoder *intel...
0053ea9c34a41865ec89ffbf3d3033f9a503bccc
Analyze and fix the following issue in the Linux kernel code: netdevice: Update netif_dbg for CONFIG_DYNAMIC_DEBUG
Problem Details: Make netif_dbg use dynamic debugging whenever CONFIG_DYNAMIC_DEBUG is enabled. commit b558c96ffa53 ("dynamic_debug: make dynamic-debug supersede DEBUG ccflag") missed updating the netif_dbg variant. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index e7fd468f7126..d94cb1431519 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2795,15 +2795,15 @@ do { \ #define netif_info(priv, type, dev, fmt, args...) \ netif_level(info, priv, type, dev, fmt, ##args)...