Re: TMPFS permissions bug in 2.6.35-rc3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 20 Jun 2010, Chuck Fox wrote:
> 
>    I've encountered a bug in 2.6.35-RC3 where my /tmp directory
> (mounted using tmpfs) returns a "File too large" error when adding
> execute privileges for the group permission byte:
>        Example:
>            touch /tmp/afile
>            chmod 767 /tmp/afile   # example where chmod works fine
> setting bits that are not the group execute bit
>            chmod 755 /tmp/afile
>            chmod: changing permissions of `/tmp/afile': File too large  # bug

How very peculiar!  Thank you for reporting it.  I was about to suggest
some memory corruption must have occurred, but no....

> 
>    There are several gigabytes of free RAM + several more gigabytes of
> swap space available.
> 
>    Here's more information:
> 
> Linux alpha1 2.6.35-rc3-next-20100614 #5 SMP Sun Jun 20 18:55:35 EDT
> 2010 x86_64 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel
> GNU/Linux
> ...

... that's actually one of the linux-next kernels you're running there:
and I bet you'll find Jiri's patch below fixes your problem!

>From jslaby@xxxxxxx Wed Jun 16 14:51:42 2010
Date: Wed, 16 Jun 2010 23:50:21 +0200
From: Jiri Slaby <jslaby@xxxxxxx>
To: viro@xxxxxxxxxxxxxxxxxx
Cc: akpm@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, jirislaby@xxxxxxxxx, Christoph Hellwig <hch@xxxxxx>
Subject: [PATCH 1/1] FS: attr, check ATTR_SIZE in ia_valid not ia_mode

Fix a bug introduced by commit "check ATTR_SIZE contraints in
inode_change_ok" which added a size check, but checks the size even if
ATTR_SIZE is not in attr->ia_valid because it tests the bit in
attr->ia_mode.

Test properly against ia_valid.

Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
---
 fs/attr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/attr.c b/fs/attr.c
index 6959666..7ca4181 100644
--- a/fs/attr.c
+++ b/fs/attr.c
@@ -34,7 +34,7 @@ int inode_change_ok(const struct inode *inode, struct iattr *attr)
 	 * First check size constraints.  These can't be overriden using
 	 * ATTR_FORCE.
 	 */
-	if (attr->ia_mode & ATTR_SIZE) {
+	if (ia_valid & ATTR_SIZE) {
 		int error = inode_newsize_ok(inode, attr->ia_size);
 		if (error)
 			return error;
-- 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]