All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	youling 257 <youling257@gmail.com>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	Andrea Righi <andrea.righi@canonical.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	stable <stable@vger.kernel.org>,
	regressions@lists.linux.dev,
	LSM List <linux-security-module@vger.kernel.org>,
	Paul Moore <paul@paul-moore.com>,
	Stephen Smalley <stephen.smalley.work@gmail.com>,
	SElinux list <selinux@vger.kernel.org>
Subject: Re: [PATCH] proc: Track /proc/$pid/attr/ opener mm_struct
Date: Wed, 16 Jun 2021 07:56:06 +0200	[thread overview]
Message-ID: <YMmSdqnspAXG1CyT@kroah.com> (raw)
In-Reply-To: <202106151449.816D7DA682@keescook>

On Tue, Jun 15, 2021 at 02:50:39PM -0700, Kees Cook wrote:
> On Tue, Jun 15, 2021 at 11:19:04AM -0700, Linus Torvalds wrote:
> > On Mon, Jun 14, 2021 at 6:55 PM youling 257 <youling257@gmail.com> wrote:
> > >
> > > if try to find problem on userspace, i used linux 5.13rc6 on old
> > > android 7 cm14.1, not aosp android 11.
> > > http://git.osdn.net/view?p=android-x86/system-core.git;a=blob;f=init/service.cpp;h=a5334f447fc2fc34453d2f6a37523bedccadc690;hb=refs/heads/cm-14.1-x86#l457
> > >
> > >  457         if (!seclabel_.empty()) {
> > >  458             if (setexeccon(seclabel_.c_str()) < 0) {
> > >  459                 ERROR("cannot setexeccon('%s'): %s\n",
> > >  460                       seclabel_.c_str(), strerror(errno));
> > >  461                 _exit(127);
> > >  462             }
> > >  463         }
> > 
> > I have no idea where the cm14.1 libraries are. Does anybody know where
> > the matching source code for setexeccon() would be?
> > 
> > For me - obviously not on cm14.1 - all "setexeccon()" does is
> > 
> >    n = openat(AT_FDCWD, "/proc/thread-self/attr/exec", O_RDWR|O_CLOEXEC)
> >    write(n, string, len)
> >    close(n)
> > 
> > and if that fails, it would seem to indicate that proc_mem_open()
> > failed. Which would be mm_access() failing. But I don't see how that
> > can be the case, because mm_access() explicitly allows "mm ==
> > current->mm" (which the above clearly should be).
> 
> Yeah, that was what I saw too.
> 
> > youling, can you double-check with the current -git tree? But as far
> > as I can tell, my minimal patch is exactly the same as Kees' patch
> > (just smaller and simpler).
> 
> FWIW, for that patch:
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> Cc: stable@vger.kernel.org

Thanks, I'll go pick it up now.

greg k-h

  reply	other threads:[~2021-06-16  5:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 17:12 [PATCH] proc: Track /proc/$pid/attr/ opener mm_struct Kees Cook
2021-06-09  6:40 ` Christian Brauner
2021-06-14 10:02 ` youling257
2021-06-14 15:32   ` Kees Cook
2021-06-14 16:45     ` Kees Cook
2021-06-14 18:02       ` Linus Torvalds
2021-06-14 18:02         ` Linus Torvalds
2021-06-14 18:46       ` youling 257
2021-06-14 18:46         ` youling 257
2021-06-14 22:50         ` Kees Cook
2021-06-15  1:55           ` youling 257
2021-06-15  1:55             ` youling 257
2021-06-15 18:19             ` Linus Torvalds
2021-06-15 18:19               ` Linus Torvalds
2021-06-15 21:50               ` Kees Cook
2021-06-16  5:56                 ` Greg KH [this message]
2021-06-16  5:15               ` youling 257
2021-06-16  5:15                 ` youling 257
2021-06-14 17:52     ` Casey Schaufler

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=YMmSdqnspAXG1CyT@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andrea.righi@canonical.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=regressions@lists.linux.dev \
    --cc=selinux@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=youling257@gmail.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.