lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200610170908.k9H989xT004364@vass.7ka.mipt.ru>
Date:	Tue, 17 Oct 2006 13:08:09 +0400
From:	Vasily Tarasov <vtaras@...nvz.org>
To:	Jan Kara <jack@...e.cz>
CC:	OpenVZ Developers List <devel@...nvz.org>
Subject: 32 bit quota tools problem on 64bit architectures

OpenVZ Linux kernel team has discovered that there is a problem
with 32 bit quota tools on 64 bit architectures.

In 2.6.10 kernel the patch
http://linux.bkbits.net:8080/linux-2.6/patch@...938.302.19 was introduced:

--- a/arch/x86_64/ia32/ia32entry.S	2006-10-17 09:40:14 -07:00
+++ b/arch/x86_64/ia32/ia32entry.S	2006-10-17 09:40:14 -07:00
@@ -433,7 +433,7 @@
 	.quad sys_init_module
 	.quad sys_delete_module
 	.quad quiet_ni_syscall		/* 130  get_kernel_syms */
-	.quad sys32_quotactl		/* quotactl */ 
+	.quad sys_quotactl
 	.quad sys_getpgid
 	.quad sys_fchdir
 	.quad quiet_ni_syscall	/* bdflush */

The comment for this patch is:

"[PATCH] x86_64: Add 32bit quota support
[untested, but other 64bit ports seem to get away with it]
sys_quotactl seems to be 32/64bit clean, enable it for 32bit."

However this isn't right! Look at if_dqblk structure:

struct if_dqblk {
        __u64 dqb_bhardlimit;
        __u64 dqb_bsoftlimit;
        __u64 dqb_curspace;
        __u64 dqb_ihardlimit;
        __u64 dqb_isoftlimit;
        __u64 dqb_curinodes;
        __u64 dqb_btime;
        __u64 dqb_itime;
        __u32 dqb_valid;
};

For 64 bit kernel its size is 0x48, but not 0x44, 'cause of alignment!
But for 32 bit quota tools it's 0x44, 'cause there is no such alignment.
Thus we got a problem. In OpenVZ technology 32 bit Virtual Environments over 
64 bit OS are common, hence we have customers, that complains on this bad quota
behaviour: 

# /usr/bin/quota
quota: error while getting quota from /dev/sda1 for 0: Success

The reason of this bad behaviour is stated above.

Thank you,
	Vasily Tarasov,
	OpenVZ Linux kernel team

FYI, node description:
# uname -a
Linux nodename 2.6.18 #1 SMP Tue Oct 17 12:24:11 MSD 2006 x86_64 x86_64 x86_64
GNU/Linux
# /usr/bin/quota -V
Quota utilities version 3.13.
Compiled with RPC and EXT2_DIRECT
Bugs to jack@...e.cz

(quota-tools are got from Debian testing repository.)

# file /usr/bin/quota
/ust/bin/quota: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
GNU/Linux 2.4.1, dynamically linked (uses shared libs), stripped
# ls -l /lib/libc.so.6
lrwxrwxrwx  1 root root 13 Oct  4 13:50 /lib/libc.so.6 -> libc-2.3.4.so
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ