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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200304163922.GG189690@mtj.thefacebook.com>
Date:   Wed, 4 Mar 2020 11:39:22 -0500
From:   Tejun Heo <tj@...nel.org>
To:     Daniel Xu <dxu@...uu.xyz>
Cc:     cgroups@...r.kernel.org, lizefan@...wei.com, hannes@...xchg.org,
        linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
        kernel-team@...com
Subject: Re: [PATCH 1/2] kernfs: Add option to enable user xattrs

Hello,

On Tue, Mar 03, 2020 at 11:37:28AM -0800, Daniel Xu wrote:
> It looks like in fs/xattr.c:setxattr, there is already:
> 
>     ...
>     if (size) {
>         if (size > XATTR_SIZE_MAX)
>             return -E2BIG;
>     ...
> 
> where XATTR_SIZE_MAX is defined as 64k. Do you want it even smaller?

Oh, I missed that. Order 5 allocations can still be on the big side
tho. Ideally, something like the following?

* Total number of bytes limit as the primary limit so that we can say
  that for a given cgroup user xattrs don't consume more than X bytes.
  We can pick an arbitrary number which is large enough for most use
  cases but not too big. e.g. 128k or whatever.

* Total number of xattrs limit. Again, some arbitrary not too low, not
  too high limit.

* Switch to kvmalloc() for attr allocation so that we don't have to
  worry about high order allocations.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ