From: Dan Carpenter <dan.carpenter@oracle.com>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: f2fs: avoid abnormal behavior on broken symlink
Date: Mon, 20 Apr 2015 17:49:47 +0300 [thread overview]
Message-ID: <20150420144947.GA10518@mwanda> (raw)
Hello Jaegeuk Kim,
The patch feb7cbb079e6: "f2fs: avoid abnormal behavior on broken
symlink" from Apr 15, 2015, leads to the following static checker
warning:
fs/f2fs/namei.c:304 f2fs_follow_link()
warn: 'page' isn't an ERR_PTR
fs/f2fs/namei.c
299 static void *f2fs_follow_link(struct dentry *dentry, struct nameidata *nd)
300 {
301 struct page *page;
302
303 page = page_follow_link_light(dentry, nd);
304 if (IS_ERR(page))
^^^^
The code in page_follow_link_light() is a bit hard to follow but it
returns NULL on error.
305 return page;
306
307 /* this is broken symlink case */
308 if (*nd_get_link(nd) == 0) {
309 kunmap(page);
^^^^^^^^^^^^
Potential NULL deref.
310 page_cache_release(page);
311 return ERR_PTR(-ENOENT);
312 }
313 return page;
314 }
regards,
dan carpenter
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
next reply other threads:[~2015-04-20 14:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-20 14:49 Dan Carpenter [this message]
2015-04-21 18:20 ` f2fs: avoid abnormal behavior on broken symlink Jaegeuk Kim
2015-04-22 6:28 ` Chao Yu
2015-04-22 7:48 ` Jaegeuk Kim
2015-04-22 9:31 ` Chao Yu
2015-04-22 16:52 ` Jaegeuk Kim
2015-04-22 10:27 ` Dan Carpenter
2015-04-22 18:13 ` Jaegeuk Kim
2015-04-22 19:19 ` Dan Carpenter
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=20150420144947.GA10518@mwanda \
--to=dan.carpenter@oracle.com \
--cc=jaegeuk@kernel.org \
--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.