All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: pavel@ucw.cz
Cc: khalid.aziz@oracle.com, dave.hansen@linux.intel.com,
	corbet@lwn.net, bob.picco@oracle.com, steven.sistare@oracle.com,
	pasha.tatashin@oracle.com, mike.kravetz@oracle.com,
	mingo@kernel.org, nitin.m.gupta@oracle.com,
	kirill.shutemov@linux.intel.com, tom.hromatka@oracle.com,
	eric.saint.etienne@oracle.com, allen.pais@oracle.com,
	cmetcalf@mellanox.com, akpm@linux-foundation.org,
	geert@linux-m68k.org, tklauser@distanz.ch,
	atish.patra@oracle.com, vijay.ac.kumar@oracle.com,
	peterz@infradead.org, mhocko@suse.com, jack@suse.cz,
	lstoakes@gmail.com, hughd@google.com, thomas.tai@oracle.com,
	paul.gortmaker@windriver.com, ross.zwisler@linux.intel.com,
	dave.jiang@intel.com, willy@infradead.org, ying.huang@intel.com,
	zhongjiang@huawei.com, minchan@kernel.org,
	vegard.nossum@oracle.com, imbrenda@linux.vnet.ibm.com,
	aneesh.kumar@linux.vnet.ibm.com, aarcange@redhat.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	khalid@gonehiking.org
Subject: Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)
Date: Tue, 05 Sep 2017 14:44:56 -0700 (PDT)	[thread overview]
Message-ID: <20170905.144456.431070706382873486.davem@davemloft.net> (raw)
In-Reply-To: <20170904162530.GA21781@amd>

From: Pavel Machek <pavel@ucw.cz>
Date: Mon, 4 Sep 2017 18:25:30 +0200

> Will gcc be able to compile code that uses these automatically? That
> does not sound easy to me. Can libc automatically use this in malloc()
> to prevent accessing freed data when buffers are overrun?
> 
> Is this for benefit of JITs?

Anything that can control mappings and the virtual address used to
access memory can use ADI.

malloc() is of course one such case.  It can map memory with ADI
enabled, and return buffer addresses to malloc() callers with the
proper virtual address bits set to satisfy the ADI key checks.

And by induction anything using malloc() for it's memory allocation
gets ADI protection as well.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: pavel@ucw.cz
Cc: khalid.aziz@oracle.com, dave.hansen@linux.intel.com,
	corbet@lwn.net, bob.picco@oracle.com, steven.sistare@oracle.com,
	pasha.tatashin@oracle.com, mike.kravetz@oracle.com,
	mingo@kernel.org, nitin.m.gupta@oracle.com,
	kirill.shutemov@linux.intel.com, tom.hromatka@oracle.com,
	eric.saint.etienne@oracle.com, allen.pais@oracle.com,
	cmetcalf@mellanox.com, akpm@linux-foundation.org,
	geert@linux-m68k.org, tklauser@distanz.ch,
	atish.patra@oracle.com, vijay.ac.kumar@oracle.com,
	peterz@infradead.org, mhocko@suse.com, jack@suse.cz,
	lstoakes@gmail.com, hughd@google.com, thomas.tai@oracle.com,
	paul.gortmaker@windriver.com, ross.zwisler@linux.intel.com,
	dave.jiang@intel.com, willy@infradead.org, ying.huang@intel.com,
	zhongjiang@huawei.com, minchan@kernel.org,
	vegard.nossum@oracle.com, imbrenda@linux.vnet.ibm.com,
	aneesh.kumar@linux.vnet.ibm.com, aarcange@redhat.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	khalid@gonehiking.org
Subject: Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)
Date: Tue, 05 Sep 2017 21:44:56 +0000	[thread overview]
Message-ID: <20170905.144456.431070706382873486.davem@davemloft.net> (raw)
In-Reply-To: <20170904162530.GA21781@amd>

From: Pavel Machek <pavel@ucw.cz>
Date: Mon, 4 Sep 2017 18:25:30 +0200

> Will gcc be able to compile code that uses these automatically? That
> does not sound easy to me. Can libc automatically use this in malloc()
> to prevent accessing freed data when buffers are overrun?
> 
> Is this for benefit of JITs?

Anything that can control mappings and the virtual address used to
access memory can use ADI.

malloc() is of course one such case.  It can map memory with ADI
enabled, and return buffer addresses to malloc() callers with the
proper virtual address bits set to satisfy the ADI key checks.

And by induction anything using malloc() for it's memory allocation
gets ADI protection as well.

WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: pavel@ucw.cz
Cc: khalid.aziz@oracle.com, dave.hansen@linux.intel.com,
	corbet@lwn.net, bob.picco@oracle.com, steven.sistare@oracle.com,
	pasha.tatashin@oracle.com, mike.kravetz@oracle.com,
	mingo@kernel.org, nitin.m.gupta@oracle.com,
	kirill.shutemov@linux.intel.com, tom.hromatka@oracle.com,
	eric.saint.etienne@oracle.com, allen.pais@oracle.com,
	cmetcalf@mellanox.com, akpm@linux-foundation.org,
	geert@linux-m68k.org, tklauser@distanz.ch,
	atish.patra@oracle.com, vijay.ac.kumar@oracle.com,
	peterz@infradead.org, mhocko@suse.com, jack@suse.cz,
	lstoakes@gmail.com, hughd@google.com, thomas.tai@oracle.com,
	paul.gortmaker@windriver.com, ross.zwisler@linux.intel.com,
	dave.jiang@intel.com, willy@infradead.org, ying.huang@intel.com,
	zhongjiang@huawei.com, minchan@kernel.org,
	vegard.nossum@oracle.com, imbrenda@linux.vnet.ibm.com,
	aneesh.kumar@linux.vnet.ibm.com, aarcange@redhat.com,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-mm@kvack.org,
	khalid@gonehiking.org
Subject: Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)
Date: Tue, 05 Sep 2017 14:44:56 -0700 (PDT)	[thread overview]
Message-ID: <20170905.144456.431070706382873486.davem@davemloft.net> (raw)
In-Reply-To: <20170904162530.GA21781@amd>

From: Pavel Machek <pavel@ucw.cz>
Date: Mon, 4 Sep 2017 18:25:30 +0200

> Will gcc be able to compile code that uses these automatically? That
> does not sound easy to me. Can libc automatically use this in malloc()
> to prevent accessing freed data when buffers are overrun?
> 
> Is this for benefit of JITs?

Anything that can control mappings and the virtual address used to
access memory can use ADI.

malloc() is of course one such case.  It can map memory with ADI
enabled, and return buffer addresses to malloc() callers with the
proper virtual address bits set to satisfy the ADI key checks.

And by induction anything using malloc() for it's memory allocation
gets ADI protection as well.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-09-05 21:45 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09 21:25 [PATCH v7 0/9] Application Data Integrity feature introduced by SPARC M7 Khalid Aziz
2017-08-09 21:25 ` Khalid Aziz
2017-08-09 21:25 ` Khalid Aziz
2017-08-09 21:25 ` Khalid Aziz
2017-08-09 21:25 ` [PATCH v7 1/9] signals, sparc: Add signal codes for ADI violations Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-09 21:25 ` [PATCH v7 2/9] mm, swap: Add infrastructure for saving page metadata on swap Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-16  4:53   ` David Miller
2017-08-16  4:53     ` David Miller
2017-08-16  4:53     ` David Miller
2017-08-16 14:34     ` Khalid Aziz
2017-08-16 14:34       ` Khalid Aziz
2017-08-16 14:34       ` Khalid Aziz
2017-08-09 21:25 ` [PATCH v7 3/9] sparc64: Add support for ADI register fields, ASIs and traps Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-09 21:25 ` [PATCH v7 4/9] sparc64: Add HV fault type handlers for ADI related faults Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-09 21:25 ` [PATCH v7 5/9] sparc64: Add handler for "Memory Corruption Detected" trap Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-09 21:25 ` [PATCH v7 6/9] sparc64: Add auxiliary vectors to report platform ADI properties Khalid Aziz
2017-08-09 21:25   ` Khalid Aziz
2017-08-09 21:26 ` [PATCH v7 7/9] mm: Add address parameter to arch_validate_prot() Khalid Aziz
2017-08-09 21:26   ` Khalid Aziz
2017-08-09 21:26   ` Khalid Aziz
2017-08-10 13:20   ` Michael Ellerman
2017-08-10 13:20     ` Michael Ellerman
2017-08-10 13:20     ` Michael Ellerman
2017-08-10 14:41     ` Khalid Aziz
2017-08-10 14:41       ` Khalid Aziz
2017-08-10 14:41       ` Khalid Aziz
2017-08-15  5:02       ` Michael Ellerman
2017-08-15  5:02         ` Michael Ellerman
2017-08-15  5:02         ` Michael Ellerman
2017-08-15  5:02         ` Michael Ellerman
2017-08-15 14:32         ` Khalid Aziz
2017-08-15 14:32           ` Khalid Aziz
2017-08-15 14:32           ` Khalid Aziz
2017-08-09 21:26 ` [PATCH v7 8/9] mm: Clear arch specific VM flags on protection change Khalid Aziz
2017-08-09 21:26   ` Khalid Aziz
2017-08-09 21:26   ` Khalid Aziz
2017-08-09 21:26 ` [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity) Khalid Aziz
2017-08-09 21:26   ` Khalid Aziz
2017-08-09 21:26   ` Khalid Aziz
2017-08-16  4:58   ` David Miller
2017-08-16  4:58     ` David Miller
2017-08-16  4:58     ` David Miller
2017-08-16 14:44     ` Khalid Aziz
2017-08-16 14:44       ` Khalid Aziz
2017-08-16 14:44       ` Khalid Aziz
2017-08-25 22:31   ` Anthony Yznaga
2017-08-25 22:31     ` Anthony Yznaga
2017-08-25 22:31     ` Anthony Yznaga
2017-08-30 22:27     ` Khalid Aziz
2017-08-30 22:27       ` Khalid Aziz
2017-08-30 22:27       ` Khalid Aziz
2017-08-30 22:38       ` David Miller
2017-08-30 22:38         ` David Miller
2017-08-30 22:38         ` David Miller
2017-08-30 23:23         ` Khalid Aziz
2017-08-30 23:23           ` Khalid Aziz
2017-08-30 23:23           ` Khalid Aziz
2017-08-31  0:09           ` David Miller
2017-08-31  0:09             ` David Miller
2017-08-31  0:09             ` David Miller
2017-08-31 16:38             ` Khalid Aziz
2017-08-31 16:38               ` Khalid Aziz
2017-08-31 16:38               ` Khalid Aziz
2017-09-01  5:38       ` Anthony Yznaga
2017-09-01  5:38         ` Anthony Yznaga
2017-09-01  5:38         ` Anthony Yznaga
2017-09-04 16:25   ` Pavel Machek
2017-09-04 16:25     ` Pavel Machek
2017-09-04 16:25     ` Pavel Machek
2017-09-05 21:44     ` David Miller [this message]
2017-09-05 21:44       ` David Miller
2017-09-05 21:44       ` David Miller
2017-09-06 22:32       ` Pavel Machek
2017-09-06 22:32         ` Pavel Machek
2017-09-08 12:18         ` Steven Sistare
2017-09-08 12:18           ` Steven Sistare
2017-09-08 12:18           ` Steven Sistare
2017-09-06 14:10     ` Khalid Aziz
2017-09-06 14:10       ` Khalid Aziz
2017-09-06 14:10       ` Khalid Aziz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170905.144456.431070706382873486.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=allen.pais@oracle.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=atish.patra@oracle.com \
    --cc=bob.picco@oracle.com \
    --cc=cmetcalf@mellanox.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=eric.saint.etienne@oracle.com \
    --cc=geert@linux-m68k.org \
    --cc=hughd@google.com \
    --cc=imbrenda@linux.vnet.ibm.com \
    --cc=jack@suse.cz \
    --cc=khalid.aziz@oracle.com \
    --cc=khalid@gonehiking.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=mhocko@suse.com \
    --cc=mike.kravetz@oracle.com \
    --cc=minchan@kernel.org \
    --cc=mingo@kernel.org \
    --cc=nitin.m.gupta@oracle.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=pavel@ucw.cz \
    --cc=peterz@infradead.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=sparclinux@vger.kernel.org \
    --cc=steven.sistare@oracle.com \
    --cc=thomas.tai@oracle.com \
    --cc=tklauser@distanz.ch \
    --cc=tom.hromatka@oracle.com \
    --cc=vegard.nossum@oracle.com \
    --cc=vijay.ac.kumar@oracle.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=zhongjiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.