From patchwork Wed Oct 9 01:09:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 3006141 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F460BF924 for ; Wed, 9 Oct 2013 01:09:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 871CB201F2 for ; Wed, 9 Oct 2013 01:09:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88B43201B8 for ; Wed, 9 Oct 2013 01:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756533Ab3JIBJr (ORCPT ); Tue, 8 Oct 2013 21:09:47 -0400 Received: from mail-yh0-f42.google.com ([209.85.213.42]:38595 "EHLO mail-yh0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756518Ab3JIBJq (ORCPT ); Tue, 8 Oct 2013 21:09:46 -0400 Received: by mail-yh0-f42.google.com with SMTP id z12so32852yhz.1 for ; Tue, 08 Oct 2013 18:09:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version:content-type:content-transfer-encoding; bh=aNj5uJKo7xmA3XQFha2sLcFQq1F5nCsC4K+w9a6eSd0=; b=DPkieW2TZNVMtfWcS0sLDC6mRlsVHZ9YLrowu4elPOCjZ3eDYiBB4fSbrS9IeqfU0/ vLlZJil2yVvu97YDBMmC6p08DwBxKK+i6NhhPFt4KRpmtZMdwSK/XQI6ug6lc4TLpwYM DxhjobrwF/4XGOfItAl23bd2r4gLIgRIrYtxJIrYWkkONaCmQqU/BwqII1MPqfg0nHmO uTD1V03DzvvKUbfbLbthj6EUbHY2sYhXPEjZXYuQfdWneRR6j4VL4lq1cvW6izxjTARo N3VAeclK/iKE3qBhW9nzh7Y+WxycEH/lLZFKzFbBm6IsYUKZJxSjJMvgK7pd8PUD8SJF q3/g== X-Gm-Message-State: ALoCoQmv2HaYoznr9NZb/PWfBlSIf+7RZ/ZBwqDNfD7ASPt+ee15enLiIVCLmt04czLy9IFOH+wa X-Received: by 10.236.75.202 with SMTP id z50mr4349684yhd.6.1381280985857; Tue, 08 Oct 2013 18:09:45 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id r1sm56725296yhf.17.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Oct 2013 18:09:44 -0700 (PDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Subject: [PATCH][cifs-utils] setcifsacl: fix bad bit-shift in raw_str_to_sid Date: Tue, 8 Oct 2013 21:09:39 -0400 Message-Id: <1381280979-18571-1-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A Coverity scan turned up this warning: 1. cifs-utils-6.2/setcifsacl.c:578:result_independent_of_operands – "(x & 0xff0000000000ULL) >> 48" is 0 regardless of the values of its operands. This occurs as the operand of assignment. ...which is entirely true. That shift should be 40 bits, not 48. Signed-off-by: Jeff Layton --- setcifsacl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setcifsacl.c b/setcifsacl.c index ce708eb..7eeeaa6 100644 --- a/setcifsacl.c +++ b/setcifsacl.c @@ -575,7 +575,7 @@ raw_str_to_sid(const char *str, struct cifs_sid *csid) csid->authority[3] = (x & 0x000000ff0000ULL) >> 16; csid->authority[2] = (x & 0x0000ff000000ULL) >> 24; csid->authority[1] = (x & 0x00ff00000000ULL) >> 32; - csid->authority[0] = (x & 0xff0000000000ULL) >> 48; + csid->authority[0] = (x & 0xff0000000000ULL) >> 40; /* now read the the subauthorities and store as __le32 vals */ p = q + 1;