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]
Message-ID: <20211007134103.4da8a8ab@gandalf.local.home>
Date:   Thu, 7 Oct 2021 13:41:03 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Yafang Shao <laoar.shao@...il.com>
Cc:     pmladek@...e.com, keescook@...omium.org, viro@...iv.linux.org.uk,
        akpm@...ux-foundation.org, peterz@...radead.org,
        valentin.schneider@....com, mathieu.desnoyers@...icios.com,
        qiang.zhang@...driver.com, robdclark@...omium.org,
        christian@...uner.io, dietmar.eggemann@....com, mingo@...hat.com,
        juri.lelli@...hat.com, vincent.guittot@...aro.org,
        bsegall@...gle.com, mgorman@...e.de, bristot@...hat.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/4] kernel/kthread: show a warning if kthread's comm
 is truncated

On Thu,  7 Oct 2021 12:07:52 +0000
Yafang Shao <laoar.shao@...il.com> wrote:

> -		vsnprintf(name, sizeof(name), namefmt, args);
> +		len = vsnprintf(name, sizeof(name), namefmt, args);
> +		if (len >= TASK_COMM_LEN) {
> +			pr_warn("truncated kthread comm:%s, pid:%d by %d characters\n",
> +				name, task->pid, len - TASK_COMM_LEN + 1);

Instead of saying how many characters it is truncated to, what about just
showing what it was truncated to?

			pr_warn("truncated kthread comm from:%s to:%.*s for pid:%d\n",
				name, TASK_COMM_LEN - 1, name, task->pid);

?

-- Steve

> +		}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ