From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com MIME-Version: 1.0 Sender: keescook@google.com In-Reply-To: <2236FBA76BA1254E88B949DDB74E612B41C380E4@IRSMSX102.ger.corp.intel.com> References: <1482994571-18687-1-git-send-email-elena.reshetova@intel.com> <1482994571-18687-9-git-send-email-elena.reshetova@intel.com> <20170105022535.GA20972@linaro.org> <2236FBA76BA1254E88B949DDB74E612B41C380E4@IRSMSX102.ger.corp.intel.com> From: Kees Cook Date: Thu, 5 Jan 2017 11:33:56 -0800 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [kernel-hardening] [RFC PATCH 08/19] kernel, mm: convert from atomic_t to refcount_t To: "Reshetova, Elena" Cc: AKASHI Takahiro , "kernel-hardening@lists.openwall.com" , "arnd@arndb.de" , "tglx@linutronix.de" , "mingo@redhat.com" , "Anvin, H Peter" , "peterz@infradead.org" , "will.deacon@arm.com" , "dwindsor@gmail.com" , "gregkh@linuxfoundation.org" , "ishkamiel@gmail.com" List-ID: On Thu, Jan 5, 2017 at 1:56 AM, Reshetova, Elena wrote: >> On Thu, Dec 29, 2016 at 08:56:00AM +0200, Elena Reshetova wrote: >> > refcount_t type and corresponding API should be >> > used instead of atomic_t when the variable is used as >> > a reference counter. Convert the cases found. >> > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c >> > index 7dd14e8..1d59aca 100644 >> > --- a/arch/arm/kernel/smp.c >> > +++ b/arch/arm/kernel/smp.c >> > @@ -371,7 +371,7 @@ asmlinkage void secondary_start_kernel(void) >> > * reference and switch to it. >> > */ >> > cpu = smp_processor_id(); >> > - atomic_inc(&mm->mm_count); >> > + refcount_inc(&mm->mm_count); >> > current->active_mm = mm; >> > cpumask_set_cpu(cpu, mm_cpumask(mm)); >> > >> >> If this is the case, arm64 has almost the same code. > > Thank you! I haven't tried to build on arm64 this yet (as well as on other arches). I am pretty sure there are more cases on other arches that are missed. > That's why I was hoping that we can run this series to the automatic build infra. > > @Kees, how did you do it before for previous patches? Who should be contacted to get a build-test on all arches? Normally the 0day builder should pick it up from the mailing list, but if it doesn't (and it may not due to the missing prerequisite patches), I can create a branch on kernel.org and it will pick it up there. Are you able to build a series that includes refcount_t implementation (so there is a single series that contains all the prerequisites), and base it on v4.10-rc2? That should give 0day no problems in doing a merge and test (since -next mutates every day...) -Kees -- Kees Cook Nexus Security