lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2263204.ElGaqSPkdT@suse>
Date:   Thu, 08 Dec 2022 00:03:29 +0100
From:   "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     Jonathan Corbet <corbet@....net>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Ira Weiny <ira.weiny@...el.com>,
        Mike Rapoport <rppt@...nel.org>, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] mm/highmem: Add notes about conversions from kmap{,_atomic}()

On mercoledì 7 dicembre 2022 14:51:00 CET Sebastian Andrzej Siewior wrote:
> On 2022-12-07 14:01:50 [+0100], Fabio M. De Francesco wrote:
> > > > If so, I understand and I again agree with you. If not, I'm missing
> > > > something; so please let me understand properly.
> > > > 
> > > > Aside from the above, I'm not sure whether you deleted the last phrase
> > > > before
> > > > your suggestion. What about making it to become "For the above-
mentioned
> > > > cases, conversions should also explicitly disable page-faults and/or
> > > > preemption"?
> > > 
> > > They need to disable preemption or page-faults or both if it is needed
> > > (not unconditionally) and where it is needed. This means not
> > > unconditionally over the whole kmap-ed section.
> > 
> > I never meant to suggest to _unconditionally_ disable page-faults
> > and/or preemption. I was only trying to say that developers must carefully
> > check whether or not the whole kmap-ed section depended on those side
> > effects.
> I know. That are the two condition that should be checked/ kept in mind
> while replacing the code. Maybe I read it wrongly…
> 
> > If so, they must _explicitly_ disable preemption or page-faults or both
> > together with the use of kmap_local_page().
> 
> Right. The requirement for it should be probably documented in case it
> is not obvious. For PREEMPT_RT it will become a problem if the preempt
> disabled section additionally acquired a spinlock_t or allocated memory.
> So ideally it won't be used ;)
> 
> >                                             Instead, if the section 
doesn't
> > 
> > depend on preemption and/or page-faults disabling, they must only replace
> > kmap_atomic() with kmap_local_page().
> 
> Correct and I assumed that you know all this.
> 
> > I had probably used a bad wording when trying to say the same things that
> > you
> > wrote much more clearly.
> 
> Write it as you wish I just made a recommendation. If the wording is
> crystal clear then there is less room for interpretations.

I just sent v2 of this patch.[1] I hope that now I left less room for 
potential misinterpretation by merging your suggestion with the old text.

Again thanks for helping,

Fabio

[1] https://lore.kernel.org/lkml/20221207225308.8290-1-fmdefrancesco@gmail.com/T/



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ