Re: [RFC PATCH 3/7] arm64: add check for comparison against tagged address

Dan Carpenter <[email protected]>
Newsgroups org.kernel.vger.smatch
Message-ID <20191205143554.GQ1787@kadam>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.