From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2130.oracle.com ([156.151.31.86]:60758 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729240AbfLEOgN (ORCPT ); Thu, 5 Dec 2019 09:36:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2019-08-05; bh=vEv/HeEVYet3XH/nginyF8cJah+61Gog+xzZ2SPUslE=; b=Nj8jzqDMK1ZNZT22b9MFmYmC6+I0Gnlji9yCYmIqoe3Ac2jxhKblU9EZnN6Jxu+p5qNm 4JIDyVkDVgJrIU3Li3wbpwvda2wjtf+4kQPY+ysZB6bVNe0vlDuSPtNfLiDKMYrS98AW peyheF41ZovksdyLXbPgIj4w+Gr6Y7jq06NjawE62T7DL0buzWrcuI801jV9YG81Co9I IPgEvwsZfJUx9iI+KEwvOH60BJUD+wXDlDpJeWZsm91ny6ZEdZ2oSCe5A3MoIBkwcNQd 60efLrM9h2yEkX+hPC+ATO01ou6rywIpLHFygDKeyBvicjJzLyr09e36s0zt6dTjT3d8 +g== Date: Thu, 5 Dec 2019 17:35:54 +0300 From: Dan Carpenter Subject: Re: [RFC PATCH 3/7] arm64: add check for comparison against tagged address Message-ID: <20191205143554.GQ1787@kadam> References: <20191007153545.23231-1-andrew.murray@arm.com> <20191007153545.23231-4-andrew.murray@arm.com> <20191007154923.GD42880@e119886-lin.cambridge.arm.com> <20191205132703.GO1787@kadam> <20191205142842.GP1787@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205142842.GP1787@kadam> Sender: smatch-owner@vger.kernel.org List-ID: To: Andrew Murray Cc: Catalin.Marinas@arm.com, smatch@vger.kernel.org On Thu, Dec 05, 2019 at 05:28:42PM +0300, Dan Carpenter wrote: > On Thu, Dec 05, 2019 at 04:27:03PM +0300, Dan Carpenter wrote: > > > We hardcode symbols of interest that we consider to be untagged addresses. This > > > provides good coverage but isn't very flexible. A better approach would be to > > > annotate the kernel with address space tags, such as is the case for __user, > > > __percpu, etc. Thus variables, struct members and function parameters could be > > > annotated to indicate that they contain untagged addresses. Unfortunately: > > > > > > - At present it's not possible to determine a struct member's address space > > > from Smatch > > > > I'm not sure how to get the address space for anything not just struct > > members. :( I will investigate. > > I was using the wrong attribute in my testing. In the kernel __user is > > #define __user __attribute__((noderef, address_space(1))) > My guess is that __untagged isn't something that Sparse knows about? Sparse has "noderef" as a keyword in the parse.c and has a handler for it. regards, dan carpenter