From: ldv@altlinux.org (Dmitry V. Levin) To: linux-riscv@lists.infradead.org Subject: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument Date: Wed, 21 Nov 2018 22:00:10 +0300 [thread overview] Message-ID: <20181121190009.GA10301@altlinux.org> (raw) In-Reply-To: <20181121184004.jro532jopnbmru2m@pburton-laptop> Hi Paul, On Wed, Nov 21, 2018 at 06:40:06PM +0000, Paul Burton wrote: > Hi Dmitry, > > On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote: > > This argument is required to extend the generic ptrace API > > with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be > > called from ptrace_request() along with other syscall_get_* functions > > with a tracee as their argument. > > > > This change partially reverts commit 5e937a9ae913 ("syscall_get_arch: > > remove useless function arguments"). > > > >% > > > > diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h > > index 0170602a1e4e..52b633f20abd 100644 > > --- a/arch/mips/include/asm/syscall.h > > +++ b/arch/mips/include/asm/syscall.h > > @@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, > > #ifdef CONFIG_64BIT > > case 4: case 5: case 6: case 7: > > #ifdef CONFIG_MIPS32_O32 > > - if (test_thread_flag(TIF_32BIT_REGS)) > > + if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS)) > > return get_user(*arg, (int *)usp + n); > > else > > #endif > > This ought to be test_tsk_thread_flag(task, TIF_32BIT_REGS) instead of > open-coding test_tsk_thread_flag. This will be corrected, thanks for letting me know. > More fundamentally though, this change doesn't seem to be (directly) > related to the change you describe in the commit message - it's not > syscall_get_arch being modified here. I suspect this should be a > separate commit, or if not please explain in the commit message why this > change is included. Good point, this is a fix that should not have been included into this commit. The bug was found while preparing the syscall_get_arch change, and this hunk just slipped in. I'll send it as a separate commit. > Compounding the lack of clarity is the fact that I only received this > patch, not the whole series, so I can't view the change in the context > of the rest of the series. > > > @@ -140,14 +140,14 @@ extern const unsigned long sys_call_table[]; > > extern const unsigned long sys32_call_table[]; > > extern const unsigned long sysn32_call_table[]; > > > > -static inline int syscall_get_arch(void) > > +static inline int syscall_get_arch(struct task_struct *task) > > { > > int arch = AUDIT_ARCH_MIPS; > > #ifdef CONFIG_64BIT > > - if (!test_thread_flag(TIF_32BIT_REGS)) { > > + if (!test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS)) { > > arch |= __AUDIT_ARCH_64BIT; > > /* N32 sets only TIF_32BIT_ADDR */ > > - if (test_thread_flag(TIF_32BIT_ADDR)) > > + if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_ADDR)) > > arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32; > > } > > #endif > > This does seem like the described change, but there are 2 more instances > of open-coding test_tsk_thread_flag which ought to be cleaned up. This will be cleaned up, thanks for letting me know. -- ldv -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-riscv/attachments/20181121/0639cad7/attachment.sig>
WARNING: multiple messages have this Message-ID (diff)
From: "Dmitry V. Levin" <ldv@altlinux.org> To: Paul Burton <paul.burton@mips.com> Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Paul Moore <paul@paul-moore.com>, linux-hexagon@vger.kernel.org, x86@kernel.org, Eugene Syromyatnikov <esyr@redhat.com>, Elvira Khabirova <lineprinter@altlinux.org>, linux-snps-arc@lists.infradead.org, uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, linux-um@lists.infradead.org, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, Andy Lutomirski <luto@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-parisc@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>, Eric Paris <eparis@redhat.com>, linux-audit@redhat.com, linux-alpha@vger.kernel.org, nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument Date: Wed, 21 Nov 2018 22:00:10 +0300 [thread overview] Message-ID: <20181121190009.GA10301@altlinux.org> (raw) Message-ID: <20181121190010.X-SfvqYEJvJDTzq5ZQhHK2zFRJX7rxTRsoVSk8RSEhc@z> (raw) In-Reply-To: <20181121184004.jro532jopnbmru2m@pburton-laptop> [-- Attachment #1.1: Type: text/plain, Size: 3014 bytes --] Hi Paul, On Wed, Nov 21, 2018 at 06:40:06PM +0000, Paul Burton wrote: > Hi Dmitry, > > On Wed, Nov 21, 2018 at 03:44:22AM +0300, Dmitry V. Levin wrote: > > This argument is required to extend the generic ptrace API > > with PTRACE_GET_SYSCALL_INFO request: syscall_get_arch() is going to be > > called from ptrace_request() along with other syscall_get_* functions > > with a tracee as their argument. > > > > This change partially reverts commit 5e937a9ae913 ("syscall_get_arch: > > remove useless function arguments"). > > > >% > > > > diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h > > index 0170602a1e4e..52b633f20abd 100644 > > --- a/arch/mips/include/asm/syscall.h > > +++ b/arch/mips/include/asm/syscall.h > > @@ -73,7 +73,7 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg, > > #ifdef CONFIG_64BIT > > case 4: case 5: case 6: case 7: > > #ifdef CONFIG_MIPS32_O32 > > - if (test_thread_flag(TIF_32BIT_REGS)) > > + if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS)) > > return get_user(*arg, (int *)usp + n); > > else > > #endif > > This ought to be test_tsk_thread_flag(task, TIF_32BIT_REGS) instead of > open-coding test_tsk_thread_flag. This will be corrected, thanks for letting me know. > More fundamentally though, this change doesn't seem to be (directly) > related to the change you describe in the commit message - it's not > syscall_get_arch being modified here. I suspect this should be a > separate commit, or if not please explain in the commit message why this > change is included. Good point, this is a fix that should not have been included into this commit. The bug was found while preparing the syscall_get_arch change, and this hunk just slipped in. I'll send it as a separate commit. > Compounding the lack of clarity is the fact that I only received this > patch, not the whole series, so I can't view the change in the context > of the rest of the series. > > > @@ -140,14 +140,14 @@ extern const unsigned long sys_call_table[]; > > extern const unsigned long sys32_call_table[]; > > extern const unsigned long sysn32_call_table[]; > > > > -static inline int syscall_get_arch(void) > > +static inline int syscall_get_arch(struct task_struct *task) > > { > > int arch = AUDIT_ARCH_MIPS; > > #ifdef CONFIG_64BIT > > - if (!test_thread_flag(TIF_32BIT_REGS)) { > > + if (!test_ti_thread_flag(task_thread_info(task), TIF_32BIT_REGS)) { > > arch |= __AUDIT_ARCH_64BIT; > > /* N32 sets only TIF_32BIT_ADDR */ > > - if (test_thread_flag(TIF_32BIT_ADDR)) > > + if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT_ADDR)) > > arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32; > > } > > #endif > > This does seem like the described change, but there are 2 more instances > of open-coding test_tsk_thread_flag which ought to be cleaned up. This will be cleaned up, thanks for letting me know. -- ldv [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 801 bytes --] [-- Attachment #2: Type: text/plain, Size: 161 bytes --] _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2018-11-21 19:00 UTC|newest] Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20181107042751.3b519062@akathisia> [not found] ` <CALCETrV1v-DPRfDRwiH=xn29bxWxiHdZtAH1nw=dsmDtnT0YGQ@mail.gmail.com> 2018-11-09 3:13 ` [PATCH 00/13] Prepare for PTRACE_GET_SYSCALL_INFO Dmitry V. Levin 2018-11-09 3:13 ` Dmitry V. Levin 2018-11-09 3:17 ` [PATCH 12/13] riscv: define syscall_get_arch() Dmitry V. Levin 2018-11-09 3:17 ` Dmitry V. Levin 2018-11-09 6:59 ` David Abdurachmanov 2018-11-09 6:59 ` David Abdurachmanov 2018-11-09 22:28 ` Dmitry V. Levin 2018-11-09 22:28 ` Dmitry V. Levin 2018-11-10 5:12 ` David Abdurachmanov 2018-11-10 5:12 ` David Abdurachmanov 2018-11-10 9:27 ` Andreas Schwab 2018-11-10 9:27 ` Andreas Schwab 2018-11-09 18:45 ` Palmer Dabbelt 2018-11-09 18:45 ` Palmer Dabbelt 2018-11-09 21:31 ` Dmitry V. Levin 2018-11-09 21:31 ` Dmitry V. Levin 2018-11-09 22:48 ` [PATCH 12/13 v2] " Dmitry V. Levin 2018-11-09 22:48 ` Dmitry V. Levin 2018-11-11 21:21 ` Palmer Dabbelt 2018-11-11 21:21 ` Palmer Dabbelt 2018-11-09 6:06 ` [PATCH 00/13] Prepare for PTRACE_GET_SYSCALL_INFO Andy Lutomirski 2018-11-09 6:06 ` Andy Lutomirski 2018-11-20 0:11 ` [PATCH v2 00/15] " Dmitry V. Levin 2018-11-20 0:11 ` Dmitry V. Levin 2018-11-20 0:16 ` [PATCH v2 13/15] riscv: define syscall_get_arch() Dmitry V. Levin 2018-11-20 0:16 ` Dmitry V. Levin 2018-11-20 20:26 ` [PATCH v2 00/15] Prepare for PTRACE_GET_SYSCALL_INFO Paul Moore 2018-11-20 20:26 ` Paul Moore 2018-11-21 0:44 ` [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument Dmitry V. Levin 2018-11-21 0:44 ` Dmitry V. Levin 2018-11-21 15:15 ` Andy Lutomirski 2018-11-21 15:15 ` Andy Lutomirski 2018-11-21 15:47 ` Palmer Dabbelt 2018-11-21 15:47 ` Palmer Dabbelt 2018-11-21 18:40 ` Paul Burton 2018-11-21 18:40 ` Paul Burton 2018-11-21 19:00 ` Dmitry V. Levin [this message] 2018-11-21 19:00 ` Dmitry V. Levin 2018-11-21 19:35 ` [PATCH v2 16/15 v2] " Dmitry V. Levin 2018-11-21 19:35 ` Dmitry V. Levin 2018-11-21 19:45 ` Paul Burton 2018-11-21 19:45 ` Paul Burton 2018-11-27 10:34 ` [PATCH v2 16/15] " Michael Ellerman 2018-11-27 10:34 ` Michael Ellerman
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=20181121190009.GA10301@altlinux.org \ --to=ldv@altlinux.org \ --cc=linux-riscv@lists.infradead.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).