Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1756415ybl; Wed, 28 Aug 2019 21:10:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMNluzxPshnU77+MoDDS2twTGLppjoftAxZYZswsij5rtDZgjv5HrmMYwV2oHsPWgkCDO6 X-Received: by 2002:aa7:9a52:: with SMTP id x18mr9007408pfj.8.1567051855029; Wed, 28 Aug 2019 21:10:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567051855; cv=none; d=google.com; s=arc-20160816; b=ldXg0eFRR0rvekEl1ZKE5pG+IWI8BDYhFX1zrOy1aDvTxWqvGqlrBWrKEr3SCYrbem n4GU+/6tQ4TSWa6UNcZjWuE3DaISLUcIDgJd3g/+aMemkJpPCbEiPRwifNlgUDFuQAsc TvdRhjXNnJ6ufey7DlU9QxtUR4zKVRwr3nvKIPKdygDYE6ft9u5/Ug293hAghZE8AwZK 1ufKygk2ZB0tq9NknftNjfjf+oxOTSADYI1UR2gJfMWKuKsAd34ji1DUUwJmsXmXOqWb JN5FtlaIrc7fx8GKiUa59nQ7PR9ke7KoDbvqMSa7fWiAipXsEtQ1SuguyV+n+GddH9Qn csiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=YU1YHjbF48DNiDGJ/sscFH+VTiFvXEQv14JcR6j+IMU=; b=Uh/dsEa64VlcATZMu/kzf4TRgousTQwmEuh7duxZ4oJAtF1sjOANeMMrMdQ8rIPNfm wVxZKj8hs/slRinT3C5PGw8Y4bikyMFOcBHy774ZAqSuNxxgWVtWuGah//6YNwBLVzbR CQmfyythVWQeoCqn1H2oawWsvEiL/rG4LQKK1DSTs72euFfyYvkMQTA7RWS14ZZNPZMx 2eN2g+3XNZbgRvEeWwdtCCO16fcWFkVhbdihkSp4L2OSox4lqx20ANYNGoSkqCHYxqxy 81tcnsGLJXVkaynkhFbABWNk2hbLcY//HmJ+IZbrarsFQ+gMxqBv4Xi7g9T/pIXkF5/Q mVtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bTpepsNJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si883639pge.429.2019.08.28.21.10.38; Wed, 28 Aug 2019 21:10:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bTpepsNJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726369AbfH2EJt (ORCPT + 99 others); Thu, 29 Aug 2019 00:09:49 -0400 Received: from mail-io1-f51.google.com ([209.85.166.51]:34717 "EHLO mail-io1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbfH2EJs (ORCPT ); Thu, 29 Aug 2019 00:09:48 -0400 Received: by mail-io1-f51.google.com with SMTP id s21so4202420ioa.1; Wed, 28 Aug 2019 21:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YU1YHjbF48DNiDGJ/sscFH+VTiFvXEQv14JcR6j+IMU=; b=bTpepsNJjZwXWh3JW5H4Ce7efx57U0QBAypMjHr2aJhmxYvbZ4l9uUtc6UMlNwMCVJ rLlM8Vuv3UZLoMQqhxPfSciTslDnYspvytfvb/vz8K2fmL1kCztbZVNCT5neQNLSfNkp qWBHRHtafx3W65LeuqM2KbWB2E3HPtZsAI/KMVTjkBAIPdQN7XKEbIKijAU6vjg9Fuaf bp0Pn17+wxMtNr9KWvB+NPLxdLh1yE9mQhv4Mb2tA8gukZv0oRe5fsDjlDKE4B8fJ/bJ XqKYm9LeOOGfR66D2NLd8hFML4RtuW4fzzWLP6+mCHpTLLGaGIuz1+mGmeSk0/c85frc andQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YU1YHjbF48DNiDGJ/sscFH+VTiFvXEQv14JcR6j+IMU=; b=eLAWz4fngJKjXbzazP5gCM8VvF4EOgaYMVzeKIxzNq3Gmjy3DB9de0+MVvkbylZcZB IbzxcF9KkR/kv7QvWIE5wpzZjBffGk0jT2G0EZlS8c/AJ25SYjEdFYrUZadmbLTKv4gr W6D8zJBlJfcO4nYCDiRXqqgmYOz/ziPY7cqWvEjZmERlBcHCGWH8SRDto3E1FYXr6YHH gt+QkFBEvEYuqQQS12qD+HM3iK0kH6efe8ikmMWZ9Yoqowy/moNqvuquMpcF1mYpqlOc fh88KQhxtTgIFDfg2czYfrtzUDaHYcv2mzx8xENxhvIb7WkbQVhl6c3IaBd+UUaazVPT hp/g== X-Gm-Message-State: APjAAAUoQN0OwQ3c9taNIq1aCuB8P7/pRey86aF+JXdrykNCeATsn+xV lH3JGR/zSYzBuByXp9V5D8hq//JvI+B6FteAGNaBTg== X-Received: by 2002:a5e:da48:: with SMTP id o8mr8716584iop.252.1567051787467; Wed, 28 Aug 2019 21:09:47 -0700 (PDT) MIME-Version: 1.0 References: <20190829000006.24187-1-colin.king@canonical.com> In-Reply-To: From: ronnie sahlberg Date: Thu, 29 Aug 2019 14:09:35 +1000 Message-ID: Subject: Re: [PATCH][cifs-next] cifs: ensure variable rc is initialized at the after_open label To: Steve French Cc: Colin King , Steve French , CIFS , samba-technical , kernel-janitors , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 2:00 PM Steve French wrote: > > Merged into cifs-2.6.git for-next > > Ronnie, > You ok with merging this as a distinct patch? Sure thing. Thanks for the fix Colin. > > On Wed, Aug 28, 2019 at 7:02 PM Colin King wrote: > > > > From: Colin Ian King > > > > A previous fix added a jump to after_open which now leaves variable > > rc in a uninitialized state. A couple of the cases in the following > > switch statement do not set variable rc, hence the error check on rc > > at the end of the switch statement is reading a garbage value in rc > > for those specific cases. Fix this by initializing rc to zero before > > the switch statement. > > > > Fixes: 955a9c5b39379 ("cifs: create a helper to find a writeable handle by path name") > > Addresses-Coverity: ("Uninitialized scalar variable") > > Signed-off-by: Colin Ian King > > --- > > fs/cifs/smb2inode.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c > > index 70342bcd89b4..939fc7b2234c 100644 > > --- a/fs/cifs/smb2inode.c > > +++ b/fs/cifs/smb2inode.c > > @@ -116,6 +116,7 @@ smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon, > > smb2_set_next_command(tcon, &rqst[num_rqst]); > > after_open: > > num_rqst++; > > + rc = 0; > > > > /* Operation */ > > switch (command) { > > -- > > 2.20.1 > > > > > -- > Thanks, > > Steve