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]
Date:	Tue, 20 Oct 2015 13:16:33 +0200 (CEST)
From:	Paul Osmialowski <p.osmialowsk@...sung.com>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	Jonathan Corbet <corbet@....net>, Arnd Bergmann <arnd@...db.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Petr Mladek <pmladek@...e.cz>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Daniel Mack <daniel@...que.org>,
	Kay Sievers <kay.sievers@...y.org>,
	Joe Perches <joe@...ches.com>, Tejun Heo <tj@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	Linux API <linux-api@...r.kernel.org>,
	Marcin Niesluchowski <m.niesluchow@...sung.com>,
	Karol Lewandowski <k.lewandowsk@...sung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Shuah Khan <shuahkh@....samsung.com>,
	Paul Osmialowski <p.osmialowsk@...sung.com>
Subject: Re: [RFC v3 8/9] kmsg: add predefined _PID, _TID,
 _COMM keywords to kmsg* log dict

Hi Andy,

On Mon, 19 Oct 2015, Andy Lutomirski wrote:

> On Mon, Oct 19, 2015 at 5:58 AM, Paul Osmialowski
> <p.osmialowsk@...sung.com> wrote:
>> From: Marcin Niesluchowski <m.niesluchow@...sung.com>
>>
>> kmsg* devices write operation wrote no dict along with message
>> Due to usage of kmsg devices in userspace dict has been added
>> identifying pid, tid and comm of writing process.
>
> Does this affect even the normal /dev/kmsg?

Yes.

>
>> -static int kmsg_sys_write(int minor, int level, const char *fmt, ...)
>> +static size_t set_kmsg_dict(char *buf)
>> +{
>> +       size_t len;
>> +
>> +       len = sprintf(buf, "_PID=%d", task_tgid_nr(current)) + 1;
>> +       len += sprintf(buf + len, "_TID=%d", task_pid_nr(current)) + 1;
>> +       memcpy(buf + len, "_COMM=", 6);
>> +       len += 6;
>> +       get_task_comm(buf + len, current);
>> +       while (buf[len] != '\0')
>> +               len++;
>
> len += strlen(buf); ?
>
> Is it obvious for some reason that this doesn't overflow buf?
>

KMSG_DICT_MAX_LEN sets architecture-intepentent max size.

> Why is task_pid_nr acceptable here?  Isn't this intended for use in namespaces?
>

task_tgid_nr - process id (pid as seen in userspace),
task_pid_nr - thread id

Thanks,
Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ