Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1333826 > unrolled thread
| Started by | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| First post | 2016-02-15 00:40 +0100 |
| Last post | 2016-02-17 21:40 +0100 |
| Articles | 19 on this page of 39 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 3.10 00/64] 3.10.97-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 03/64] crypto: algif_hash - Only export and import on sockets with data Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 31/64] ALSA: rawmidi: Remove kernel WARNING for NULL user-space buffer check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 55/64] crypto: af_alg - Disallow bind/setkey/... after accept(2) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 25/64] fix sysvfs symlinks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 01/64] recordmcount: Fix endianness handling bug for nop_mcount Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 37/64] ALSA: seq: Fix lockdep warnings due to double mutex locks Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 60/64] crypto: algif_hash - wait for crypto_ahash_init() to complete Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 59/64] ahci: Intel DNV device IDs SATA Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 07/64] kernel/signal.c: unexport sigsuspend() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 24/64] [media] media: vb2 dma-contig: Fully cache synchronise buffers in prepare and finish Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 39/64] ALSA: timer: Fix leftover link at closing Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 28/64] ALSA: compress: Disable GET_CODEC_CAPS ioctl for some architectures Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 23/64] [media] v4l2-compat-ioctl32: fix alignment for ARM64 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 05/64] HID: usbhid: fix recursive deadlock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 57/64] AHCI: Fix softreset failed issue of Port Multiplier Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 04/64] dm btree: fix leak of bufio-backed block in btree_split_sibling error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:40 +0100
[PATCH 3.10 16/64] vTPM: fix memory allocation flag for rtce buffer at kernel boot Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 14/64] wlcore/wl12xx: spi: fix oops on firmware load Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 15/64] wlcore/wl12xx: spi: fix NULL pointer dereference (Oops) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 22/64] parisc: Fix __ARCH_SI_PREAMBLE_SIZE Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 19/64] [PATCH] fix calculation of meta_bg descriptor backups Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 18/64] jbd2: Fix unreclaimed pages after truncate in data=journal mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 17/64] mtd: mtdpart: fix add_mtd_partitions error path Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 12/64] spi: atmel: Fix DMA-setup for transfers with more than 8 bits per word Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 21/64] parisc: Fix syscall restarts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 11/64] Revert "dm mpath: fix stalls when handling invalid ioctls" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 13/64] spi: fix parent-device reference leak Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
[PATCH 3.10 02/64] xhci: fix placement of call to usb_disabled() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 00:50 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Guenter Roeck <linux@roeck-us.net> - 2016-02-15 06:30 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-15 19:20 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Guenter Roeck <linux@roeck-us.net> - 2016-02-15 16:50 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-15 18:20 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-17 21:40 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Willy Tarreau <w@1wt.eu> - 2016-02-18 00:30 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-18 00:40 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2016-02-18 04:30 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-19 23:30 +0100
Re: [PATCH 3.10 00/64] 3.10.97-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-17 21:40 +0100
Page 2 of 2 — ← Prev page 1 [2]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 22/64] parisc: Fix __ARCH_SI_PREAMBLE_SIZE |
| Message-ID | <r2eAq-1fL-19@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Helge Deller <deller@gmx.de> commit e60fc5aa608eb38b47ba4ee058f306f739eb70a0 upstream. On a 64bit kernel build the compiler aligns the _sifields union in the struct siginfo_t on a 64bit address. The __ARCH_SI_PREAMBLE_SIZE define compensates for this alignment and thus fixes the wait testcase of the strace package. The symptoms of a wrong __ARCH_SI_PREAMBLE_SIZE value is that _sigchld.si_stime variable is missed to be copied and thus after a copy_siginfo() will have uninitialized values. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- arch/parisc/include/uapi/asm/siginfo.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/parisc/include/uapi/asm/siginfo.h +++ b/arch/parisc/include/uapi/asm/siginfo.h @@ -1,6 +1,10 @@ #ifndef _PARISC_SIGINFO_H #define _PARISC_SIGINFO_H +#if defined(__LP64__) +#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#endif + #include <asm-generic/siginfo.h> #undef NSIGTRAP
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 19/64] [PATCH] fix calculation of meta_bg descriptor backups |
| Message-ID | <r2eAq-1fL-23@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Leiserson <andy@leiserson.org>
commit 904dad4742d211b7a8910e92695c0fa957483836 upstream.
"group" is the group where the backup will be placed, and is
initialized to zero in the declaration. This meant that backups for
meta_bg descriptors were erroneously written to the backup block group
descriptors in groups 1 and (desc_per_block-1).
Reproduction information:
mke2fs -Fq -t ext4 -b 1024 -O ^resize_inode /tmp/foo.img 16G
truncate -s 24G /tmp/foo.img
losetup /dev/loop0 /tmp/foo.img
mount /dev/loop0 /mnt
resize2fs /dev/loop0
umount /dev/loop0
dd if=/dev/zero of=/dev/loop0 bs=1024 count=2
e2fsck -fy /dev/loop0
losetup -d /dev/loop0
Signed-off-by: Andy Leiserson <andy@leiserson.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ext4/resize.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1025,7 +1025,7 @@ exit_free:
* do not copy the full number of backups at this time. The resize
* which changed s_groups_count will backup again.
*/
-static void update_backups(struct super_block *sb, int blk_off, char *data,
+static void update_backups(struct super_block *sb, sector_t blk_off, char *data,
int size, int meta_bg)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
@@ -1050,7 +1050,7 @@ static void update_backups(struct super_
group = ext4_list_backups(sb, &three, &five, &seven);
last = sbi->s_groups_count;
} else {
- group = ext4_meta_bg_first_group(sb, group) + 1;
+ group = ext4_get_group_number(sb, blk_off) + 1;
last = (ext4_group_t)(group + EXT4_DESC_PER_BLOCK(sb) - 2);
}
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 18/64] jbd2: Fix unreclaimed pages after truncate in data=journal mode |
| Message-ID | <r2eAr-1fL-25@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit bc23f0c8d7ccd8d924c4e70ce311288cb3e61ea8 upstream.
Ted and Namjae have reported that truncated pages don't get timely
reclaimed after being truncated in data=journal mode. The following test
triggers the issue easily:
for (i = 0; i < 1000; i++) {
pwrite(fd, buf, 1024*1024, 0);
fsync(fd);
fsync(fd);
ftruncate(fd, 0);
}
The reason is that journal_unmap_buffer() finds that truncated buffers
are not journalled (jh->b_transaction == NULL), they are part of
checkpoint list of a transaction (jh->b_cp_transaction != NULL) and have
been already written out (!buffer_dirty(bh)). We clean such buffers but
we leave them in the checkpoint list. Since checkpoint transaction holds
a reference to the journal head, these buffers cannot be released until
the checkpoint transaction is cleaned up. And at that point we don't
call release_buffer_page() anymore so pages detached from mapping are
lingering in the system waiting for reclaim to find them and free them.
Fix the problem by removing buffers from transaction checkpoint lists
when journal_unmap_buffer() finds out they don't have to be there
anymore.
Reported-and-tested-by: Namjae Jeon <namjae.jeon@samsung.com>
Fixes: de1b794130b130e77ffa975bb58cb843744f9ae5
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/jbd2/transaction.c | 2 ++
1 file changed, 2 insertions(+)
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -1936,6 +1936,7 @@ static int journal_unmap_buffer(journal_
if (!buffer_dirty(bh)) {
/* bdflush has written it. We can drop it now */
+ __jbd2_journal_remove_checkpoint(jh);
goto zap_buffer;
}
@@ -1965,6 +1966,7 @@ static int journal_unmap_buffer(journal_
/* The orphan record's transaction has
* committed. We can cleanse this buffer */
clear_buffer_jbddirty(bh);
+ __jbd2_journal_remove_checkpoint(jh);
goto zap_buffer;
}
}
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 17/64] mtd: mtdpart: fix add_mtd_partitions error path |
| Message-ID | <r2eAq-1fL-21@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Boris BREZILLON <boris.brezillon@free-electrons.com>
commit e5bae86797141e4a95e42d825f737cb36d7b8c37 upstream.
If we fail to allocate a partition structure in the middle of the partition
creation process, the already allocated partitions are never removed, which
means they are still present in the partition list and their resources are
never freed.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mtd/mtdpart.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -634,8 +634,10 @@ int add_mtd_partitions(struct mtd_info *
for (i = 0; i < nbparts; i++) {
slave = allocate_partition(master, parts + i, i, cur_offset);
- if (IS_ERR(slave))
+ if (IS_ERR(slave)) {
+ del_mtd_partitions(master);
return PTR_ERR(slave);
+ }
mutex_lock(&mtd_partitions_mutex);
list_add(&slave->list, &mtd_partitions);
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 12/64] spi: atmel: Fix DMA-setup for transfers with more than 8 bits per word |
| Message-ID | <r2eAr-1fL-39@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: David Mosberger-Tang <davidm@egauge.net> commit 06515f83908d038d9e12ffa3dcca27a1b67f2de0 upstream. The DMA-slave configuration depends on the whether <= 8 or > 8 bits are transferred per word, so we need to call atmel_spi_dma_slave_config() with the correct value. Signed-off-by: David Mosberger <davidm@egauge.net> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/spi/spi-atmel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -594,7 +594,8 @@ static int atmel_spi_next_xfer_dma_submi *plen = len; - if (atmel_spi_dma_slave_config(as, &slave_config, 8)) + if (atmel_spi_dma_slave_config(as, &slave_config, + xfer->bits_per_word)) goto err_exit; /* Send both scatterlists */
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 21/64] parisc: Fix syscall restarts |
| Message-ID | <r2eAr-1fL-45@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helge Deller <deller@gmx.de>
commit 71a71fb5374a23be36a91981b5614590b9e722c3 upstream.
On parisc syscalls which are interrupted by signals sometimes failed to
restart and instead returned -ENOSYS which in the worst case lead to
userspace crashes.
A similiar problem existed on MIPS and was fixed by commit e967ef02
("MIPS: Fix restart of indirect syscalls").
On parisc the current syscall restart code assumes that all syscall
callers load the syscall number in the delay slot of the ble
instruction. That's how it is e.g. done in the unistd.h header file:
ble 0x100(%sr2, %r0)
ldi #syscall_nr, %r20
Because of that assumption the current code never restored %r20 before
returning to userspace.
This assumption is at least not true for code which uses the glibc
syscall() function, which instead uses this syntax:
ble 0x100(%sr2, %r0)
copy regX, %r20
where regX depend on how the compiler optimizes the code and register
usage.
This patch fixes this problem by adding code to analyze how the syscall
number is loaded in the delay branch and - if needed - copy the syscall
number to regX prior returning to userspace for the syscall restart.
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/parisc/kernel/signal.c | 64 +++++++++++++++++++++++++++++++++++---------
1 file changed, 52 insertions(+), 12 deletions(-)
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -449,6 +449,55 @@ handle_signal(unsigned long sig, siginfo
regs->gr[28]);
}
+/*
+ * Check how the syscall number gets loaded into %r20 within
+ * the delay branch in userspace and adjust as needed.
+ */
+
+static void check_syscallno_in_delay_branch(struct pt_regs *regs)
+{
+ u32 opcode, source_reg;
+ u32 __user *uaddr;
+ int err;
+
+ /* Usually we don't have to restore %r20 (the system call number)
+ * because it gets loaded in the delay slot of the branch external
+ * instruction via the ldi instruction.
+ * In some cases a register-to-register copy instruction might have
+ * been used instead, in which case we need to copy the syscall
+ * number into the source register before returning to userspace.
+ */
+
+ /* A syscall is just a branch, so all we have to do is fiddle the
+ * return pointer so that the ble instruction gets executed again.
+ */
+ regs->gr[31] -= 8; /* delayed branching */
+
+ /* Get assembler opcode of code in delay branch */
+ uaddr = (unsigned int *) ((regs->gr[31] & ~3) + 4);
+ err = get_user(opcode, uaddr);
+ if (err)
+ return;
+
+ /* Check if delay branch uses "ldi int,%r20" */
+ if ((opcode & 0xffff0000) == 0x34140000)
+ return; /* everything ok, just return */
+
+ /* Check if delay branch uses "nop" */
+ if (opcode == INSN_NOP)
+ return;
+
+ /* Check if delay branch uses "copy %rX,%r20" */
+ if ((opcode & 0xffe0ffff) == 0x08000254) {
+ source_reg = (opcode >> 16) & 31;
+ regs->gr[source_reg] = regs->gr[20];
+ return;
+ }
+
+ pr_warn("syscall restart: %s (pid %d): unexpected opcode 0x%08x\n",
+ current->comm, task_pid_nr(current), opcode);
+}
+
static inline void
syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
{
@@ -471,10 +520,7 @@ syscall_restart(struct pt_regs *regs, st
}
/* fallthrough */
case -ERESTARTNOINTR:
- /* A syscall is just a branch, so all
- * we have to do is fiddle the return pointer.
- */
- regs->gr[31] -= 8; /* delayed branching */
+ check_syscallno_in_delay_branch(regs);
break;
}
}
@@ -523,15 +569,9 @@ insert_restart_trampoline(struct pt_regs
}
case -ERESTARTNOHAND:
case -ERESTARTSYS:
- case -ERESTARTNOINTR: {
- /* Hooray for delayed branching. We don't
- * have to restore %r20 (the system call
- * number) because it gets loaded in the delay
- * slot of the branch external instruction.
- */
- regs->gr[31] -= 8;
+ case -ERESTARTNOINTR:
+ check_syscallno_in_delay_branch(regs);
return;
- }
default:
break;
}
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 11/64] Revert "dm mpath: fix stalls when handling invalid ioctls" |
| Message-ID | <r2eAr-1fL-47@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
commit 47796938c46b943d157ac8a6f9ed4e3b98b83cf4 upstream.
This reverts commit a1989b330093578ea5470bea0a00f940c444c466.
That commit introduced a regression at least for the case of the SG_IO ioctl()
running without CAP_SYS_RAWIO capability (e.g., unprivileged users) when there
are no active paths: the ioctl() fails with the ENOTTY errno immediately rather
than blocking due to queue_if_no_path until a path becomes active, for example.
That case happens to be exercised by QEMU KVM guests with 'scsi-block' devices
(qemu "-device scsi-block" [1], libvirt "<disk type='block' device='lun'>" [2])
from multipath devices; which leads to SCSI/filesystem errors in such a guest.
More general scenarios can hit that regression too. The following demonstration
employs a SG_IO ioctl() with a standard SCSI INQUIRY command for this objective
(some output & user changes omitted for brevity and comments added for clarity).
Reverting that commit restores normal operation (queueing) in failing scenarios;
tested on linux-next (next-20151022).
1) Test-case is based on sg_simple0 [3] (just SG_IO; remove SG_GET_VERSION_NUM)
$ cat sg_simple0.c
... see [3] ...
$ sed '/SG_GET_VERSION_NUM/,/}/d' sg_simple0.c > sgio_inquiry.c
$ gcc sgio_inquiry.c -o sgio_inquiry
2) The ioctl() works fine with active paths present.
# multipath -l 85ag56
85ag56 (...) dm-19 IBM ,2145
size=60G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=active
| |- 8:0:11:0 sdz 65:144 active undef running
| `- 9:0:9:0 sdbf 67:144 active undef running
`-+- policy='service-time 0' prio=0 status=enabled
|- 8:0:12:0 sdae 65:224 active undef running
`- 9:0:12:0 sdbo 68:32 active undef running
$ ./sgio_inquiry /dev/mapper/85ag56
Some of the INQUIRY command's response:
IBM 2145 0000
INQUIRY duration=0 millisecs, resid=0
3) The ioctl() fails with ENOTTY errno with _no_ active paths present,
for unprivileged users (rather than blocking due to queue_if_no_path).
# for path in $(multipath -l 85ag56 | grep -o 'sd[a-z]\+'); \
do multipathd -k"fail path $path"; done
# multipath -l 85ag56
85ag56 (...) dm-19 IBM ,2145
size=60G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=0 status=enabled
| |- 8:0:11:0 sdz 65:144 failed undef running
| `- 9:0:9:0 sdbf 67:144 failed undef running
`-+- policy='service-time 0' prio=0 status=enabled
|- 8:0:12:0 sdae 65:224 failed undef running
`- 9:0:12:0 sdbo 68:32 failed undef running
$ ./sgio_inquiry /dev/mapper/85ag56
sg_simple0: Inquiry SG_IO ioctl error: Inappropriate ioctl for device
4) dmesg shows that scsi_verify_blk_ioctl() failed for SG_IO (0x2285);
it returns -ENOIOCTLCMD, later replaced with -ENOTTY in vfs_ioctl().
$ dmesg
<...>
[] device-mapper: multipath: Failing path 65:144.
[] device-mapper: multipath: Failing path 67:144.
[] device-mapper: multipath: Failing path 65:224.
[] device-mapper: multipath: Failing path 68:32.
[] sgio_inquiry: sending ioctl 2285 to a partition!
5) The ioctl() only works if the SYS_CAP_RAWIO capability is present
(then queueing happens -- in this example, queue_if_no_path is set);
this is due to a conditional check in scsi_verify_blk_ioctl().
# capsh --drop=cap_sys_rawio -- -c './sgio_inquiry /dev/mapper/85ag56'
sg_simple0: Inquiry SG_IO ioctl error: Inappropriate ioctl for device
# ./sgio_inquiry /dev/mapper/85ag56 &
[1] 72830
# cat /proc/72830/stack
[<c00000171c0df700>] 0xc00000171c0df700
[<c000000000015934>] __switch_to+0x204/0x350
[<c000000000152d4c>] msleep+0x5c/0x80
[<c00000000077dfb0>] dm_blk_ioctl+0x70/0x170
[<c000000000487c40>] blkdev_ioctl+0x2b0/0x9b0
[<c0000000003128e4>] block_ioctl+0x64/0xd0
[<c0000000002dd3b0>] do_vfs_ioctl+0x490/0x780
[<c0000000002dd774>] SyS_ioctl+0xd4/0xf0
[<c000000000009358>] system_call+0x38/0xd0
6) This is the function call chain exercised in this analysis:
SYSCALL_DEFINE3(ioctl, <...>) @ fs/ioctl.c
-> do_vfs_ioctl()
-> vfs_ioctl()
...
error = filp->f_op->unlocked_ioctl(filp, cmd, arg);
...
-> dm_blk_ioctl() @ drivers/md/dm.c
-> multipath_ioctl() @ drivers/md/dm-mpath.c
...
(bdev = NULL, due to no active paths)
...
if (!bdev || <...>) {
int err = scsi_verify_blk_ioctl(NULL, cmd);
if (err)
r = err;
}
...
-> scsi_verify_blk_ioctl() @ block/scsi_ioctl.c
...
if (bd && bd == bd->bd_contains) // not taken (bd = NULL)
return 0;
...
if (capable(CAP_SYS_RAWIO)) // not taken (unprivileged user)
return 0;
...
printk_ratelimited(KERN_WARNING
"%s: sending ioctl %x to a partition!\n" <...>);
return -ENOIOCTLCMD;
<-
...
return r ? : <...>
<-
...
if (error == -ENOIOCTLCMD)
error = -ENOTTY;
out:
return error;
...
Links:
[1] http://git.qemu.org/?p=qemu.git;a=commit;h=336a6915bc7089fb20fea4ba99972ad9a97c5f52
[2] https://libvirt.org/formatdomain.html#elementsDisks (see 'disk' -> 'device')
[3] http://tldp.org/HOWTO/SCSI-Generic-HOWTO/pexample.html (Revision 1.2, 2002-05-03)
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/md/dm-mpath.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1608,11 +1608,8 @@ static int multipath_ioctl(struct dm_tar
/*
* Only pass ioctls through if the device sizes match exactly.
*/
- if (!bdev || ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT) {
- int err = scsi_verify_blk_ioctl(NULL, cmd);
- if (err)
- r = err;
- }
+ if (!r && ti->len != i_size_read(bdev->bd_inode) >> SECTOR_SHIFT)
+ r = scsi_verify_blk_ioctl(NULL, cmd);
if (r == -ENOTCONN && !fatal_signal_pending(current))
queue_work(kmultipathd, &m->process_queued_ios);
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 13/64] spi: fix parent-device reference leak |
| Message-ID | <r2eAs-1fL-53@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <johan@kernel.org>
commit 157f38f993919b648187ba341bfb05d0e91ad2f6 upstream.
Fix parent-device reference leak due to SPI-core taking an unnecessary
reference to the parent when allocating the master structure, a
reference that was never released.
Note that driver core takes its own reference to the parent when the
master device is registered.
Fixes: 49dce689ad4e ("spi doesn't need class_device")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/spi/spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1047,7 +1047,7 @@ struct spi_master *spi_alloc_master(stru
master->bus_num = -1;
master->num_chipselect = 1;
master->dev.class = &spi_master_class;
- master->dev.parent = get_device(dev);
+ master->dev.parent = dev;
spi_master_set_devdata(master, &master[1]);
return master;
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 00:50 +0100 |
| Subject | [PATCH 3.10 02/64] xhci: fix placement of call to usb_disabled() |
| Message-ID | <r2eAt-1fL-79@gated-at.bofh.it> |
| In reply to | #1333826 |
3.10-stable review patch. If anyone has any objections, please let me know.
------------------
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
In the backport of 1eaf35e4dd592c59041bc1ed3248c46326da1f5f, the call to
usb_disabled() was too late, after we had already done some allocation.
Move that call to the top of the function instead, making the logic
match what is intended and is in the original patch.
Reported-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4788,6 +4788,9 @@ static int __init xhci_hcd_init(void)
{
int retval;
+ if (usb_disabled())
+ return -ENODEV;
+
retval = xhci_register_pci();
if (retval < 0) {
printk(KERN_DEBUG "Problem registering PCI driver.");
@@ -4816,9 +4819,6 @@ static int __init xhci_hcd_init(void)
/* xhci_run_regs has eight fields and embeds 128 xhci_intr_regs */
BUILD_BUG_ON(sizeof(struct xhci_run_regs) != (8+8*128)*32/8);
- if (usb_disabled())
- return -ENODEV;
-
return 0;
unreg_pci:
xhci_unregister_pci();
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2016-02-15 06:30 +0100 |
| Message-ID | <r2jTs-4Xm-9@gated-at.bofh.it> |
| In reply to | #1333826 |
On 02/14/2016 02:22 PM, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 3.10.97 release. > There are 64 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know. > > Responses should be made by Tue Feb 16 22:22:07 UTC 2016. > Anything received after that time might be too late. > More early feedback: Patch 'EVM: Use crypto_memneq() for digest comparisons' should be dropped because crypto_memneq() does not exist in v3.10. This causes a build error in x86_64:allyesconfig and i386:allyesconfig. security/integrity/evm/evm_main.c: In function 'evm_verify_hmac': security/integrity/evm/evm_main.c:132:3: error: implicit declaration of function 'crypto_memneq' Thanks, Guenter
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-15 19:20 +0100 |
| Message-ID | <r2vUD-4Jg-59@gated-at.bofh.it> |
| In reply to | #1334158 |
On Sun, Feb 14, 2016 at 09:20:18PM -0800, Guenter Roeck wrote: > On 02/14/2016 02:22 PM, Greg Kroah-Hartman wrote: > >This is the start of the stable review cycle for the 3.10.97 release. > >There are 64 patches in this series, all will be posted as a response > >to this one. If anyone has any issues with these being applied, please > >let me know. > > > >Responses should be made by Tue Feb 16 22:22:07 UTC 2016. > >Anything received after that time might be too late. > > > > More early feedback: Patch 'EVM: Use crypto_memneq() for digest comparisons' > should be dropped because crypto_memneq() does not exist in v3.10. > > This causes a build error in x86_64:allyesconfig and i386:allyesconfig. > > security/integrity/evm/evm_main.c: In function 'evm_verify_hmac': > security/integrity/evm/evm_main.c:132:3: error: > implicit declaration of function 'crypto_memneq' Now deleted, thanks. greg k-h
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2016-02-15 16:50 +0100 |
| Message-ID | <r2tzs-2WJ-29@gated-at.bofh.it> |
| In reply to | #1333826 |
On 02/14/2016 02:22 PM, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 3.10.97 release. > There are 64 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know. > > Responses should be made by Tue Feb 16 22:22:07 UTC 2016. > Anything received after that time might be too late. > Build results: total: 122 pass: 120 fail: 2 Failed builds: i386:allyesconfig x86_64:allyesconfig Qemu test results: total: 72 pass: 72 fail: 0 Details are available at http://kerneltests.org/builders. As mentioned separately, dropping 'EVM: Use crypto_memneq() for digest comparison' should fix the problem. Guenter
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-15 18:20 +0100 |
| Message-ID | <r2uYz-41S-45@gated-at.bofh.it> |
| In reply to | #1333826 |
On 02/14/2016 03:22 PM, Greg Kroah-Hartman wrote: > This is the start of the stable review cycle for the 3.10.97 release. > There are 64 patches in this series, all will be posted as a response > to this one. If anyone has any issues with these being applied, please > let me know. > > Responses should be made by Tue Feb 16 22:22:07 UTC 2016. > Anything received after that time might be too late. > > The whole patch series can be found in one patch at: > kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.10.97-rc1.gz > and the diffstat can be found below. > Compiled, but didn't boot on my test system. Unfortunately, I won't be able to debug this until Wednesday. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com | (970) 217-8978
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-17 21:40 +0100 |
| Message-ID | <r3h3c-3bi-1@gated-at.bofh.it> |
| In reply to | #1334633 |
On 02/17/2016 01:30 PM, Greg Kroah-Hartman wrote: > On Mon, Feb 15, 2016 at 10:13:45AM -0700, Shuah Khan wrote: >> On 02/14/2016 03:22 PM, Greg Kroah-Hartman wrote: >>> This is the start of the stable review cycle for the 3.10.97 release. >>> There are 64 patches in this series, all will be posted as a response >>> to this one. If anyone has any issues with these being applied, please >>> let me know. >>> >>> Responses should be made by Tue Feb 16 22:22:07 UTC 2016. >>> Anything received after that time might be too late. >>> >>> The whole patch series can be found in one patch at: >>> kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.10.97-rc1.gz >>> and the diffstat can be found below. >>> >> >> Compiled, but didn't boot on my test system. >> Unfortunately, I won't be able to debug this >> until Wednesday. > > Were you able to figure this out? > I am working on bisect today. I should have something for you later this afternoon. thanks, -- Shuah -- Shuah Khan Sr. Linux Kernel Developer Open Source Innovation Group Samsung Research America (Silicon Valley) shuahkh@osg.samsung.com | (970) 217-8978
[toc] | [prev] | [next] | [standalone]
| From | Willy Tarreau <w@1wt.eu> |
|---|---|
| Date | 2016-02-18 00:30 +0100 |
| Message-ID | <r3jHI-55z-11@gated-at.bofh.it> |
| In reply to | #1336736 |
Hi, On Wed, Feb 17, 2016 at 01:36:46PM -0700, Shuah Khan wrote: > >> Compiled, but didn't boot on my test system. > >> Unfortunately, I won't be able to debug this > >> until Wednesday. > > > > Were you able to figure this out? > > > > I am working on bisect today. I should have something > for you later this afternoon. Just FWIW I have it running here in KVM with a simplified config, so it might be something related to a specific feature or driver but not necessarily in the core itself. Willy
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-18 00:40 +0100 |
| Message-ID | <r3jRo-59z-19@gated-at.bofh.it> |
| In reply to | #1336874 |
On 02/17/2016 04:26 PM, Willy Tarreau wrote:
> Hi,
>
> On Wed, Feb 17, 2016 at 01:36:46PM -0700, Shuah Khan wrote:
>>>> Compiled, but didn't boot on my test system.
>>>> Unfortunately, I won't be able to debug this
>>>> until Wednesday.
>>>
>>> Were you able to figure this out?
>>>
>>
>> I am working on bisect today. I should have something
>> for you later this afternoon.
>
> Just FWIW I have it running here in KVM with a simplified config, so it
> might be something related to a specific feature or driver but not
> necessarily in the core itself.
>
git bisect tells me it is
Arnd Bergmann <arnd@arndb.de>
remoteproc: avoid stack overflow in debugfs file
This commit is also in 3.14.61-rc1 which worked just fine.
It is in 4.3.6-rc1 which does fail.
I am building without it now to make sure it is the
offending commit
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
[toc] | [prev] | [next] | [standalone]
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Date | 2016-02-18 04:30 +0100 |
| Message-ID | <r3nrY-7VO-9@gated-at.bofh.it> |
| In reply to | #1336880 |
On 02/17/2016 04:33 PM, Shuah Khan wrote:
> On 02/17/2016 04:26 PM, Willy Tarreau wrote:
>> Hi,
>>
>> On Wed, Feb 17, 2016 at 01:36:46PM -0700, Shuah Khan wrote:
>>>>> Compiled, but didn't boot on my test system.
>>>>> Unfortunately, I won't be able to debug this
>>>>> until Wednesday.
>>>>
>>>> Were you able to figure this out?
>>>>
>>>
>>> I am working on bisect today. I should have something
>>> for you later this afternoon.
>>
>> Just FWIW I have it running here in KVM with a simplified config, so it
>> might be something related to a specific feature or driver but not
>> necessarily in the core itself.
>>
>
> git bisect tells me it is
>
> Arnd Bergmann <arnd@arndb.de>
> remoteproc: avoid stack overflow in debugfs file
>
> This commit is also in 3.14.61-rc1 which worked just fine.
> It is in 4.3.6-rc1 which does fail.
>
> I am building without it now to make sure it is the
> offending commit
>
Sanity returns. Please remove the following commit:
Ryan Ware <ware@linux.intel.com>
EVM: Use crypto_memneq() for digest comparisons
This commit can't stand on its own. crypto_memneq()
isn't defined. With this change removed, it all works
well.
CC security/integrity/evm/evm_main.o^M
security/integrity/evm/evm_main.c: In function â<80><98>evm_verify_hmacâ<80><99>:^M
security/integrity/evm/evm_main.c:132:3: error: implicit declaration of function â<80><98>crypto_memneqâ<80><99> [-Werror=implicit-function-declaration]^M
rc = crypto_memneq(xattr_data->digest, calc.digest,^M
^^M
cc1: some warnings being treated as errors^M
make[3]: *** [security/integrity/evm/evm_main.o] Error 1^M
make[2]: *** [security/integrity/evm] Error 2^M
make[1]: *** [security/integrity] Error 2^M
make: *** [security] Error 2^M
I think I didn't run make clean and ended up with a
bad install.
thanks,
-- Shuah
--
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-19 23:30 +0100 |
| Message-ID | <r41IJ-3Oe-1@gated-at.bofh.it> |
| In reply to | #1337006 |
On Wed, Feb 17, 2016 at 08:24:11PM -0700, Shuah Khan wrote: > On 02/17/2016 04:33 PM, Shuah Khan wrote: > > On 02/17/2016 04:26 PM, Willy Tarreau wrote: > >> Hi, > >> > >> On Wed, Feb 17, 2016 at 01:36:46PM -0700, Shuah Khan wrote: > >>>>> Compiled, but didn't boot on my test system. > >>>>> Unfortunately, I won't be able to debug this > >>>>> until Wednesday. > >>>> > >>>> Were you able to figure this out? > >>>> > >>> > >>> I am working on bisect today. I should have something > >>> for you later this afternoon. > >> > >> Just FWIW I have it running here in KVM with a simplified config, so it > >> might be something related to a specific feature or driver but not > >> necessarily in the core itself. > >> > > > > git bisect tells me it is > > > > Arnd Bergmann <arnd@arndb.de> > > remoteproc: avoid stack overflow in debugfs file > > > > This commit is also in 3.14.61-rc1 which worked just fine. > > It is in 4.3.6-rc1 which does fail. > > > > I am building without it now to make sure it is the > > offending commit > > > > Sanity returns. Please remove the following commit: > > Ryan Ware <ware@linux.intel.com> > EVM: Use crypto_memneq() for digest comparisons > > This commit can't stand on its own. crypto_memneq() > isn't defined. With this change removed, it all works > well. > > CC security/integrity/evm/evm_main.o^M > security/integrity/evm/evm_main.c: In function â<80><98>evm_verify_hmacâ<80><99>:^M > security/integrity/evm/evm_main.c:132:3: error: implicit declaration of function â<80><98>crypto_memneqâ<80><99> [-Werror=implicit-function-declaration]^M > rc = crypto_memneq(xattr_data->digest, calc.digest,^M > ^^M > cc1: some warnings being treated as errors^M > make[3]: *** [security/integrity/evm/evm_main.o] Error 1^M > make[2]: *** [security/integrity/evm] Error 2^M > make[1]: *** [security/integrity] Error 2^M > make: *** [security] Error 2^M > > I think I didn't run make clean and ended up with a > bad install. Ah, I had removed that right after I did the -rc as Guenter had reported it being an issue as well. thanks for tracking this down, and sorry for the duplicated effort. greg k-h
[toc] | [prev] | [next] | [standalone]
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2016-02-17 21:40 +0100 |
| Message-ID | <r3h3c-3bi-3@gated-at.bofh.it> |
| In reply to | #1334633 |
On Mon, Feb 15, 2016 at 10:13:45AM -0700, Shuah Khan wrote: > On 02/14/2016 03:22 PM, Greg Kroah-Hartman wrote: > > This is the start of the stable review cycle for the 3.10.97 release. > > There are 64 patches in this series, all will be posted as a response > > to this one. If anyone has any issues with these being applied, please > > let me know. > > > > Responses should be made by Tue Feb 16 22:22:07 UTC 2016. > > Anything received after that time might be too late. > > > > The whole patch series can be found in one patch at: > > kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.10.97-rc1.gz > > and the diffstat can be found below. > > > > Compiled, but didn't boot on my test system. > Unfortunately, I won't be able to debug this > until Wednesday. Were you able to figure this out? thanks, greg k-h
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | linux.kernel
csiph-web