All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, vasily.averin@linux.dev,
	varad.gautam@suse.com, shakeelb@google.com,
	mussitantesmortem@gmail.com, manfred@colorfullife.com,
	dbueso@suse.de, chi.minghao@zte.com.cn, arnd@arndb.de,
	crazycdeveloper@gmail.com, akpm@linux-foundation.org
Subject: [to-be-updated] ipc-sem-fix-backward-compatibility-with-x86-32-kernels.patch removed from -mm tree
Date: Mon, 16 May 2022 16:36:13 -0700	[thread overview]
Message-ID: <20220516233614.883CDC385AA@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: ipc, sem: fix backward compatibility with x86-32 kernels
has been removed from the -mm tree.  Its filename was
     ipc-sem-fix-backward-compatibility-with-x86-32-kernels.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Maxim Zhukov <crazycdeveloper@gmail.com>
Subject: ipc, sem: fix backward compatibility with x86-32 kernels
Date: Sun, 15 May 2022 23:01:03 +0300

Since commit 275f22148e87 ("ipc: rename old-style shmctl/semctl/msgctl
syscalls") we have changed behavior:

ksys_semctl lost parse ipc version (ipc_parse_version), because the new
syscall works with IPC_64 only, but the parse function has some side
effect - it removes IPC_64 bit from `cmd`.

Some libc forced sends IPC_64 bit in semctl syscall[1][2][3], this leads
to a bug - X86-32 kernel does not have compat headers and does not
correctly parse received command (cmd) from semctl syscall: cmd have
actual command and IPC_64 bit, thus throw EINVAL error in ksys_semctl

This commit forcibly removes IPC_64 bit from the cmd to restore backward
compatibility.

[1]: https://elixir.bootlin.com/uclibc-ng/v1.0.40/source/libc/misc/sysvipc/sem.c#L58
[2]: https://elixir.bootlin.com/musl/v1.2.3/source/src/ipc/semctl.c#L48 -> https://elixir.bootlin.com/musl/v1.2.3/source/src/ipc/ipc.h#L22
[3]: https://elixir.bootlin.com/glibc/glibc-2.35/source/sysdeps/unix/sysv/linux/semctl.c#L124

Link: https://lkml.kernel.org/r/20220515200103.1408370-2-mussitantesmortem@gmail.com
Signed-off-by: Maxim Zhukov <mussitantesmortem@gmail.com>
Cc: Minghao Chi <chi.minghao@zte.com.cn>
Cc: Varad Gautam <varad.gautam@suse.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Vasily Averin <vasily.averin@linux.dev>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 ipc/sem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/ipc/sem.c~ipc-sem-fix-backward-compatibility-with-x86-32-kernels
+++ a/ipc/sem.c
@@ -1704,7 +1704,7 @@ static long ksys_semctl(int semid, int s
 
 SYSCALL_DEFINE4(semctl, int, semid, int, semnum, int, cmd, unsigned long, arg)
 {
-	return ksys_semctl(semid, semnum, cmd, arg, IPC_64);
+	return ksys_semctl(semid, semnum, cmd & (~IPC_64), arg, IPC_64);
 }
 
 #ifdef CONFIG_ARCH_WANT_IPC_PARSE_VERSION
_

Patches currently in -mm which might be from crazycdeveloper@gmail.com are



                 reply	other threads:[~2022-05-16 23:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220516233614.883CDC385AA@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=chi.minghao@zte.com.cn \
    --cc=crazycdeveloper@gmail.com \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=mussitantesmortem@gmail.com \
    --cc=shakeelb@google.com \
    --cc=varad.gautam@suse.com \
    --cc=vasily.averin@linux.dev \
    /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.