Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp576524pxb; Mon, 25 Oct 2021 14:08:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSlbykzx44j9kAMS8w9+t6FiPYPiY4oNagB3i/wMzrsnK5aCZky9sbqnXlDPR6Co2EYtwx X-Received: by 2002:a17:90b:180e:: with SMTP id lw14mr15012491pjb.138.1635196102267; Mon, 25 Oct 2021 14:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635196102; cv=none; d=google.com; s=arc-20160816; b=wjHpOOBFA515WKEW627s9O1BWMmjUCnWy6RdtNW/Fxdlp5bckslO0WbnJ8pj0RYyQK GWsY6WZLgQgRZz0gqvCaEFPzmFWuqWecjWGn0PpDYNFH2ESNSEupCQQR5wvRLykE9sT3 XHuXD39txogJcLxMn6S0OyLdVL7fLuVbnjaq7J7UpnGEfOlJhkL2iikz8n8KDzcQeVJB mrG4cJGT61m0wKmetQ3yWRzPX+4y6No/dS0C8a5n4EtFGLnwlfRPiiZKQltJpod381QB k4RW2YXDtyJBP8qGEV6Uq78tec72VoSeaHl5WcePtBVpCqJoZDWsqPtXG009ClCBZU9s 9SwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DN8Qzavp4YLteRc4KGzGxUD9hgR92pZ9XvMCgYnpPXk=; b=0++Bb50akM/SRTI5+a5Izcd/BsqB2gh8Rkf0jUTRt6ohpEpz+9KUu8VgLrOS6EnP5L fDJyvS1pjqQNj/h7AK60Bvp8YhmIA+aCEUInyKim6+wILzxK7jWkPs3ONEI4giJ1//Rv wm4YwpJDdx+WexwryHYOabq0nIR+ENTvWPJMeylbjOE/vA8aGuZapmzlHHkS1YoJEfwN WanThzstCwbhT6Astm6t1Mqc01f7jeXkLU0S26SNIYiOyxAE8aZ7oYZt+Sl55L30U4Qj PykUkdojEfUy4/riUKTHuvCVtSWDgVyaYvS5LsqUPfXbBJ/IgUTtYNG6zQmip14RMbSx g+5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PVZq0VU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si30153554pfe.229.2021.10.25.14.08.04; Mon, 25 Oct 2021 14:08:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PVZq0VU4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234676AbhJYVJT (ORCPT + 99 others); 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-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