From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAF4CC43219 for ; Mon, 25 Oct 2021 21:06:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1CF26105A for ; Mon, 25 Oct 2021 21:06:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234726AbhJYVJT (ORCPT ); Mon, 25 Oct 2021 17:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233451AbhJYVJS (ORCPT ); Mon, 25 Oct 2021 17:09:18 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1890C061745 for ; Mon, 25 Oct 2021 14:06:55 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id k26so12144542pfi.5 for ; Mon, 25 Oct 2021 14:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DN8Qzavp4YLteRc4KGzGxUD9hgR92pZ9XvMCgYnpPXk=; b=PVZq0VU4Akx2eoH48kG0TggVvavZroMiBYxyORlDzHjXWOO8JjUnXrF2tNvxprzpI6 WwGhj7GbnibErKuoWZ502D9FKCgQEFbL6SJsITNVEy5dhgEp8fz8IrKjiuLe26sLYDs4 YaVEdfywBD4ajBqs5cChAoWL5RIImMs3nUVlQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DN8Qzavp4YLteRc4KGzGxUD9hgR92pZ9XvMCgYnpPXk=; b=kfQaamVzI7zkujZl5Cr4hRmvCOfkdmojR0mcjvYgZKu/L4HwxxVxOhE483NLsRiJx9 LT3Yu3BQSDDu8TCFPNLw5+pvs35ZnPg5XX1U4e9VZkXBvCBpQRoVgEOSGor3GQwHxFwF lW9eAYlexi6sVvwGjvt4TAf0jo9EFMPsoiKu8Je63u2m/AlHa4u809+ru5Uj4NkXwWvD yp0icU/byI+bMb7tQgTtYb2w5HtFVTT4uI4OvBoBrlAcydgGIMEvGRRyeRv5Zhbr12DE GGGw3Qu8W2ZAFsVCQKsavx/ZDkj+buJSxFC7XsLmf2mMcoVEMful5VxjyAGJHfGdJYLV /AnA== X-Gm-Message-State: AOAM532fKZ5veF/66jrMWLvVxoi29Ia0pmYOO8rgXYQ/+eU72GAgK9uK f0I865v98UZT89V0yLJCemaXRA== X-Google-Smtp-Source: ABdhPJz1kqpwzqWdalvJQu8pOHW5xoT2O4iMGIjFvG7XILr1AJgkXIvTdmEInVgO8gZ/Kp7GqyqE2w== X-Received: by 2002:a63:7c4f:: with SMTP id l15mr1289816pgn.273.1635196015236; Mon, 25 Oct 2021 14:06:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j126sm20471272pfd.113.2021.10.25.14.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 14:06:54 -0700 (PDT) Date: Mon, 25 Oct 2021 14:06:54 -0700 From: Kees Cook To: Steven Rostedt Cc: Alexei Starovoitov , Yafang Shao , Andrew Morton , Mathieu Desnoyers , Arnaldo Carvalho de Melo , Petr Mladek , Peter Zijlstra , Alexander Viro , Valentin Schneider , "Zhang, Qiang" , robdclark@chromium.org, Christian Brauner , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Vincent Guittot , "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , dennis.dalessandro@cornelisnetworks.com, mike.marciniszyn@cornelisnetworks.com, Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, Network Development , bpf , linux-perf-users@vger.kernel.org, Linux-Fsdevel , linux-mm , LKML , kernel test robot , kbuild test robot Subject: Re: [PATCH v6 00/12] extend task comm from 16 to 24 Message-ID: <202110251406.56F87A3522@keescook> References: <20211025083315.4752-1-laoar.shao@gmail.com> <20211025170503.59830a43@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211025170503.59830a43@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 25, 2021 at 05:05:03PM -0400, Steven Rostedt wrote: > On Mon, 25 Oct 2021 11:10:09 -0700 > Alexei Starovoitov wrote: > > > It looks like a churn that doesn't really address the problem. > > If we were to allow long names then make it into a pointer and use 16 byte > > as an optimized storage for short names. Any longer name would be a pointer. > > In other words make it similar to dentry->d_iname. > > That would be quite a bigger undertaking too, as it is assumed throughout > the kernel that the task->comm is TASK_COMM_LEN and is nul terminated. And > most locations that save the comm simply use a fixed size string of > TASK_COMM_LEN. Not saying its not feasible, but it would require a lot more > analysis of the impact by changing such a fundamental part of task struct > from a static to something requiring allocation. > > Unless you are suggesting that we truncate like normal the 16 byte names > (to a max of 15 characters), and add a way to hold the entire name for > those locations that understand it. Agreed -- this is a small change for what is already an "uncommon" corner case. I don't think this needs to suddenly become an unbounded string. :) -- Kees Cook