Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-09-08 Thread Steven Sistare
On 9/6/2017 6:32 PM, Pavel Machek wrote: > On Tue 2017-09-05 14:44:56, David Miller wrote: >> From: Pavel Machek >> 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

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-09-06 Thread Pavel Machek
On Tue 2017-09-05 14:44:56, David Miller wrote: > From: Pavel Machek > 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

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-09-06 Thread Khalid Aziz
On 09/04/2017 10:25 AM, Pavel Machek wrote: Hi! ADI is a new feature supported on SPARC M7 and newer processors to allow hardware to catch rogue accesses to memory. ADI is supported for data fetches only and not instruction fetches. An app can enable ADI on its data pages, set version tags on

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-09-05 Thread David Miller
From: Pavel Machek 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

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-31 Thread Anthony Yznaga
Hi Khalid, > On Aug 30, 2017, at 3:27 PM, Khalid Aziz wrote: > > Hi Anthony, > > Thanks for taking the time to provide feedback. My comments inline below. > > On 08/25/2017 04:31 PM, Anthony Yznaga wrote: >>> On Aug 9, 2017, at 2:26 PM, Khalid Aziz

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-31 Thread Khalid Aziz
On 08/30/2017 06:09 PM, David Miller wrote: From: Khalid Aziz Date: Wed, 30 Aug 2017 17:23:37 -0600 That is an interesting idea. This would enable TSTATE_MCDE on all threads of a process as soon as one thread enables it. If we consider the case where the parent creates

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-30 Thread David Miller
From: Khalid Aziz Date: Wed, 30 Aug 2017 17:23:37 -0600 > That is an interesting idea. This would enable TSTATE_MCDE on all > threads of a process as soon as one thread enables it. If we consider > the case where the parent creates a shared memory area and spawns a >

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-30 Thread Khalid Aziz
On 08/30/2017 04:38 PM, David Miller wrote: From: Khalid Aziz Date: Wed, 30 Aug 2017 16:27:54 -0600 +#define arch_calc_vm_prot_bits(prot, pkey) sparc_calc_vm_prot_bits(prot) +static inline unsigned long sparc_calc_vm_prot_bits(unsigned long prot) +{ + if (prot &

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-30 Thread David Miller
From: Khalid Aziz Date: Wed, 30 Aug 2017 16:27:54 -0600 >>> +#define arch_calc_vm_prot_bits(prot, pkey) >>> sparc_calc_vm_prot_bits(prot) >>> +static inline unsigned long sparc_calc_vm_prot_bits(unsigned long >>> prot) >>> +{ >>> + if (prot & PROT_ADI) { >>> +

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-16 Thread Khalid Aziz
On 08/15/2017 10:58 PM, David Miller wrote: From: Khalid Aziz Date: Wed, 9 Aug 2017 15:26:02 -0600 +void adi_restore_tags(struct mm_struct *mm, struct vm_area_struct *vma, + unsigned long addr, pte_t pte) +{ ... + tag = tag_start(addr,

Re: [PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-15 Thread David Miller
From: Khalid Aziz Date: Wed, 9 Aug 2017 15:26:02 -0600 > +void adi_restore_tags(struct mm_struct *mm, struct vm_area_struct *vma, > + unsigned long addr, pte_t pte) > +{ ... > + tag = tag_start(addr, tag_desc); > + paddr = pte_val(pte) &

[PATCH v7 9/9] sparc64: Add support for ADI (Application Data Integrity)

2017-08-09 Thread Khalid Aziz
ADI is a new feature supported on SPARC M7 and newer processors to allow hardware to catch rogue accesses to memory. ADI is supported for data fetches only and not instruction fetches. An app can enable ADI on its data pages, set version tags on them and use versioned addresses to access the data