linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* Re: f2fs: avoid abnormal behavior on broken symlink
@ 2015-04-20 14:49 Dan Carpenter
  2015-04-21 18:20 ` Jaegeuk Kim
  0 siblings, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2015-04-20 14:49 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-04-22 19:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 14:49 f2fs: avoid abnormal behavior on broken symlink Dan Carpenter
2015-04-21 18:20 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).