Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1260246 > unrolled thread
| Started by | ebiederm@xmission.com (Eric W. Biederman) |
|---|---|
| First post | 2015-11-01 23:00 +0100 |
| Last post | 2015-11-03 19:30 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 1/2] mm: mmap: Add new /proc tunable for mmap_base ASLR. ebiederm@xmission.com (Eric W. Biederman) - 2015-11-01 23:00 +0100
Re: [PATCH 1/2] mm: mmap: Add new /proc tunable for mmap_base ASLR. Daniel Cashman <dcashman@android.com> - 2015-11-03 19:30 +0100
| From | ebiederm@xmission.com (Eric W. Biederman) |
|---|---|
| Date | 2015-11-01 23:00 +0100 |
| Subject | Re: [PATCH 1/2] mm: mmap: Add new /proc tunable for mmap_base ASLR. |
| Message-ID | <qq8Pn-5dJ-7@gated-at.bofh.it> |
Daniel Cashman <dcashman@android.com> writes:
> On 10/28/2015 08:41 PM, Eric W. Biederman wrote:
>> Dan Cashman <dcashman@android.com> writes:
>>
>>>>> This all would be much cleaner if the arm architecture code were just to
>>>>> register the sysctl itself.
>>>>>
>>>>> As it sits this looks like a patchset that does not meaninfully bisect,
>>>>> and would result in code that is hard to trace and understand.
>>>>
>>>> I believe the intent is to follow up with more architecture specific
>>>> patches to allow each architecture to define the number of bits to use
>>>
>>> Yes. I included these patches together because they provide mutual
>>> context, but each has a different outcome and they could be taken
>>> separately.
>>
>> They can not. The first patch is incomplete by itself.
>
> Could you be more specific in what makes the first patch incomplete? Is
> it because it is essentially a no-op without additional architecture
> changes (e.g. the second patch) or is it specifically because it
> introduces and uses the three "mmap_rnd_bits*" variables without
> defining them? If the former, I'd like to avoid combining the general
> procfs change with any architecture-specific one(s). If the latter, I
> hope the proposal below addresses that.
A bit of both. The fact that the code can not compile in the first
patch because of missing variables is distressing. Having the arch
specific code as a separate patch is fine, but they need to remain in
the same patchset.
>>> The arm architecture-specific portion allows the changing
>>> of the number of bits used for mmap ASLR, useful even without the
>>> sysctl. The sysctl patch (patch 1) provides another way of setting
>>> this value, and the hope is that this will be adopted across multiple
>>> architectures, with the arm changes (patch 2) providing an example. I
>>> hope to follow this with changes to arm64 and x86, for example.
>>
>> If you want to make the code generic. Please maximize the sharing.
>> That is please define the variables in a generic location, as well
>> as the Kconfig variables (if possible).
>>
>> As it is you have an architecture specific piece of code that can not be
>> reused without duplicating code, and that is just begging for problems.
>
> I think it would make sense to move the variable definitions into
> mm/mmap.c, included conditionally based on the presence of
> CONFIG_ARCH_MMAP_RND_BITS.
>
> As for the Kconfigs, I am open to suggestions. I considered declaring
> and documenting ARCH_MMAP_RND_BITS in arch/Kconfig, but I would like it
> to be bounded in range by the _MIN and _MAX values, which necessarily
> must be defined in the arch-specific Kconfigs. Thus, we'd have
> ARCH_MMAP_RND_BITS declared in arch/Kconfig as it currently is in
> arch/arm/Kconfig defaulting to _MIN, and would declare both the _MIN and
> _MAX in arch/Kconfig, while specifying default values in
> arch/${ARCH}/Kconfig.
>
> Would these changes be more acceptable?
Yes. I don't think you can do much about the Kconfigs so I would not
worry about that too much.
Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Daniel Cashman <dcashman@android.com> |
|---|---|
| Date | 2015-11-03 19:30 +0100 |
| Message-ID | <qqOvg-6ox-21@gated-at.bofh.it> |
| In reply to | #1260246 |
On 11/01/2015 01:50 PM, Eric W. Biederman wrote: > Daniel Cashman <dcashman@android.com> writes: > >> On 10/28/2015 08:41 PM, Eric W. Biederman wrote: >>> Dan Cashman <dcashman@android.com> writes: >>> >>>>>> This all would be much cleaner if the arm architecture code were just to >>>>>> register the sysctl itself. >>>>>> >>>>>> As it sits this looks like a patchset that does not meaninfully bisect, >>>>>> and would result in code that is hard to trace and understand. >>>>> >>>>> I believe the intent is to follow up with more architecture specific >>>>> patches to allow each architecture to define the number of bits to use >>>> >>>> Yes. I included these patches together because they provide mutual >>>> context, but each has a different outcome and they could be taken >>>> separately. >>> >>> They can not. The first patch is incomplete by itself. >> >> Could you be more specific in what makes the first patch incomplete? Is >> it because it is essentially a no-op without additional architecture >> changes (e.g. the second patch) or is it specifically because it >> introduces and uses the three "mmap_rnd_bits*" variables without >> defining them? If the former, I'd like to avoid combining the general >> procfs change with any architecture-specific one(s). If the latter, I >> hope the proposal below addresses that. > > A bit of both. The fact that the code can not compile in the first > patch because of missing variables is distressing. Having the arch > specific code as a separate patch is fine, but they need to remain in > the same patchset. > The first patch would compile as long as CONFIG_ARCH_MMAP_RND_BITS were not defined without also defining the missing variables. I actually viewed this as a safeguard against attempting to use those variables without architecture support, but am ok with changing it. I've gone ahead and submitted [PATCH v2] which aims to reduce duplication in the arch-specific config files and concerning those variables. The only caveat is that now the second patch depends on the first, whereas before it did not. Thank You, Dan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web