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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN8PR21MB1362B1921DF8ABF3A19B43A5F7880@BN8PR21MB1362.namprd21.prod.outlook.com>
Date:   Fri, 20 Sep 2019 21:46:15 +0000
From:   Steve MacLean <Steve.MacLean@...rosoft.com>
To:     Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
CC:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Changbin Du <changbin.du@...el.com>,
        Eric Saint-Etienne <eric.saint.etienne@...cle.com>,
        John Keeping <john@...anate.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Song Liu <songliubraving@...com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Leo Yan <leo.yan@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Brian Robbins <brianrob@...rosoft.com>,
        Tom McDonald <Thomas.McDonald@...rosoft.com>,
        John Salem <josalem@...rosoft.com>
Subject: RE: [PATCH] perf map: fix overlapped map handling

>>  			after->start = map->end;
>> +			after->pgoff = pos->map_ip(pos, map->end);
>
> So is this equivalent to what __split_vma() does in the kernel, i.e.:
>
>        if (new_below)
>                new->vm_end = addr;
>        else {
>                new->vm_start = addr;
>                new->vm_pgoff += ((addr - vma->vm_start) >> PAGE_SHIFT);
>        }
>
> where new->vm_pgoff starts equal to the vm_pgoff of the mmap being split?

It is roughly equivalent.  The pgoff in struct map is stored in bytes not in pages, so it doesn't include the shift.

An earlier version of this patch used:
  			after->start = map->end;
+			after->pgoff += map->end - pos->start;

Instead of the newer Functionally equivalent:
  			after->start = map->end;
+			after->pgoff = pos->map_ip(pos, map->end);

I preferred the latter form as it made more sense with the assertion that the mapping of map->end should match in pos and after.

Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ