mbox series

[0/2] Fix invalid syscall return for traced tasks

Message ID 20210421184035.469587-1-ddstreet@canonical.com
Headers show
Series Fix invalid syscall return for traced tasks | expand

Message

Dan Streetman April 21, 2021, 6:40 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1895132

For any traced task, that has _TIF_TRACED set, invalid syscalls are
sent to the tracing code, which returns EPERM instead of ENOSYS, and
breaks userspace.

Note that in focal (5.4) the return value was the actual syscall number,
while in bionic the return value is EPERM. However either value breaks
userspace.

This is causing narrow failures of hirsute containers on bionic hosts
that are running the 4.15 kernel, as detailed in bug 1916485.

Sven Schnelle (2):
  s390/ptrace: return -ENOSYS when invalid syscall is supplied
  s390/ptrace: pass invalid syscall numbers to tracing

 arch/s390/kernel/entry.S  |  2 +-
 arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)

Comments

Stefan Bader April 22, 2021, 8:09 a.m. UTC | #1
On 21.04.21 20:40, Dan Streetman wrote:
> BugLink: https://bugs.launchpad.net/bugs/1895132
> 
> For any traced task, that has _TIF_TRACED set, invalid syscalls are
> sent to the tracing code, which returns EPERM instead of ENOSYS, and
> breaks userspace.
> 
> Note that in focal (5.4) the return value was the actual syscall number,
> while in bionic the return value is EPERM. However either value breaks
> userspace.
> 
> This is causing narrow failures of hirsute containers on bionic hosts
> that are running the 4.15 kernel, as detailed in bug 1916485.
> 
> Sven Schnelle (2):
>    s390/ptrace: return -ENOSYS when invalid syscall is supplied
>    s390/ptrace: pass invalid syscall numbers to tracing
> 
>   arch/s390/kernel/entry.S  |  2 +-
>   arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
>   2 files changed, 15 insertions(+), 10 deletions(-)
> 

Cover email should contain the target series (:<kernel>) for simpler reviews. 
The bug task should have status and importance set (I did that). And just 
wnodering, have you not been subscribed to the kermel-team mailing list before? 
Just baecause now all your posts need moderation.

-Stefan
Stefan Bader April 22, 2021, 8:13 a.m. UTC | #2
On 21.04.21 20:40, Dan Streetman wrote:
> BugLink: https://bugs.launchpad.net/bugs/1895132
> 
> For any traced task, that has _TIF_TRACED set, invalid syscalls are
> sent to the tracing code, which returns EPERM instead of ENOSYS, and
> breaks userspace.
> 
> Note that in focal (5.4) the return value was the actual syscall number,
> while in bionic the return value is EPERM. However either value breaks
> userspace.
> 
> This is causing narrow failures of hirsute containers on bionic hosts
> that are running the 4.15 kernel, as detailed in bug 1916485.
> 
> Sven Schnelle (2):
>    s390/ptrace: return -ENOSYS when invalid syscall is supplied
>    s390/ptrace: pass invalid syscall numbers to tracing
> 
>   arch/s390/kernel/entry.S  |  2 +-
>   arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
>   2 files changed, 15 insertions(+), 10 deletions(-)
> 
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Kleber Sacilotto de Souza April 22, 2021, 8:36 a.m. UTC | #3
On 21.04.21 20:40, Dan Streetman wrote:
> BugLink: https://bugs.launchpad.net/bugs/1895132
> 
> For any traced task, that has _TIF_TRACED set, invalid syscalls are
> sent to the tracing code, which returns EPERM instead of ENOSYS, and
> breaks userspace.
> 
> Note that in focal (5.4) the return value was the actual syscall number,
> while in bionic the return value is EPERM. However either value breaks
> userspace.
> 
> This is causing narrow failures of hirsute containers on bionic hosts
> that are running the 4.15 kernel, as detailed in bug 1916485.
> 
> Sven Schnelle (2):
>    s390/ptrace: return -ENOSYS when invalid syscall is supplied
>    s390/ptrace: pass invalid syscall numbers to tracing
> 
>   arch/s390/kernel/entry.S  |  2 +-
>   arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
>   2 files changed, 15 insertions(+), 10 deletions(-)
> 

Good test results.

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks
Colin Ian King April 22, 2021, 8:37 a.m. UTC | #4
On 21/04/2021 19:40, Dan Streetman wrote:
> BugLink: https://bugs.launchpad.net/bugs/1895132
> 
> For any traced task, that has _TIF_TRACED set, invalid syscalls are
> sent to the tracing code, which returns EPERM instead of ENOSYS, and
> breaks userspace.
> 
> Note that in focal (5.4) the return value was the actual syscall number,
> while in bionic the return value is EPERM. However either value breaks
> userspace.
> 
> This is causing narrow failures of hirsute containers on bionic hosts
> that are running the 4.15 kernel, as detailed in bug 1916485.
> 
> Sven Schnelle (2):
>   s390/ptrace: return -ENOSYS when invalid syscall is supplied
>   s390/ptrace: pass invalid syscall numbers to tracing
> 
>  arch/s390/kernel/entry.S  |  2 +-
>  arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
>  2 files changed, 15 insertions(+), 10 deletions(-)
> 

Looks good to me, backport looks OK for patch 2.

Acked-by: Colin Ian King <colin.king@canonical.com>
Dan Streetman April 22, 2021, 11:49 a.m. UTC | #5
On Thu, Apr 22, 2021 at 4:09 AM Stefan Bader <stefan.bader@canonical.com> wrote:
>
> On 21.04.21 20:40, Dan Streetman wrote:
> > BugLink: https://bugs.launchpad.net/bugs/1895132
> >
> > For any traced task, that has _TIF_TRACED set, invalid syscalls are
> > sent to the tracing code, which returns EPERM instead of ENOSYS, and
> > breaks userspace.
> >
> > Note that in focal (5.4) the return value was the actual syscall number,
> > while in bionic the return value is EPERM. However either value breaks
> > userspace.
> >
> > This is causing narrow failures of hirsute containers on bionic hosts
> > that are running the 4.15 kernel, as detailed in bug 1916485.
> >
> > Sven Schnelle (2):
> >    s390/ptrace: return -ENOSYS when invalid syscall is supplied
> >    s390/ptrace: pass invalid syscall numbers to tracing
> >
> >   arch/s390/kernel/entry.S  |  2 +-
> >   arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
> >   2 files changed, 15 insertions(+), 10 deletions(-)
> >
>
> Cover email should contain the target series (:<kernel>) for simpler reviews.
> The bug task should have status and importance set (I did that). And just
> wnodering, have you not been subscribed to the kermel-team mailing list before?
> Just baecause now all your posts need moderation.

sorry, I'm probably subscribed as my full email instead of
'ddstreet@', i'll change that

>
> -Stefan
>
Stefan Bader April 23, 2021, 10:14 a.m. UTC | #6
On 21.04.21 20:40, Dan Streetman wrote:
> BugLink: https://bugs.launchpad.net/bugs/1895132
> 
> For any traced task, that has _TIF_TRACED set, invalid syscalls are
> sent to the tracing code, which returns EPERM instead of ENOSYS, and
> breaks userspace.
> 
> Note that in focal (5.4) the return value was the actual syscall number,
> while in bionic the return value is EPERM. However either value breaks
> userspace.
> 
> This is causing narrow failures of hirsute containers on bionic hosts
> that are running the 4.15 kernel, as detailed in bug 1916485.
> 
> Sven Schnelle (2):
>    s390/ptrace: return -ENOSYS when invalid syscall is supplied
>    s390/ptrace: pass invalid syscall numbers to tracing
> 
>   arch/s390/kernel/entry.S  |  2 +-
>   arch/s390/kernel/ptrace.c | 23 ++++++++++++++---------
>   2 files changed, 15 insertions(+), 10 deletions(-)
> 
Applied to bionic:linux/master-next. Thanks.

-Stefan