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] [day] [month] [year] [list]
Message-ID: <a5b51084-f289-3363-a77b-ca3bf55d78b6@suse.cz>
Date:   Wed, 10 Jun 2020 13:42:51 +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 10. 06. 20, 13:29, Jiri Slaby wrote:
> 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?

Got it:
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -1358,7 +1358,7 @@ static inline long ksys_lchown(const char __user
*filename, uid_t user,

 extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small);

-static inline long ksys_ftruncate(unsigned int fd, unsigned long length)
+static inline long ksys_ftruncate(unsigned int fd, loff_t length)
 {
        return do_sys_ftruncate(fd, length, 1);
 }

Will send a patch in few minutes.

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ