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: <CAPhsuW4KBYvE8oPz+4tF0_7zFoLhO-86Dh1LfZTiW1t59ty24g@mail.gmail.com>
Date:   Thu, 8 Jun 2023 14:13:00 -0700
From:   Song Liu <song@...nel.org>
To:     Puranjay Mohan <puranjay12@...il.com>
Cc:     ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
        martin.lau@...ux.dev, catalin.marinas@....com,
        mark.rutland@....com, bpf@...r.kernel.org, kpsingh@...nel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v2 3/3] bpf, arm64: use bpf_jit_binary_pack_alloc

On Thu, Jun 8, 2023 at 9:51 AM Puranjay Mohan <puranjay12@...il.com> wrote:
>
> Hi Song,
>
> On Thu, Jun 8, 2023 at 6:28 PM Song Liu <song@...nel.org> wrote:
> >
> > On Wed, Jun 7, 2023 at 2:18 AM Puranjay Mohan <puranjay12@...il.com> wrote:
> > >
> > [...]
> > > +
> > >  static inline int epilogue_offset(const struct jit_ctx *ctx)
> > >  {
> > >         int to = ctx->epilogue_offset;
> > > @@ -701,7 +716,8 @@ static int add_exception_handler(const struct bpf_insn *insn,
> > >                                  struct jit_ctx *ctx,
> > >                                  int dst_reg)
> > >  {
> > > -       off_t offset;
> > > +       off_t ins_offset;
> > > +       off_t fixup_offset;
> >
> > Please add some comments for these two offsets.
>
> Here I am using two variables because I need to change from the RO
> buffer for calculating offsets
> to the RW buffer for writing.
>
> Earlier, a single variable could work because it was being reused for
> calculating the second offset
> after writing the first one. Here, I can't re-calculate using the same
> variable because I have to change
> to the RW buffer, and using the same variable would need changing back
> to the RO buffer.
>
> So, I am calculating both offsets first, changing to RW buffer and
> writing both offsets.
>
> But I will add comments explaining what these offsets are being used for.

Thanks for the explanation! These comments will be useful for future work.

Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ