* [ 00/13] 2.6.27.62-longterm review
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 01/13] powerpc: Add more Power7 specific definitions Willy Tarreau
` (12 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
This is the start of the longterm review cycle for the 2.6.27.62 release.
All patches will be posted as a response to this one. If anyone has any
issue with these being applied, please let me know. If anyone is a
maintainer of the proper subsystem, and wants to add a Signed-off-by: line
to the patch, please respond with it.
Responses should be made within 72 hours. Anything received after that time
might be too late.
Please note that the whole -rc patch is not provided anymore, only individual
patches are provided so that their authors and subsystem maintainers can spot
issues. If this is a problem for you, please report it so that we try to find
a solution.
The diffstat is appended below.
arch/powerpc/include/asm/ppc_asm.h | 1 +
arch/powerpc/include/asm/reg.h | 45 +++++++++++++++++++++++++++++++++++-
drivers/cdrom/cdrom.c | 8 +-----
drivers/infiniband/hw/mlx4/mad.c | 7 +----
drivers/video/atmel_lcdfb.c | 2 +-
fs/ecryptfs/file.c | 2 +-
fs/ecryptfs/inode.c | 4 +-
fs/ecryptfs/read_write.c | 4 +-
fs/udf/super.c | 6 ++++
include/linux/proportions.h | 4 +++
kernel/relay.c | 10 ++++++-
mm/filemap_xip.c | 7 ++++-
12 files changed, 78 insertions(+), 22 deletions(-)
^ permalink raw reply [flat|nested] 14+ messages in thread
* [ 01/13] powerpc: Add more Power7 specific definitions
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
2012-03-12 0:44 ` [ 00/13] 2.6.27.62-longterm review Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 02/13] IB/mlx4: pass SMP vendor-specific attribute MADs to firmware Willy Tarreau
` (11 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable, stable; +Cc: Eric B Munson, benh, Michael Neuling
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Michael Neuling <mikey@neuling.org>
stable-2.6.27.60 added c24cb8e5 which uses PV_POWER7 but it's not
defined. Following patch adds these definitions.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
commit 50fb8ebe7c4ad60d147700d253f78bd1e615a526 upstream
powerpc: Add more Power7 specific definitions
This adds more SPR definitions used on newer processors when running
in hypervisor mode. Along with some other P7 specific bits and pieces
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
arch/powerpc/include/asm/ppc_asm.h | 1
arch/powerpc/include/asm/reg.h | 45 ++++++++++++++++++++++++++++++++++++-
2 files changed, 45 insertions(+), 1 deletion(-)
Index: clone1/arch/powerpc/include/asm/ppc_asm.h
===================================================================
--- clone1.orig/arch/powerpc/include/asm/ppc_asm.h
+++ clone1/arch/powerpc/include/asm/ppc_asm.h
@@ -166,6 +166,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_PURR);
#define HMT_MEDIUM or 2,2,2
#define HMT_MEDIUM_HIGH or 5,5,5 # medium high priority
#define HMT_HIGH or 3,3,3
+#define HMT_EXTRA_HIGH or 7,7,7 # power7 only
/* handle instructions that older assemblers may not know */
#define RFCI .long 0x4c000066 /* rfci instruction */
Index: clone1/arch/powerpc/include/asm/reg.h
===================================================================
--- clone1.orig/arch/powerpc/include/asm/reg.h
+++ clone1/arch/powerpc/include/asm/reg.h
@@ -172,8 +172,43 @@
#define SPRN_TBWL 0x11C /* Time Base Lower Register (super, R/W) */
#define SPRN_TBWU 0x11D /* Time Base Upper Register (super, R/W) */
#define SPRN_SPURR 0x134 /* Scaled PURR */
+#define SPRN_HSPRG0 0x130 /* Hypervisor Scratch 0 */
+#define SPRN_HSPRG1 0x131 /* Hypervisor Scratch 1 */
+#define SPRN_HDSISR 0x132
+#define SPRN_HDAR 0x133
+#define SPRN_HDEC 0x136 /* Hypervisor Decrementer */
#define SPRN_HIOR 0x137 /* 970 Hypervisor interrupt offset */
+#define SPRN_RMOR 0x138 /* Real mode offset register */
+#define SPRN_HRMOR 0x139 /* Real mode offset register */
+#define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */
+#define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
#define SPRN_LPCR 0x13E /* LPAR Control Register */
+#define LPCR_VPM0 (1ul << (63-0))
+#define LPCR_VPM1 (1ul << (63-1))
+#define LPCR_ISL (1ul << (63-2))
+#define LPCR_DPFD_SH (63-11)
+#define LPCR_VRMA_L (1ul << (63-12))
+#define LPCR_VRMA_LP0 (1ul << (63-15))
+#define LPCR_VRMA_LP1 (1ul << (63-16))
+#define LPCR_RMLS 0x1C000000 /* impl dependent rmo limit sel */
+#define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */
+#define LPCR_PECE 0x00007000 /* powersave exit cause enable */
+#define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */
+#define LPCR_PECE1 0x00002000 /* decrementer can cause exit */
+#define LPCR_PECE2 0x00001000 /* machine check etc can cause exit */
+#define LPCR_MER 0x00000800 /* Mediated External Exception */
+#define LPCR_LPES0 0x00000008 /* LPAR Env selector 0 */
+#define LPCR_LPES1 0x00000004 /* LPAR Env selector 1 */
+#define LPCR_RMI 0x00000002 /* real mode is cache inhibit */
+#define LPCR_HDICE 0x00000001 /* Hyp Decr enable (HV,PR,EE) */
+#define SPRN_LPID 0x13F /* Logical Partition Identifier */
+#define SPRN_HMER 0x150 /* Hardware m? error recovery */
+#define SPRN_HMEER 0x151 /* Hardware m? enable error recovery */
+#define SPRN_HEIR 0x153 /* Hypervisor Emulated Instruction Register */
+#define SPRN_TLBINDEXR 0x154 /* P7 TLB control register */
+#define SPRN_TLBVPNR 0x155 /* P7 TLB control register */
+#define SPRN_TLBRPNR 0x156 /* P7 TLB control register */
+#define SPRN_TLBLPIDR 0x157 /* P7 TLB control register */
#define SPRN_DBAT0L 0x219 /* Data BAT 0 Lower Register */
#define SPRN_DBAT0U 0x218 /* Data BAT 0 Upper Register */
#define SPRN_DBAT1L 0x21B /* Data BAT 1 Lower Register */
@@ -392,12 +427,18 @@
#define SPRN_SRR0 0x01A /* Save/Restore Register 0 */
#define SPRN_SRR1 0x01B /* Save/Restore Register 1 */
#define SRR1_WAKEMASK 0x00380000 /* reason for wakeup */
-#define SRR1_WAKERESET 0x00380000 /* System reset */
#define SRR1_WAKESYSERR 0x00300000 /* System error */
#define SRR1_WAKEEE 0x00200000 /* External interrupt */
#define SRR1_WAKEMT 0x00280000 /* mtctrl */
+#define SRR1_WAKEHMI 0x00280000 /* Hypervisor maintenance */
#define SRR1_WAKEDEC 0x00180000 /* Decrementer interrupt */
#define SRR1_WAKETHERM 0x00100000 /* Thermal management interrupt */
+#define SRR1_WAKERESET 0x00100000 /* System reset */
+#define SRR1_WAKESTATE 0x00030000 /* Powersave exit mask [46:47] */
+#define SRR1_WS_DEEPEST 0x00030000 /* Some resources not maintained,
+ * may not be recoverable */
+#define SRR1_WS_DEEPER 0x00020000 /* Some resources not maintained */
+#define SRR1_WS_DEEP 0x00010000 /* All resources maintained */
#define SPRN_HSRR0 0x13A /* Save/Restore Register 0 */
#define SPRN_HSRR1 0x13B /* Save/Restore Register 1 */
@@ -698,6 +739,8 @@
#define PV_POWER5 0x003A
#define PV_POWER5p 0x003B
#define PV_970FX 0x003C
+#define PV_POWER6 0x003E
+#define PV_POWER7 0x003F
#define PV_630 0x0040
#define PV_630p 0x0041
#define PV_970MP 0x0044
^ permalink raw reply [flat|nested] 14+ messages in thread
* [ 02/13] IB/mlx4: pass SMP vendor-specific attribute MADs to firmware
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
2012-03-12 0:44 ` [ 00/13] 2.6.27.62-longterm review Willy Tarreau
2012-03-12 0:44 ` [ 01/13] powerpc: Add more Power7 specific definitions Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 03/13] mm/filemap_xip.c: fix race condition in xip_file_fault() Willy Tarreau
` (10 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jack Morgenstein, Or Gerlitz, Ira Weiny, Roland Dreier,
Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jack Morgenstein <jackm@mellanox.com>
commit a6f7feae6d19e84253918d88b04153af09d3a243 upstream.
In the current code, vendor-specific MADs (e.g with the FDR-10
attribute) are silently dropped by the driver, resulting in timeouts
at the sending side and inability to query/configure the relevant
feature. However, the ConnectX firmware is able to handle such MADs.
For unsupported attributes, the firmware returns a GET_RESPONSE MAD
containing an error status.
For example, for a FDR-10 node with LID 11:
# ibstat mlx4_0 1
CA: 'mlx4_0'
Port 1:
State: Active
Physical state: LinkUp
Rate: 40 (FDR10)
Base lid: 11
LMC: 0
SM lid: 24
Capability mask: 0x02514868
Port GUID: 0x0002c903002e65d1
Link layer: InfiniBand
Extended Port Query (EPI) vendor mad timeouts before the patch:
# smpquery MEPI 11 -d
ibwarn: [4196] smp_query_via: attr 0xff90 mod 0x0 route Lid 11
ibwarn: [4196] _do_madrpc: retry 1 (timeout 1000 ms)
ibwarn: [4196] _do_madrpc: retry 2 (timeout 1000 ms)
ibwarn: [4196] _do_madrpc: timeout after 3 retries, 3000 ms
ibwarn: [4196] mad_rpc: _do_madrpc failed; dport (Lid 11)
smpquery: iberror: [pid 4196] main: failed: operation EPI: ext port info query failed
EPI query works OK with the patch:
# smpquery MEPI 11 -d
ibwarn: [6548] smp_query_via: attr 0xff90 mod 0x0 route Lid 11
ibwarn: [6548] mad_rpc: data offs 64 sz 64
mad data
0000 0000 0000 0001 0000 0001 0000 0001
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
# Ext Port info: Lid 11 port 0
StateChangeEnable:...............0x00
LinkSpeedSupported:..............0x01
LinkSpeedEnabled:................0x01
LinkSpeedActive:.................0x01
Signed-off-by: Jack Morgenstein <jackm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Acked-by: Ira Weiny <weiny2@llnl.gov>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mlx4/mad.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
index 19e68ab..c0206dc 100644
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -252,12 +252,9 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
return IB_MAD_RESULT_SUCCESS;
/*
- * Don't process SMInfo queries or vendor-specific
- * MADs -- the SMA can't handle them.
+ * Don't process SMInfo queries -- the SMA can't handle them.
*/
- if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO ||
- ((in_mad->mad_hdr.attr_id & IB_SMP_ATTR_VENDOR_MASK) ==
- IB_SMP_ATTR_VENDOR_MASK))
+ if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO)
return IB_MAD_RESULT_SUCCESS;
} else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT ||
in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 ||
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 03/13] mm/filemap_xip.c: fix race condition in xip_file_fault()
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (2 preceding siblings ...)
2012-03-12 0:44 ` [ 02/13] IB/mlx4: pass SMP vendor-specific attribute MADs to firmware Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 04/13] udf: Mark LVID buffer as uptodate before marking it dirty Willy Tarreau
` (9 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Carsten Otte, Hugh Dickins, Andrew Morton, Linus Torvalds,
Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Carsten Otte <carsteno@de.ibm.com>
commit 99f02ef1f18631eb0a4e0ea0a3d56878dbcb4b90 upstream.
Fix a race condition that shows in conjunction with xip_file_fault() when
two threads of the same user process fault on the same memory page.
In this case, the race winner will install the page table entry and the
unlucky loser will cause an oops: xip_file_fault calls vm_insert_pfn (via
vm_insert_mixed) which drops out at this check:
retval = -EBUSY;
if (!pte_none(*pte))
goto out_unlock;
The resulting -EBUSY return value will trigger a BUG_ON() in
xip_file_fault.
This fix simply considers the fault as fixed in this case, because the
race winner has successfully installed the pte.
[akpm@linux-foundation.org: use conventional (and consistent) comment layout]
Reported-by: David Sadler <dsadler@us.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Reported-by: Louis Alex Eisner <leisner@cs.ucsd.edu>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/filemap_xip.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
index 1888b2d..e395030 100644
--- a/mm/filemap_xip.c
+++ b/mm/filemap_xip.c
@@ -262,7 +262,12 @@ found:
xip_pfn);
if (err == -ENOMEM)
return VM_FAULT_OOM;
- BUG_ON(err);
+ /*
+ * err == -EBUSY is fine, we've raced against another thread
+ * that faulted-in the same page
+ */
+ if (err != -EBUSY)
+ BUG_ON(err);
return VM_FAULT_NOPAGE;
} else {
int err, ret = VM_FAULT_OOM;
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 04/13] udf: Mark LVID buffer as uptodate before marking it dirty
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (3 preceding siblings ...)
2012-03-12 0:44 ` [ 03/13] mm/filemap_xip.c: fix race condition in xip_file_fault() Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 05/13] eCryptfs: Infinite loop due to overflow in ecryptfs_write() Willy Tarreau
` (8 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Jan Kara, Dave Jones, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit 853a0c25baf96b028de1654bea1e0c8857eadf3d upstream.
When we hit EIO while writing LVID, the buffer uptodate bit is cleared.
This then results in an anoying warning from mark_buffer_dirty() when we
write the buffer again. So just set uptodate flag unconditionally.
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/udf/super.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 1e4543c..ee6b3af 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1791,6 +1791,12 @@ static void udf_open_lvid(struct super_block *sb)
le16_to_cpu(lvid->descTag.descCRCLength)));
lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag);
+ /*
+ * We set buffer uptodate unconditionally here to avoid spurious
+ * warnings from mark_buffer_dirty() when previous EIO has marked
+ * the buffer as !uptodate
+ */
+ set_buffer_uptodate(bh);
mark_buffer_dirty(bh);
sbi->s_lvid_dirty = 0;
}
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 05/13] eCryptfs: Infinite loop due to overflow in ecryptfs_write()
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (4 preceding siblings ...)
2012-03-12 0:44 ` [ 04/13] udf: Mark LVID buffer as uptodate before marking it dirty Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 06/13] eCryptfs: Remove mmap from directory operations Willy Tarreau
` (7 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Li Wang, Yunchuan Wen, Tyler Hicks, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Li Wang <liwang@nudt.edu.cn>
commit 684a3ff7e69acc7c678d1a1394fe9e757993fd34 upstream.
ecryptfs_write() can enter an infinite loop when truncating a file to a
size larger than 4G. This only happens on architectures where size_t is
represented by 32 bits.
This was caused by a size_t overflow due to it incorrectly being used to
store the result of a calculation which uses potentially large values of
type loff_t.
[tyhicks@canonical.com: rewrite subject and commit message]
Signed-off-by: Li Wang <liwang@nudt.edu.cn>
Signed-off-by: Yunchuan Wen <wenyunchuan@kylinos.com.cn>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ecryptfs/read_write.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
index 6b78546..0404659 100644
--- a/fs/ecryptfs/read_write.c
+++ b/fs/ecryptfs/read_write.c
@@ -134,7 +134,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
pgoff_t ecryptfs_page_idx = (pos >> PAGE_CACHE_SHIFT);
size_t start_offset_in_page = (pos & ~PAGE_CACHE_MASK);
size_t num_bytes = (PAGE_CACHE_SIZE - start_offset_in_page);
- size_t total_remaining_bytes = ((offset + size) - pos);
+ loff_t total_remaining_bytes = ((offset + size) - pos);
if (fatal_signal_pending(current)) {
rc = -EINTR;
@@ -145,7 +145,7 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
num_bytes = total_remaining_bytes;
if (pos < offset) {
/* remaining zeros to write, up to destination offset */
- size_t total_remaining_zeros = (offset - pos);
+ loff_t total_remaining_zeros = (offset - pos);
if (num_bytes > total_remaining_zeros)
num_bytes = total_remaining_zeros;
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 06/13] eCryptfs: Remove mmap from directory operations
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (5 preceding siblings ...)
2012-03-12 0:44 ` [ 05/13] eCryptfs: Infinite loop due to overflow in ecryptfs_write() Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 07/13] ecryptfs: read on a directory should return EISDIR if not supported Willy Tarreau
` (6 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tyler Hicks, Colin Ian King, Tim Gardner, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
backported from 38e3eaeedcac75360af8a92e7b66956ec4f334e5
Adrian reported that mkfontscale didn't work inside of eCryptfs mounts.
Strace revealed the following:
open("./", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
fcntl64(3, F_GETFD) = 0x1 (flags FD_CLOEXEC)
open("./fonts.scale", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
getdents(3, /* 80 entries */, 32768) = 2304
open("./.", O_RDONLY) = 5
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
fstat64(5, {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0
mmap2(NULL, 16384, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7fcf000
close(5) = 0
--- SIGBUS (Bus error) @ 0 (0) ---
+++ killed by SIGBUS +++
The mmap2() on a directory was successful, resulting in a SIGBUS
signal later. This patch removes mmap() from the list of possible
ecryptfs_dir_fops so that mmap() isn't possible on eCryptfs directory
files.
http://bugs.launchpad.net/bugs/400443
Reported-by: Adrian C. <anrxc@sysphere.org>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ecryptfs/file.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index 4e25328..d8adc51 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -327,7 +327,6 @@ const struct file_operations ecryptfs_dir_fops = {
#ifdef CONFIG_COMPAT
.compat_ioctl = ecryptfs_compat_ioctl,
#endif
- .mmap = generic_file_mmap,
.open = ecryptfs_open,
.flush = ecryptfs_flush,
.release = ecryptfs_release,
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 07/13] ecryptfs: read on a directory should return EISDIR if not supported
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (6 preceding siblings ...)
2012-03-12 0:44 ` [ 06/13] eCryptfs: Remove mmap from directory operations Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 08/13] eCryptfs: Remove extra d_delete in ecryptfs_rmdir Willy Tarreau
` (5 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Andy Whitcroft, Tyler Hicks
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Andy Whitcroft <apw@canonical.com>
commit 323ef68faf1bbd9b1e66aea268fd09d358d7e8ab upstream.
read() calls against a file descriptor connected to a directory are
incorrectly returning EINVAL rather than EISDIR:
[EISDIR]
[XSI] [Option Start] The fildes argument refers to a directory and the
implementation does not allow the directory to be read using read()
or pread(). The readdir() function should be used instead. [Option End]
This occurs because we do not have a .read operation defined for
ecryptfs directories. Connect this up to generic_read_dir().
BugLink: http://bugs.launchpad.net/bugs/719691
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
---
fs/ecryptfs/file.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index d8adc51..3015389 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -323,6 +323,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
const struct file_operations ecryptfs_dir_fops = {
.readdir = ecryptfs_readdir,
+ .read = generic_read_dir,
.unlocked_ioctl = ecryptfs_unlocked_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ecryptfs_compat_ioctl,
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 08/13] eCryptfs: Remove extra d_delete in ecryptfs_rmdir
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (7 preceding siblings ...)
2012-03-12 0:44 ` [ 07/13] ecryptfs: read on a directory should return EISDIR if not supported Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 09/13] eCryptfs: Clear i_nlink in rmdir Willy Tarreau
` (4 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tyler Hicks, Colin King, Tim Gardner, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
commit 35ffa948b2f7bdf79e488cd496232935d095087a upstream.
vfs_rmdir() already calls d_delete() on the lower dentry. That was being
duplicated in ecryptfs_rmdir() and caused a NULL pointer dereference
when NFSv3 was the lower filesystem.
BugLink: http://bugs.launchpad.net/bugs/723518
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Colin King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ecryptfs/inode.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 7ce5471..79ae6a7 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -575,8 +575,6 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry)
dget(lower_dentry);
rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
dput(lower_dentry);
- if (!rc)
- d_delete(lower_dentry);
fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);
dir->i_nlink = lower_dir_dentry->d_inode->i_nlink;
unlock_dir(lower_dir_dentry);
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 09/13] eCryptfs: Clear i_nlink in rmdir
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (8 preceding siblings ...)
2012-03-12 0:44 ` [ 08/13] eCryptfs: Remove extra d_delete in ecryptfs_rmdir Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 10/13] atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume Willy Tarreau
` (3 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tyler Hicks, Colin King, Tim Gardner, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
commit 07850552b92b3637fa56767b5e460b4238014447 upstream.
eCryptfs wasn't clearing the eCryptfs inode's i_nlink after a successful
vfs_rmdir() on the lower directory. This resulted in the inode evict and
destroy paths to be missed.
https://bugs.launchpad.net/ecryptfs/+bug/723518
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Colin King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/ecryptfs/inode.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index 79ae6a7..4434e8f 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -575,6 +575,8 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry)
dget(lower_dentry);
rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
dput(lower_dentry);
+ if (!rc && dentry->d_inode)
+ clear_nlink(dentry->d_inode);
fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode);
dir->i_nlink = lower_dir_dentry->d_inode->i_nlink;
unlock_dir(lower_dir_dentry);
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 10/13] atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (9 preceding siblings ...)
2012-03-12 0:44 ` [ 09/13] eCryptfs: Clear i_nlink in rmdir Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 11/13] lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel Willy Tarreau
` (2 subsequent siblings)
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Hubert Feurstein, Nicolas Ferre, Jean-Christophe PLAGNIOL-VILLARD,
Florian Tobias Schandinat, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Hubert Feurstein <h.feurstein@gmail.com>
commit 9f1065032ceb7e86c7c9f16bb86518857e88a172 upstream.
An error was existing in the saving of CONTRAST_CTR register
across suspend/resume.
Signed-off-by: Hubert Feurstein <h.feurstein@gmail.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/atmel_lcdfb.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
index d5e8010..8c5e432 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -1052,7 +1052,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
*/
lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
- sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
+ sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR);
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(0);
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 11/13] lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (10 preceding siblings ...)
2012-03-12 0:44 ` [ 10/13] atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 12/13] relay: prevent integer overflow in relay_open() Willy Tarreau
2012-03-12 0:44 ` [ 13/13] cdrom: use copy_to_user() without the underscores Willy Tarreau
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Peter Zijlstra, Wu Fengguang, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Wu Fengguang <fengguang.wu@intel.com>
commit 3310225dfc71a35a2cc9340c15c0e08b14b3c754 upstream.
PROP_MAX_SHIFT should be set to <=32 on 64-bit box. This fixes two bugs
in the below lines of bdi_dirty_limit():
bdi_dirty *= numerator;
do_div(bdi_dirty, denominator);
1) divide error: do_div() only uses the lower 32 bit of the denominator,
which may trimmed to be 0 when PROP_MAX_SHIFT > 32.
2) overflow: (bdi_dirty * numerator) could easily overflow if numerator
used up to 48 bits, leaving only 16 bits to bdi_dirty
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Reported-by: Ilya Tumaykin <librarian_rus@yahoo.com>
Tested-by: Ilya Tumaykin <librarian_rus@yahoo.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/proportions.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/linux/proportions.h b/include/linux/proportions.h
index cf793bb..22653d7 100644
--- a/include/linux/proportions.h
+++ b/include/linux/proportions.h
@@ -81,7 +81,11 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
* Limit the time part in order to ensure there are some bits left for the
* cycle counter and fraction multiply.
*/
+#if BITS_PER_LONG == 32
#define PROP_MAX_SHIFT (3*BITS_PER_LONG/4)
+#else
+#define PROP_MAX_SHIFT (BITS_PER_LONG/2)
+#endif
#define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1)
#define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT)
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 12/13] relay: prevent integer overflow in relay_open()
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (11 preceding siblings ...)
2012-03-12 0:44 ` [ 11/13] lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
2012-03-12 0:44 ` [ 13/13] cdrom: use copy_to_user() without the underscores Willy Tarreau
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dan Carpenter, Jens Axboe, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit f6302f1bcd75a042df69866d98b8d775a668f8f1 upstream.
"subbuf_size" and "n_subbufs" come from the user and they need to be
capped to prevent an integer overflow.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/relay.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/kernel/relay.c b/kernel/relay.c
index 760c262..bf343f5 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -171,10 +171,14 @@ depopulate:
*/
static struct rchan_buf *relay_create_buf(struct rchan *chan)
{
- struct rchan_buf *buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
- if (!buf)
+ struct rchan_buf *buf;
+
+ if (chan->n_subbufs > UINT_MAX / sizeof(size_t *))
return NULL;
+ buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
+ if (!buf)
+ return NULL;
buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
if (!buf->padding)
goto free_buf;
@@ -581,6 +585,8 @@ struct rchan *relay_open(const char *base_filename,
if (!(subbuf_size && n_subbufs))
return NULL;
+ if (subbuf_size > UINT_MAX / n_subbufs)
+ return NULL;
chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
if (!chan)
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [ 13/13] cdrom: use copy_to_user() without the underscores
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
` (12 preceding siblings ...)
2012-03-12 0:44 ` [ 12/13] relay: prevent integer overflow in relay_open() Willy Tarreau
@ 2012-03-12 0:44 ` Willy Tarreau
13 siblings, 0 replies; 14+ messages in thread
From: Willy Tarreau @ 2012-03-12 0:44 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Dan Carpenter, Jens Axboe, Greg Kroah-Hartman
2.6.27-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
commit 822bfa51ce44f2c63c300fdb76dc99c4d5a5ca9f upstream.
"nframes" comes from the user and "nframes * CD_FRAMESIZE_RAW" can wrap
on 32 bit systems. That would have been ok if we used the same wrapped
value for the copy, but we use a shifted value. We should just use the
checked version of copy_to_user() because it's not going to make a
difference to the speed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cdrom/cdrom.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 59cccc9..a4592ec 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -2057,11 +2057,6 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
if (!nr)
return -ENOMEM;
- if (!access_ok(VERIFY_WRITE, ubuf, nframes * CD_FRAMESIZE_RAW)) {
- ret = -EFAULT;
- goto out;
- }
-
cgc.data_direction = CGC_DATA_READ;
while (nframes > 0) {
if (nr > nframes)
@@ -2070,7 +2065,7 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
ret = cdrom_read_block(cdi, &cgc, lba, nr, 1, CD_FRAMESIZE_RAW);
if (ret)
break;
- if (__copy_to_user(ubuf, cgc.buffer, CD_FRAMESIZE_RAW * nr)) {
+ if (copy_to_user(ubuf, cgc.buffer, CD_FRAMESIZE_RAW * nr)) {
ret = -EFAULT;
break;
}
@@ -2078,7 +2073,6 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
nframes -= nr;
lba += nr;
}
-out:
kfree(cgc.buffer);
return ret;
}
--
1.7.2.1.45.g54fbc
^ permalink raw reply related [flat|nested] 14+ messages in thread
end of thread, other threads:[~2012-03-12 0:44 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <fec4dd6c17083169f2e217caca7375ef@local>
2012-03-12 0:44 ` [ 00/13] 2.6.27.62-longterm review Willy Tarreau
2012-03-12 0:44 ` [ 01/13] powerpc: Add more Power7 specific definitions Willy Tarreau
2012-03-12 0:44 ` [ 02/13] IB/mlx4: pass SMP vendor-specific attribute MADs to firmware Willy Tarreau
2012-03-12 0:44 ` [ 03/13] mm/filemap_xip.c: fix race condition in xip_file_fault() Willy Tarreau
2012-03-12 0:44 ` [ 04/13] udf: Mark LVID buffer as uptodate before marking it dirty Willy Tarreau
2012-03-12 0:44 ` [ 05/13] eCryptfs: Infinite loop due to overflow in ecryptfs_write() Willy Tarreau
2012-03-12 0:44 ` [ 06/13] eCryptfs: Remove mmap from directory operations Willy Tarreau
2012-03-12 0:44 ` [ 07/13] ecryptfs: read on a directory should return EISDIR if not supported Willy Tarreau
2012-03-12 0:44 ` [ 08/13] eCryptfs: Remove extra d_delete in ecryptfs_rmdir Willy Tarreau
2012-03-12 0:44 ` [ 09/13] eCryptfs: Clear i_nlink in rmdir Willy Tarreau
2012-03-12 0:44 ` [ 10/13] atmel_lcdfb: fix usage of CONTRAST_CTR in suspend/resume Willy Tarreau
2012-03-12 0:44 ` [ 11/13] lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel Willy Tarreau
2012-03-12 0:44 ` [ 12/13] relay: prevent integer overflow in relay_open() Willy Tarreau
2012-03-12 0:44 ` [ 13/13] cdrom: use copy_to_user() without the underscores Willy Tarreau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).