All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Li Wang <liwang@redhat.com>
Cc: Paulson Raja L <paulson@zilogic.com>, ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] mmap20: Fix invalid address
Date: Thu, 6 Apr 2023 13:13:01 +0200	[thread overview]
Message-ID: <20230406111301.GC1545779@pevik> (raw)
In-Reply-To: <CAEemH2db7gN9GduVYwfeLM1Px9rp_WTV6uXm1O+urVLXWrMbfA@mail.gmail.com>

Hi all,

> On Thu, Apr 6, 2023 at 5:49 PM Petr Vorel <pvorel@suse.cz> wrote:

> > Hi all,

> > > Hi Petr,

> > > (1<<9) is also used by another flag on alpha, but it said not
> > > linux-specific,
> > > so I guess it won't be a problem (at least for now).
> > >   alpha/include/uapi/asm/mman.h:#define _MAP_HASSEMAPHORE 0x0200

> > Good point! I checked only glibc/musl headers, obviously checking kernel
> > sources
> > is better as it contains old archs. It affects alpha, ia64 and sparc
> > (well, they might not even compile current LTP, we were dropping ia64 fixes
> > anyway).


> Okay, I only noticed that alpha is not defined 0x0200 for Linux
> specifically.

> > $ git grep -w 0x0200 arch/*/include/uapi/asm/mman.h
> > arch/alpha/include/uapi/asm/mman.h:#define _MAP_HASSEMAPHORE 0x0200
> > arch/ia64/include/uapi/asm/mman.h:#define MAP_GROWSUP   0x0200          /*
> > register stack-like segment */
> > arch/sparc/include/uapi/asm/mman.h:#define MAP_GROWSDOWN        0x0200
> >       /* stack-like segment */

> > But as 0x400 (1 << 10) is not used anywhere, I merged it with this value.



> Hmm, I didn't understand here why merged with 0x0400,
> aren't there still duplicated flags?

> $ git grep -w 0x0400 arch/*/include/uapi/asm/mman.h
> arch/alpha/include/uapi/asm/mman.h:#define _MAP_INHERIT 0x0400
> arch/mips/include/uapi/asm/mman.h:#define MAP_NORESERVE 0x0400          /*
> don't check for reservations */
> arch/xtensa/include/uapi/asm/mman.h:#define MAP_NORESERVE       0x0400
>      /* don't check for reservations */

I'm sorry I now don't know what I greped, because there are results for 0x0400 :(.
Obviously last minute change without ack is a bad practise.

You're right, linux specific 0x0400 is in mips and xtensa (it's non-linux
specific on alpha). OTOH ia64 and sparc define:

arch/ia64/include/uapi/asm/mman.h
#define MAP_GROWSUP	0x0200		/* register stack-like segment */

arch/sparc/include/uapi/asm/mman.h
#define MAP_GROWSDOWN	0x0200		/* stack-like segment */

Are these used as flags? If yes none of the values is optimal as it breaks some
arch. If you agree, I'd keep 0x0400 and follow Jan's suggestion (don't map a
file, and then add MAP_SYNC to flags).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2023-04-06 11:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 11:28 [LTP] [PATCH 1/1] mmap20: Fix invalid address Petr Vorel
2023-04-05  8:09 ` Jan Stancek
2023-04-06  2:59 ` Li Wang
2023-04-06  9:48   ` Petr Vorel
2023-04-06 10:29     ` Li Wang
2023-04-06 11:13       ` Petr Vorel [this message]
2023-04-06 12:37         ` Li Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230406111301.GC1545779@pevik \
    --to=pvorel@suse.cz \
    --cc=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    --cc=paulson@zilogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.