Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbbGCQ6U (ORCPT ); Fri, 3 Jul 2015 12:58:20 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:33199 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754846AbbGCQ6N (ORCPT ); Fri, 3 Jul 2015 12:58:13 -0400 MIME-Version: 1.0 In-Reply-To: <5596A58F.7090208@samsung.com> References: <1435920595-30879-1-git-send-email-m.niesluchow@samsung.com> <5596A58F.7090208@samsung.com> From: Andy Lutomirski Date: Fri, 3 Jul 2015 09:57:52 -0700 Message-ID: Subject: Re: [RFC 0/8] Additional kmsg devices To: Marcin Niesluchowski Cc: Richard Weinberger , "linux-doc@vger.kernel.org" , LKML , "open list:ABI/API" , Jonathan Corbet , Greg Kroah-Hartman , Petr Mladek , Tejun Heo , Kay Sievers , Andrew Morton , Joe Perches , Karol Lewandowski , Bartlomiej Zolnierkiewicz Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1078 Lines: 23 On Fri, Jul 3, 2015 at 8:09 AM, Marcin Niesluchowski wrote: > > * Message credibility: Lets imagine simple service which collects logs via > unix sockets. There is no reliable way of identifying logging process. > getsockopt() with SO_PEERCRED option would give pid form cred structure, but > according to manual it may not be of actual logging process: > "The returned credentials are those that were in effect at the time of the > call to connect(2) or socketpair(2)." > - select(7) There's SCM_CREDENTIALS, which is dangerous, but it's dangerous in exactly the same way that your patches are dangerous. You're collecting PID/TID when write(2) is called, and it's very easy to get another process to call write(2) on your behalf, because write(2) isn't supposed to collect credentials. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/