mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@c-s.fr>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK
Date: Sat, 06 Oct 2018 22:21:30 +1000	[thread overview]
Message-ID: <871s93jmet.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <cover.1538541946.git.christophe.leroy@c-s.fr>

Christophe Leroy <christophe.leroy@c-s.fr> writes:

> The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which
> moves the thread_info into task_struct.
>
> Moving thread_info into task_struct has the following advantages:
> - It protects thread_info from corruption in the case of stack
> overflows.
> - Its address is harder to determine if stack addresses are
> leaked, making a number of attacks more difficult.

We need to fixup bpf_jit32.h:

#ifdef CONFIG_SMP
#ifdef CONFIG_PPC64
#define PPC_BPF_LOAD_CPU(r)		\
	do { BUILD_BUG_ON(FIELD_SIZEOF(struct paca_struct, paca_index) != 2);	\
		PPC_LHZ_OFFS(r, 13, offsetof(struct paca_struct, paca_index));	\
	} while (0)
#else
#define PPC_BPF_LOAD_CPU(r)     \
	do { BUILD_BUG_ON(FIELD_SIZEOF(struct thread_info, cpu) != 4);		\
		PPC_LHZ_OFFS(r, (1 & ~(THREAD_SIZE - 1)),			\
				offsetof(struct thread_info, cpu));		\
	} while(0)
#endif
#else
#define PPC_BPF_LOAD_CPU(r) do { PPC_LI(r, 0); } while(0)
#endif


cheers

      parent reply	other threads:[~2018-10-06 12:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 15:43 Christophe Leroy
2018-10-04 15:43 ` [PATCH v4 1/9] book3s/64: avoid circular header inclusion in mmu-hash.h Christophe Leroy
2018-10-04 15:43 ` [PATCH v4 2/9] powerpc: Only use task_struct 'cpu' field on SMP Christophe Leroy
2018-10-04 15:43 ` [PATCH v4 3/9] powerpc: Prepare for moving thread_info into task_struct Christophe Leroy
2018-10-04 15:43 ` [PATCH v4 4/9] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK Christophe Leroy
2018-10-04 15:43 ` [PATCH v4 5/9] powerpc: regain entire stack space Christophe Leroy
2018-10-04 15:44 ` [PATCH v4 6/9] powerpc: 'current_set' is now a table of task_struct pointers Christophe Leroy
2018-10-04 15:44 ` [PATCH v4 7/9] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU Christophe Leroy
2018-10-04 15:44 ` [PATCH v4 8/9] powerpc/64: Remove CURRENT_THREAD_INFO Christophe Leroy
2018-10-04 15:44 ` [PATCH v4 9/9] powerpc: clean stack pointers naming Christophe Leroy
2018-10-06 12:21 ` Michael Ellerman [this message]

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=871s93jmet.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=benh@kernel.crashing.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®