All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: yuchao0@huawei.com
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [bug report] f2fs: fix to avoid reading out encrypted data in page cache
Date: Tue, 12 Jul 2016 16:29:39 +0300	[thread overview]
Message-ID: <20160712132938.GA20260@mwanda> (raw)

Hello Chao Yu,

The patch 78682f794479: "f2fs: fix to avoid reading out encrypted
data in page cache" from Jul 3, 2016, leads to the following static
checker warning:

	fs/f2fs/data.c:1123 f2fs_mpage_readpages()
	error: 'bio' dereferencing possible ERR_PTR()

fs/f2fs/data.c
  1093                  }
  1094                  if (bio == NULL) {
  1095                          bio = f2fs_grab_bio(inode, block_nr, nr_pages);
  1096                          if (IS_ERR(bio))
                                    ^^^^^^^^^^
It's an error pointer.

  1097                                  goto set_error_page;
  1098                          bio_set_op_attrs(bio, REQ_OP_READ, 0);
  1099                  }
  1100  
  1101                  if (bio_add_page(bio, page, blocksize, 0) < blocksize)
  1102                          goto submit_and_realloc;
  1103  
  1104                  last_block_in_bio = block_nr;
  1105                  goto next_page;
  1106  set_error_page:
  1107                  SetPageError(page);
  1108                  zero_user_segment(page, 0, PAGE_SIZE);
  1109                  unlock_page(page);
  1110                  goto next_page;
  1111  confused:
  1112                  if (bio) {
  1113                          __submit_bio(F2FS_I_SB(inode), bio, DATA);
  1114                          bio = NULL;
  1115                  }
  1116                  unlock_page(page);
  1117  next_page:
  1118                  if (pages)
  1119                          put_page(page);
  1120          }
  1121          BUG_ON(pages && !list_empty(pages));
  1122          if (bio)
  1123                  __submit_bio(F2FS_I_SB(inode), bio, DATA);
                                                       ^^^
Dereferenced.

  1124          return 0;

regards,
dan carpenter

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev

             reply	other threads:[~2016-07-12 13:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 13:29 Dan Carpenter [this message]
2016-07-12 15:15 ` [bug report] f2fs: fix to avoid reading out encrypted data in page cache Chao Yu
2016-07-12 16:44   ` Jaegeuk Kim

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=20160712132938.GA20260@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=yuchao0@huawei.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.