From patchwork Sat Apr 20 01:32:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Torvalds X-Patchwork-Id: 238135 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C9EE92C020D for ; Sat, 20 Apr 2013 11:32:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965410Ab3DTBcm (ORCPT ); Fri, 19 Apr 2013 21:32:42 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:42108 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965367Ab3DTBcl (ORCPT ); Fri, 19 Apr 2013 21:32:41 -0400 Received: by mail-pa0-f50.google.com with SMTP id bg2so2544167pad.9 for ; Fri, 19 Apr 2013 18:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:x-x-sender:to:cc:subject:message-id :user-agent:mime-version:content-type; bh=ZVVG5Ve+tlFr5vYuIOc/bb6RfkllkCMYtSYNHBkRQaA=; b=ocrQQdiLvJ8x+po4Z+jTjIREw7hm1bRkMrJ8W3St7ZGBcSSL9uQu+o1Xjhse2sjMWk 4dRkOlrxjRVKCZ+xlHDUeL8aS5YOIcVGVW53Iwy6EEZIHuxVFshAC1fVY5wAPT201fSU vzDuBP3SWpcb8viP/II6WJBeih9tsuFYiO/vre6fH/zHdOwPcXWvH9qFseE5syweKx1H o2lfdxZalbzf+TNlNTS9sEUN6TlCR2Y6vbIc2pQCrZ1ZlP2LYvOoo+oblPoqFAqz+t7P /tT4LKW9eaDHjXY83onUpQko73gHulCp1+00sh+0e14+lhBnKoGFJ/sVl7vlSLtxXStH WKmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=x-received:sender:date:from:x-x-sender:to:cc:subject:message-id :user-agent:mime-version:content-type; bh=ZVVG5Ve+tlFr5vYuIOc/bb6RfkllkCMYtSYNHBkRQaA=; b=B+cGcWpyhRy7pc7qAplhrg/uJI9gw51f8nLguV8THweoeUvjq0BCKL1sWqg9R0Tu5F Qc1KiI3BAStJluCLXsPAZ+UJWNo+kwJ7IctywAjsgZbr11QuGEJBJ5dTR3B3LeaAh0nx sg1hBWLeMY4OLH2spg+7nPtqLygD9/vZIYZEw= X-Received: by 10.66.9.100 with SMTP id y4mr1958613paa.189.1366421560788; Fri, 19 Apr 2013 18:32:40 -0700 (PDT) Received: from [192.168.1.87] (c-24-22-13-12.hsd1.or.comcast.net. [24.22.13.12]) by mx.google.com with ESMTPS id wl5sm16524606pac.18.2013.04.19.18.32.38 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 19 Apr 2013 18:32:39 -0700 (PDT) Date: Fri, 19 Apr 2013 18:32:32 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@i5.linux-foundation.org To: David Miller cc: netdev@vger.kernel.org, "Serge E. Hallyn" , "Eric W. Biederman" Subject: net: fix incorrect credentials passing Message-ID: User-Agent: Alpine 2.03 (LFD 1266 2009-07-14) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 257b5358b32f ("scm: Capture the full credentials of the scm sender") changed the credentials passing code to pass in the effective uid/gid instead of the real uid/gid. Obviously this doesn't matter most of the time (since normally they are the same), but it results in differences for suid binaries when the wrong uid/gid ends up being used. This just undoes that (presumably unintentional) part of the commit. Reported-by: Andy Lutomirski Cc: Eric W. Biederman Cc: Serge E. Hallyn Cc: David S. Miller Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds Acked-by: "Eric W. Biederman" --- include/net/scm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/net/scm.h b/include/net/scm.h index 975cca01048b..b11708105681 100644 --- a/include/net/scm.h +++ b/include/net/scm.h @@ -56,8 +56,8 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, scm->pid = get_pid(pid); scm->cred = cred ? get_cred(cred) : NULL; scm->creds.pid = pid_vnr(pid); - scm->creds.uid = cred ? cred->euid : INVALID_UID; - scm->creds.gid = cred ? cred->egid : INVALID_GID; + scm->creds.uid = cred ? cred->uid : INVALID_UID; + scm->creds.gid = cred ? cred->gid : INVALID_GID; } static __inline__ void scm_destroy_cred(struct scm_cookie *scm)