/[linux-patches]/genpatches-2.6/trunk/2.6.14/1145_4_listxattr-security-bounds.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1145_4_listxattr-security-bounds.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 292 - (show annotations) (download) (as text)
Tue Jan 31 21:50:53 2006 UTC (14 years, 9 months ago) by johnm
File MIME type: text/x-diff
File size: 2083 byte(s)
Large update - thanks goes to Kerin Millar for the legwork.
1 From stable-bounces@linux.kernel.org Mon Dec 12 09:33:51 2005
2 Message-ID: <439DB3FC.6040700@gentoo.org>
3 Date: Mon, 12 Dec 2005 17:31:40 +0000
4 From: Daniel Drake <dsd@gentoo.org>
5 To: stable@kernel.org
6 Cc:
7 Subject: Fix listxattr() for generic security attributes
8 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=894ec8707ced240b96dc45944790fb35d9a6b03c
9
10 From: Daniel Drake <dsd@gentoo.org>
11
12 [PATCH] Fix listxattr() for generic security attributes
13
14 Commit f549d6c18c0e8e6cf1bf0e7a47acc1daf7e2cec1 introduced a generic
15 fallback for security xattrs, but appears to include a subtle bug.
16
17 Gentoo users with kernels with selinux compiled in, and coreutils compiled
18 with acl support, noticed that they could not copy files on tmpfs using
19 'cp'.
20
21 cp (compiled with acl support) copies the file, lists the extended
22 attributes on the old file, copies them all to the new file, and then
23 exits. However the listxattr() calls were failing with this odd behaviour:
24
25 llistxattr("a.out", (nil), 0) = 17
26 llistxattr("a.out", 0x7fffff8c6cb0, 17) = -1 ERANGE (Numerical result out of
27 range)
28
29 I believe this is a simple problem in the logic used to check the buffer
30 sizes; if the user sends a buffer the exact size of the data, then its ok
31 :)
32
33 This change solves the problem.
34 More info can be found at http://bugs.gentoo.org/113138
35
36 Signed-off-by: Daniel Drake <dsd@gentoo.org>
37 Acked-by: James Morris <jmorris@namei.org>
38 Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
39 Signed-off-by: Andrew Morton <akpm@osdl.org>
40 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
41 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
42 ---
43 fs/xattr.c | 2 +-
44 1 file changed, 1 insertion(+), 1 deletion(-)
45
46 --- linux-2.6.14.3.orig/fs/xattr.c
47 +++ linux-2.6.14.3/fs/xattr.c
48 @@ -243,7 +243,7 @@ listxattr(struct dentry *d, char __user
49 error = d->d_inode->i_op->listxattr(d, klist, size);
50 } else {
51 error = security_inode_listsecurity(d->d_inode, klist, size);
52 - if (size && error >= size)
53 + if (size && error > size)
54 error = -ERANGE;
55 }
56 if (error > 0) {

  ViewVC Help
Powered by ViewVC 1.1.20