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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALOAHbBwRcZoRteU7qL7rdip=cbTHc3n6-eJrd6xUoeJ+Win6Q@mail.gmail.com>
Date:   Tue, 26 Oct 2021 09:50:43 +0800
From:   Yafang Shao <laoar.shao@...il.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>,
        Petr Mladek <pmladek@...e.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Al Viro <viro@...iv.linux.org.uk>,
        Valentin Schneider <valentin.schneider@....com>,
        Qiang Zhang <qiang.zhang@...driver.com>,
        robdclark <robdclark@...omium.org>,
        christian <christian@...uner.io>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Ingo Molnar <mingo@...hat.com>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        David Miller <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>, Martin Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        john fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...nel.org>,
        dennis.dalessandro@...nelisnetworks.com,
        mike.marciniszyn@...nelisnetworks.com, dledford@...hat.com,
        jgg@...pe.ca, linux-rdma@...r.kernel.org,
        netdev <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
        "linux-perf-use." <linux-perf-users@...r.kernel.org>,
        linux-fsdevel@...r.kernel.org, Linux MM <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        kernel test robot <oliver.sang@...el.com>,
        kbuild test robot <lkp@...el.com>,
        Andrii Nakryiko <andrii.nakryiko@...il.com>,
        Vladimir Zapolskiy <vzapolskiy@...il.com>,
        David Howells <dhowells@...hat.com>
Subject: Re: [PATCH v6 03/12] drivers/connector: make connector comm always
 nul ternimated

On Tue, Oct 26, 2021 at 5:14 AM Kees Cook <keescook@...omium.org> wrote:
>
> On Mon, Oct 25, 2021 at 08:33:06AM +0000, Yafang Shao wrote:
> > connector comm was introduced in commit
> > f786ecba4158 ("connector: add comm change event report to proc connector").
> > struct comm_proc_event was defined in include/linux/cn_proc.h first and
> > then been moved into file include/uapi/linux/cn_proc.h in commit
> > 607ca46e97a1 ("UAPI: (Scripted) Disintegrate include/linux").
> >
> > As this is the UAPI code, we can't change it without potentially breaking
> > things (i.e. userspace binaries have this size built in, so we can't just
> > change the size). To prepare for the followup change - extending task
> > comm, we have to use __get_task_comm() to avoid the BUILD_BUG_ON() in
> > proc_comm_connector().
>
> I wonder, looking at this again, if it might make more sense to avoid
> this cn_proc.c change, and instead, adjust get_task_comm() like so:
>
> #define get_task_comm(buf, tsk)
>         __get_task_comm(buf, __must_be_array(buf) + sizeof(buf), tsk)
>
> This would still enforce the original goal of making sure
> get_task_comm() is being used on a char array, and now that
> __get_task_comm() will truncate & pad, it's safe to use on both
> too-small and too-big arrays.
>

It Makes sense to me.  I will do it as you suggested.

-- 
Thanks
Yafang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ