Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5416276imm; Sun, 26 Aug 2018 19:36:51 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZKGGTIcPEToQuFEGtGcr3J21HrfjKfyLxw2ISK8bttSAeS7eHkymY0s6rq982/IClqLpr7 X-Received: by 2002:a63:f751:: with SMTP id f17-v6mr10488970pgk.410.1535337411536; Sun, 26 Aug 2018 19:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535337411; cv=none; d=google.com; s=arc-20160816; b=qochPxcOGMdizNzlUrkP6Ju5u8tYNp6AhYWz3NDFkN5wtFcbEZQYzCX0oqplpEAN1A pXD6HaycC0At8k+my299u9IfGWt0+5Y33fqZWXWxMW4SJ+CsKQEladdWqy21uM/BGIfY +4bIpcEhGRmNw2SWVGAEFAz221HfLU8VFZL6+Xh+t10MklQ0E5smg7qQE8sW/wl7mJON Psj0DVhQgf7nrLjF3SqfZXfXhNAPC4b449MOdJqF0B9TjKdLVZuT48EAbqFLfODiyOv6 mvA/Wg2jG7dZ3+VzOQPqrDv56iDs/rnRQ+AO3qo7ph0QpZWi6E2/D04lGkTDy+XjL/9j hnSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=wWmSeVZdiouBWMn1Q39DIzJ4Cf/aLdU/S5WCyv+V8sg=; b=wYvjve4PyH4LPAptutnABZ2bjDN60ryNWzpQehgTP6vxBsDYHyQh5ImOXyHp4hdksl p6gyKnVwINhUDYWsuoiAJyRNts2YndsKvHpFdmbHibdg7oKUhlpWrhXHIDquhEqkS9w9 6W1fLG7sPGB3M0lWyLPDlpJNSoJzi46/LoLZOiQJ3+bK5HjGLtY1LSMdIS1M0rxHonVr s0/g7UXa3LYRyD9edGuoBV7GGrEVQlee6giJDWI012nqEaf68qtI00vcqyyqXF3GyIZp iMPRXsmrJdctQoYte7QZbIggFf4QBbsoGzsHTsrl0r3xV8HuUMiOC/OscHPsI7rfV1Xc hBlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11-v6si9445350pgg.303.2018.08.26.19.36.36; Sun, 26 Aug 2018 19:36:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbeH0GUG (ORCPT + 99 others); Mon, 27 Aug 2018 02:20:06 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:43212 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726822AbeH0GUG (ORCPT ); Mon, 27 Aug 2018 02:20:06 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1fu7NG-0001S8-Pe; Mon, 27 Aug 2018 02:35:26 +0000 Date: Mon, 27 Aug 2018 03:35:26 +0100 From: Al Viro To: Julia Lawall Cc: Joe Perches , Kees Cook , LKML , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Network Development Subject: Re: [PATCH] net: sched: Fix memory exposure from short TCA_U32_SEL Message-ID: <20180827023526.GA6515@ZenIV.linux.org.uk> References: <20180826055801.GA42063@beast> <20180826061534.GT6515@ZenIV.linux.org.uk> <20180826173236.GU6515@ZenIV.linux.org.uk> <20180826212421.GW6515@ZenIV.linux.org.uk> <20180826224322.GX6515@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 26, 2018 at 10:00:46PM -0400, Julia Lawall wrote: > > > On Sun, 26 Aug 2018, Al Viro wrote: > > > On Sun, Aug 26, 2018 at 03:26:54PM -0700, Joe Perches wrote: > > > On Sun, 2018-08-26 at 22:24 +0100, Al Viro wrote: > > > > On Sun, Aug 26, 2018 at 11:57:57AM -0700, Joe Perches wrote: > > > > > > > > > > That, BTW, is why I hate the use of sizeof(*p) in kmalloc, etc. > > > > > > arguments. typeof is even worse in that respect. > > > > > > > > > > True. Semantic searches via tools like coccinelle could help here > > > > > but those searches are quite a bit slower than straightforward greps. > > > > > > > > Those searches are .config-sensitive as well, which can be much more > > > > unpleasant than being slow... > > > > > > Are they? Julia? > > > > They work pretty much on preprocessor output level; if something it ifdef'ed > > out on given config, it won't be seen... > > Coccinelle doesn't care what is ifdef'd out. It only misses the things it > can't parse. Very strange ifdefs could indeed cause that, but it should > be a minor problem. OK, but... what does it do when it sees two definitions of a structure in different branches of #if/#else/#endif? I think I'm confused about what it can and cannot do; to restate the original problem: * we need to find all places where instances of given type are created. Assume it never is a member of struct/union/array and no static or auto duration instances exist - everything is dynamically allocated somewhere. Can coccinelle do that and if it can, what are the limitations?