All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [bug report] f2fs: fix to avoid reading out encrypted data in page cache
Date: Tue, 12 Jul 2016 09:44:46 -0700	[thread overview]
Message-ID: <20160712164446.GA14203@jaegeuk> (raw)
In-Reply-To: <04413f72-1c7c-7a87-5746-08dc3d9f362f@kernel.org>

Hello,

It seems we can write just one patch to resolve this.
Thoughts?

>From f2bd632963409ff969aa2567a38f42f4b493a4b4 Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim <jaegeuk@kernel.org>
Date: Tue, 12 Jul 2016 09:38:48 -0700
Subject: [PATCH] f2fs: fix ERR_PTR returned by bio

This is to fix wrong error pointer handling flow reported by Dan.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/data.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 9017366..991ce21 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1137,8 +1137,10 @@ submit_and_realloc:
 		}
 		if (bio == NULL) {
 			bio = f2fs_grab_bio(inode, block_nr, nr_pages);
-			if (IS_ERR(bio))
+			if (IS_ERR(bio)) {
+				bio = NULL;
 				goto set_error_page;
+			}
 		}
 
 		if (bio_add_page(bio, page, blocksize, 0) < blocksize)
-- 
2.8.3


------------------------------------------------------------------------------
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 16:44 UTC|newest]

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

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=20160712164446.GA14203@jaegeuk \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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.