Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1710298pxb; Fri, 26 Feb 2021 20:06:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuN3h3UsQ9sgTOLPOj/cCVzN4XOqihKRM5b9atW2iNgBZ9upFLfzp5beiZsvX33tSDjw6y X-Received: by 2002:a05:6402:3d8:: with SMTP id t24mr6636813edw.298.1614398759852; Fri, 26 Feb 2021 20:05:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614398759; cv=none; d=google.com; s=arc-20160816; b=N/KQO0FFeP0EfKPXGnw0Hkf9pxig8+tkvPqvV/8ItLxzr6cw4qEfMOKT+uZxz2jOX3 UWny3vMWiQR+e+1I6BRViCan2r4cV7egfUCk+lSJzZUJOSXTxnVfY3TAbeSMVIoThrrD trGMCa5faNCqmN7XYXKvPrspGw79FPcZKe6seFmls47ZkiMI35UEdfjiLiQ5dcFyY4qz iKn8TQae2UaCClv2NMxbAAc9+4rRvCR8h/T5KVKoOMURCokuOsK162qKoxCcdHd5/5+K 1MexFFl1d/bGCYOWR991RuA3JSlBSPn+1MOWngqyzBpUGqfdmMFHTb9A6MBK7uTy7wdm s/Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=XFIKR918Im5imz/n29U7DUYGPQ5VJiZt9FZF7pMPiik=; b=K47J2nNwBr/ASfRPyOwAPefeiNkcGgOPYeuL4zAoo2P+kcKaluGhleTxgA1xC847U8 +kjzgXF5VOC2+tySm5lyu7AhhneOjc4jllSJiDo+/ui4I3jp21g321Fe+McZnpvHWJw9 1h6MS3MwP4jkPS/9NOoiQyvafduy0T+ZmNOgJzyQLpgVs3Mj7IbumLFF6whSXtdZJivo Fg9TuagO/TKXC18iFX6AQDFtRNwnZtKTG5wPxmra1m/9LuMV5j9dXb+KXxpdTG6yGMdp ROwRwgXP33Nv1qbtXlV+fIC4NLg9qOI81W6wXYJtJnKChR4Vonc3KVbUbiqZOcwq1XXw PQjA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b17si7573349edn.294.2021.02.26.20.05.37; Fri, 26 Feb 2021 20:05:59 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbhB0EFM (ORCPT + 99 others); Fri, 26 Feb 2021 23:05:12 -0500 Received: from smtprelay0108.hostedemail.com ([216.40.44.108]:41588 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229863AbhB0EFL (ORCPT ); Fri, 26 Feb 2021 23:05:11 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 7C9841802DE0C; Sat, 27 Feb 2021 04:04:30 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:800:960:968:973:988:989:1260:1261:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2828:2897:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:6119:7652:7875:7903:10004:10400:10450:10455:10848:10967:11026:11232:11658:11914:12043:12297:12438:12740:12760:12895:13069:13255:13311:13357:13439:14096:14097:14181:14659:14721:19904:19999:21067:21080:21611:21627:30054:30060:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: hook24_39184a92769f X-Filterd-Recvd-Size: 2274 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Sat, 27 Feb 2021 04:04:29 +0000 (UTC) Message-ID: <0cb9c9b8ce069a92df8b974d520606a494614892.camel@perches.com> Subject: Re: [PATCH 0/2] tracing: Detect unsafe dereferencing of pointers from trace events From: Joe Perches To: Steven Rostedt , Linus Torvalds Cc: Linux Kernel Mailing List , Ingo Molnar , Andrew Morton , Masami Hiramatsu , Jacob Wen Date: Fri, 26 Feb 2021 20:04:28 -0800 In-Reply-To: <20210226183309.0edcc54d@gandalf.local.home> References: <20210226185909.100032746@goodmis.org> <20210226183309.0edcc54d@gandalf.local.home> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-02-26 at 18:33 -0500, Steven Rostedt wrote: > On Fri, 26 Feb 2021 14:21:00 -0800 > Linus Torvalds wrote: > > > > The second patch handles strings "%s" [..] > > > > Doing this at runtime really feels like the wrong thing to do. > > > > It won't even protect us from what happened - people like me and > > Andrew won't even run those tracepoints in the first place, so we > > won't notice. > > > > It really would be much better in every respect to have this done by > > checkpatch, I think. > > They are not mutually exclusive. We could have both. One thing that's nice > about this patch is that it removes the possibility of a real bug. That is, > it will catch the dereferencing of a string that is not valid, WARN about > it, but it wont try to dereference it (outside of the > strcpy_from_kernel_nofault()). And hopefully the warning and lack of data > they want, will have this get caught during development. > > Also, there's cases that %s is allowed to reference data that I don't know > if checkpatch would be able to differentiate. It's not obvious to me how to do that.