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: <20210412112256.880-1-sjpark@amazon.de>
Date:   Mon, 12 Apr 2021 11:22:56 +0000
From:   SeongJae Park <sj38.park@...il.com>
To:     SeongJae Park <sj38.park@...il.com>
Cc:     akpm@...ux-foundation.org, SeongJae Park <sjpark@...zon.de>,
        Jonathan.Cameron@...wei.com, acme@...nel.org,
        alexander.shishkin@...ux.intel.com, amit@...nel.org,
        benh@...nel.crashing.org, brendanhiggins@...gle.com,
        corbet@....net, david@...hat.com, dwmw@...zon.com,
        elver@...gle.com, fan.du@...el.com, foersleo@...zon.de,
        greg@...ah.com, gthelen@...gle.com, guoju.fgj@...baba-inc.com,
        mgorman@...e.de, minchan@...nel.org, mingo@...hat.com,
        namhyung@...nel.org, peterz@...radead.org, riel@...riel.com,
        rientjes@...gle.com, rostedt@...dmis.org, rppt@...nel.org,
        shakeelb@...gle.com, shuah@...nel.org, snu@...zon.de,
        vbabka@...e.cz, vdavydov.dev@...il.com, zgf574564920@...il.com,
        linux-damon@...zon.com, linux-mm@...ck.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v27 07/13] mm/damon: Implement a debugfs-based user space interface

From: SeongJae Park <sjpark@...zon.de>

On Thu,  8 Apr 2021 13:48:48 +0000 SeongJae Park <sj38.park@...il.com> wrote:

> From: SeongJae Park <sjpark@...zon.de>
> 
> DAMON is designed to be used by kernel space code such as the memory
> management subsystems, and therefore it provides only kernel space API.
> That said, letting the user space control DAMON could provide some
> benefits to them.  For example, it will allow user space to analyze
> their specific workloads and make their own special optimizations.
> 
> For such cases, this commit implements a simple DAMON application kernel
> module, namely 'damon-dbgfs', which merely wraps the DAMON api and
> exports those to the user space via the debugfs.
>
[...]
> +/*
> + * Functions for the initialization
> + */
> +
> +static int __init damon_dbgfs_init(void)
> +{
> +	int rc;
> +
> +	dbgfs_ctxs = kmalloc(sizeof(*dbgfs_ctxs), GFP_KERNEL);
> +	if (!dbgfs_ctxs) {
> +		pr_err("%s: dbgfs ctxs alloc failed\n", __func__);
> +		return -ENOMEM;
> +	}
> +	dbgfs_ctxs[0] = dbgfs_new_ctx();
> +	if (!dbgfs_ctxs[0]) {
> +		pr_err("%s: dbgfs ctx alloc failed\n", __func__);
> +		return -ENOMEM;

My colleague, Stefan found 'dbgfs_ctxs' is not freed here.  Similar in below
'__damon_dbgfs_init()' failure handling.  I will fix these in the next version.

Reported-by: Stefan Nuernberger <snu@...zon.de>


Thanks,
SeongJae Park

> +	}
> +	dbgfs_nr_ctxs = 1;
> +
> +	rc = __damon_dbgfs_init();
> +	if (rc)
> +		pr_err("%s: dbgfs init failed\n", __func__);
> +
> +	return rc;
> +}
> +
> +module_init(damon_dbgfs_init);
> -- 
> 2.17.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ