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]
Date:	Thu, 15 Oct 2015 12:02:06 -0400
From:	Doug Ledford <dledford@...hat.com>
To:	j.glisse@...il.com, linux-kernel@...r.kernel.org
Cc:	Jérôme Glisse <jglisse@...hat.com>,
	linux-rdma@...r.kernel.org, Haggai Eran <haggaie@...lanox.com>,
	Sagi Grimberg <sagig@...lanox.com>,
	Shachar Raindel <raindel@...lanox.com>
Subject: Re: [PATCH] IB/core: Print error when umem fails due to locked memory
 limit.

On 10/15/2015 10:21 AM, j.glisse@...il.com wrote:
> From: Jérôme Glisse <jglisse@...hat.com>
> 
> It can be rather tedious to find why userspace is failing when only
> thing kernel report is -ENOMEM. This add an error message so that
> user can figure out why they are getting -ENOMEM.
> 
> Signed-off-by: Jérôme Glisse <jglisse@...hat.com>
> cc: <linux-rdma@...r.kernel.org>
> Cc: Haggai Eran <haggaie@...lanox.com>
> Cc: Sagi Grimberg <sagig@...lanox.com>
> Cc: Shachar Raindel <raindel@...lanox.com>
> Cc: Doug Ledford <dledford@...hat.com>
> ---
>  drivers/infiniband/core/umem.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
> index 38acb3c..a66929e 100644
> --- a/drivers/infiniband/core/umem.c
> +++ b/drivers/infiniband/core/umem.c
> @@ -169,6 +169,7 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
>  	lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
>  
>  	if ((locked > lock_limit) && !capable(CAP_IPC_LOCK)) {
> +		pr_err("locked memory quota exhausted (see ulimit -l)\n");
>  		ret = -ENOMEM;
>  		goto out;
>  	}
> 

This looks like it could easily cause a flood of messages (possibly even
enough to DoS the machine).  Please convert this to some sort of rate
limited output (preferably, you would issue this warning only once per
task, and the error would include the command name).

-- 
Doug Ledford <dledford@...hat.com>
              GPG KeyID: 0E572FDD



Download attachment "signature.asc" of type "application/pgp-signature" (885 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ