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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 10 Jun 2020 13:29:30 +0200
From:   Jiri Slaby <jslaby@...e.cz>
To:     linux-kernel@...r.kernel.org, linux-tip-commits@...r.kernel.org
Cc:     Brian Gerst <brgerst@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Dominik Brodowski <linux@...inikbrodowski.net>,
        x86 <x86@...nel.org>
Subject: Re: [tip: x86/entry] x86/entry/32: Use IA32-specific wrappers for
 syscalls taking 64-bit arguments

On 21. 03. 20, 16:30, tip-bot2 for Brian Gerst wrote:
> The following commit has been merged into the x86/entry branch of tip:
> 
> Commit-ID:     121b32a58a3af89a780cf194ce3769fc4120e574
> Gitweb:        https://git.kernel.org/tip/121b32a58a3af89a780cf194ce3769fc4120e574
> Author:        Brian Gerst <brgerst@...il.com>
> AuthorDate:    Fri, 13 Mar 2020 15:51:41 -04:00
> Committer:     Thomas Gleixner <tglx@...utronix.de>
> CommitterDate: Sat, 21 Mar 2020 16:03:24 +01:00
> 
> x86/entry/32: Use IA32-specific wrappers for syscalls taking 64-bit arguments
> 

Hi,

this breaks creation of sparse files (e.g. by tar) on i586 (in 5.7).

tar does this:
> openat(4, "sparsefile", O_WRONLY|O_CREAT|O_EXCL|O_NOCTTY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC, 0600) = 5
> _llseek(5, 0, [0], SEEK_SET)      = 0
> _llseek(5, 8589934592, [8589934592], SEEK_SET) = 0
> write(5, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"..., 512) = 512
> _llseek(5, 8589935104, [8589935104], SEEK_SET) = 0
> _llseek(5, 0, [8589935104], SEEK_CUR) = 0
> ftruncate64(5, 8589935104)        = 0
> utimensat_time64(5, NULL, [UTIME_OMIT, {tv_sec=1591782127, tv_nsec=400000000} /* 2020-06-10T11:42:07.400000000+0200 */], 0) = 0
> fchown32(5, 0, 0)                 = 0
> fchmod(5, 0644)                   = 0
> close(5)                          = 0

It should result in a sparsefile of size 8589935104, but after this
commit, it's only 512 bytes.

The archive is this:
XQAAgAD//////////wAXC8aHklo7p4/HJQ64D7SVnhAZOByg5PlRjaTJjmKhpQbF1loXWBYREoWY
DagQFjCR/jUwLV7mWbgHwcINuoi1bu/eDQHOp5mXL9bq/twuolv5Y2krdqZEztWCBydhsNFwBxHi
U47whwTByiH4Ot16JcEkr4BFWXHXMTRs1lfVmIOE13bldiM6MzQUC7212b81Rn13fw06uk+aoP74
OvatxDoW95Y7/xeMyDQ7uk8L1OfFGVRfU+PFycrb1gDZc6hLY2kDY15PGxCMSzHHGDE3nTr9Imdw
UoUYqYNhi3tztLuue2rvzngAsMvHIEJaE6i2E5+X7lwlHZhg9Wp2T9ow9DyaJYLr/N+Jln7P1C97
2hT9YzrPNupujamDoBv0kIA3zgAw/xHvZX/I3tfa5Z8+TjrhfgJ8poGKK1S1e8LR+657FbBH3B46
HZFclvO0bUvL1xyRx0OPM1Dzzd+lH8VgF6RYHj1vDJCcR8nbtEfgN5W+cN44xdPO1VN/6Ffnj5Af
84sDSaBSn7HTnaaJRX0KPa3zfdUzTv/ykgihysjhxAV9CW02ZiVffVgrK5UHVuoWzqQ76+83fYsM
rSWRtoL0a3eo/hbqPvHg1Q8dRvbjwLs610lu3QIkvQ0DOK7zUHx44ODHfLBS2LJcw5TCiU25xGCm
NXS1oRaVdqnCV6Rl5KZHPiHF7ZRxQFQxLgreu8z0INZ41T74pGbfGvNRqyLy9wxiO4/uCICO0om/
oHlgowb9RWX9/0Z2

Feed it through (on i586):
mkdir directory; base64 -d | tar JxvC directory/

and check the size of directory/sparsefile.

Reverting the commit on the top of 5.7 doesn't help. I suppose it
doesn't take the original path in the code there...

Any ideas?

> For the 32-bit syscall interface, 64-bit arguments (loff_t) are passed via
> a pair of 32-bit registers.  These register pairs end up in consecutive stack
> slots, which matches the C ABI for 64-bit arguments.  But when accessing the
> registers directly from pt_regs, the wrapper needs to manually reassemble the
> 64-bit value.  These wrappers already exist for 32-bit compat, so make them
> available to 32-bit native in preparation for enabling pt_regs-based syscalls.
> 
> Signed-off-by: Brian Gerst <brgerst@...il.com>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Reviewed-by: Dominik Brodowski <linux@...inikbrodowski.net>
> Link: https://lkml.kernel.org/r/20200313195144.164260-16-brgerst@gmail.com

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ