rufimelo/DeltaSecommits huggingface dataset:
Vulnerability: Information Disclosure vulnerability in creer_fichier_zip in admin/maintenance.php in BlogoText through 3.7.6 allows remote attackers to defeat a filename-randomization protection mechanism, and read backup archives on Windows servers, by providing the archiv~1.zip name (aka an 8.3 filename).
Vulnerability ID: CVE-2017-17793
CWE: CWE-200
Severity score: 2.9
Project: https://github.com/BlogoText/blogotext
Published: 2017-12-20
File: admin/maintenance.php
Commit message: fix windows server zip file name for backup
Commit author: RemRem

Vulnerable version (before fix):
 function addFolder2zip($zip, $folder)  */ function creer_fichier_zip($folders) {     $zipfile = 'archive_site-'.date('Ymd').'-'.substr(md5(rand(10, 99)), 3, 5).'.zip';     $zip = new ZipArchive;     if ($zip->open(DIR_BACKUP.$zipfile, ZipArchive::CREATE) === true) {         foreach ($folders as $folder) {

Fixed version (after fix):
 function addFolder2zip($zip, $folder)  */ function creer_fichier_zip($folders) {     // fix on windows server, file can be found using "archiv~1.zip" as file name in URL     // $zipfile = 'archive_site-'.date('Ymd').'-'.substr(md5(rand(10, 99)), 3, 5).'.zip';     $zipfile = substr(md5(rand(10, 99)), 3, 5).'-archive_site-'.date('Ymd').'.zip';     $zip = new ZipArchive;     if ($zip->open(DIR_BACKUP.$zipfile, ZipArchive::CREATE) === true) {         foreach ($folders as $folder) {

Patch:
patch: @@ -337,7 +337,9 @@ function addFolder2zip($zip, $folder)
  */
 function creer_fichier_zip($folders)
 {
-    $zipfile = 'archive_site-'.date('Ymd').'-'.substr(md5(rand(10, 99)), 3, 5).'.zip';
+    // fix on windows server, file can be found using "archiv~1.zip" as file name in URL
+    // $zipfile = 'archive_site-'.date('Ymd').'-'.substr(md5(rand(10, 99)), 3, 5).'.zip';
+    $zipfile = substr(md5(rand(10, 99)), 3, 5).'-archive_site-'.date('Ymd').'.zip';
     $zip = new ZipArchive;
     if ($zip->open(DIR_BACKUP.$zipfile, ZipArchive::CREATE) === true) {
         foreach ($folders as $folder) {
path: admin/maintenance.php
Vulnerability: The List Users API of Piwigo 2.9.2 is vulnerable to SQL Injection via the /admin/user_list_backend.php sSortDir_0 parameter. An attacker can exploit this to gain access to the data in a connected MySQL database.
Vulnerability ID: CVE-2017-17822
CWE: CWE-89
Severity score: 2.9
Project: https://github.com/Piwigo/Piwigo
Published: 2017-12-21
File: admin/user_list_backend.php
Commit message: (cp 1da9d6a) fixes #823 add input user check to avoid SQLi on users list
Commit author: plegall

Vulnerable version (before fix):
 $sLimit = ""; if ( isset( $_REQUEST['iDisplayStart'] ) && $_REQUEST['iDisplayLength'] != '-1' ) {   $sLimit = "LIMIT ".pwg_db_real_escape_string( $_REQUEST['iDisplayStart'] ).", ".     pwg_db_real_escape_string( $_REQUEST['iDisplayLength'] ); } 	 	   $sOrder = "ORDER BY  ";   for ( $i=0 ; $i<intval( $_REQUEST['iSortingCols'] ) ; $i++ )   {     if ( $_REQUEST[ 'bSortable_'.intval($_REQUEST['iSortCol_'.$i]) ] == "true" )     {       $sOrder .= $aColumns[ intval( $_REQUEST['iSortCol_'.$i] ) ]." 				 	".pwg_db_real_escape_string( $_REQUEST['sSortDir_'.$i] ) .", ";     }   } 		

Fixed version (after fix):
 $sLimit = ""; if ( isset( $_REQUEST['iDisplayStart'] ) && $_REQUEST['iDisplayLength'] != '-1' ) {   $sLimit = "LIMIT ".$_REQUEST['iDisplayStart'].", ".$_REQUEST['iDisplayLength']; } 	 	   $sOrder = "ORDER BY  ";   for ( $i=0 ; $i<intval( $_REQUEST['iSortingCols'] ) ; $i++ )   {     check_input_parameter('iSortCol_'.$i, $_REQUEST, false, PATTERN_ID);      if ( $_REQUEST[ 'bSortable_'.$_REQUEST['iSortCol_'.$i] ] == "true" )     {       check_input_parameter('sSortDir_'.$i, $_REQUEST, false, '/^(asc|desc)$/');        $sOrder .= $aColumns[ $_REQUEST['iSortCol_'.$i] ].' '.$_REQUEST['sSortDir_'.$i].', ';     }   } 		

Patch:
patch: @@ -67,8 +67,7 @@
 $sLimit = "";
 if ( isset( $_REQUEST['iDisplayStart'] ) && $_REQUEST['iDisplayLength'] != '-1' )
 {
-  $sLimit = "LIMIT ".pwg_db_real_escape_string( $_REQUEST['iDisplayStart'] ).", ".
-    pwg_db_real_escape_string( $_REQUEST['iDisplayLength'] );
+  $sLimit = "LIMIT ".$_REQUEST['iDisplayStart'].", ".$_REQUEST['iDisplayLength'];
 }
 	
 	
@@ -80,10 +79,13 @@
   $sOrder = "ORDER BY  ";
   for ( $i=0 ; $i<intval( $_REQUEST['iSortingCols'] ) ; $i++ )
   {
-    if ( $_REQUEST[ 'bSortable_'.intval($_REQUEST['iSortCol_'.$i]) ] == "true" )
+    check_input_parameter('iSortCol_'.$i, $_REQUEST, false, PATTERN_ID);
+
+    if ( $_REQUEST[ 'bSortable_'.$_REQUEST['iSortCol_'.$i] ] == "true" )
     {
-      $sOrder .= $aColumns[ intval( $_REQUEST['iSortCol_'.$i] ) ]."
-				 	".pwg_db_real_escape_string( $_REQUEST['sSortDir_'.$i] ) .", ";
+      check_input_parameter('sSortDir_'.$i, $_REQUEST, false, '/^(asc|desc)$/');
+
+      $sOrder .= $aColumns[ $_REQUEST['iSortCol_'.$i] ].' '.$_REQUEST['sSortDir_'.$i].', ';
     }
   }
path: admin/user_list_backend.php
Vulnerability: The Configuration component of Piwigo 2.9.2 is vulnerable to SQL Injection via the admin/configuration.php order_by array parameter. An attacker can exploit this to gain access to the data in a connected MySQL database.
Vulnerability ID: CVE-2017-17823
CWE: CWE-89
Severity score: 2.9
Project: https://github.com/Piwigo/Piwigo
Published: 2017-12-21
File: admin/configuration.php
Commit message: (cp 9671454) fixes #826, check input parameter order_by in configuration
Commit author: plegall

Vulnerable version (before fix):
       {         if ( !empty($_POST['order_by']) )         {           $used = array();           foreach ($_POST['order_by'] as $i => $val)           {

Fixed version (after fix):
       {         if ( !empty($_POST['order_by']) )         {           check_input_parameter('order_by', $_POST, true, '/^('.implode('|', array_keys($sort_fields)).')$/');            $used = array();           foreach ($_POST['order_by'] as $i => $val)           {

Patch:
patch: @@ -161,6 +161,8 @@
       {
         if ( !empty($_POST['order_by']) )
         {
+          check_input_parameter('order_by', $_POST, true, '/^('.implode('|', array_keys($sort_fields)).')$/');
+
           $used = array();
           foreach ($_POST['order_by'] as $i => $val)
           {
path: admin/configuration.php
Vulnerability: The Batch Manager component of Piwigo 2.9.2 is vulnerable to SQL Injection via the admin/batch_manager_unit.php element_ids parameter in unit mode. An attacker can exploit this to gain access to the data in a connected MySQL database.
Vulnerability ID: CVE-2017-17824
CWE: CWE-89
Severity score: 2.9
Project: https://github.com/Piwigo/Piwigo
Published: 2017-12-21
File: admin/batch_manager_unit.php
Commit message: (cp 9028c75) fixes #825, check user input on Batch Manager, unit mode, to prevent SQL injection
Commit author: plegall

Vulnerable version (before fix):
  if (isset($_POST['submit'])) {   $collection = explode(',', $_POST['element_ids']);    $datas = array();

Fixed version (after fix):
  if (isset($_POST['submit'])) {   check_input_parameter('element_ids', $_POST, false, '/^\d+(,\d+)*$/');   $collection = explode(',', $_POST['element_ids']);    $datas = array();

Patch:
patch: @@ -47,6 +47,7 @@
 
 if (isset($_POST['submit']))
 {
+  check_input_parameter('element_ids', $_POST, false, '/^\d+(,\d+)*$/');
   $collection = explode(',', $_POST['element_ids']);
 
   $datas = array();
path: admin/batch_manager_unit.php
Vulnerability: kernel/bpf/verifier.c in the Linux kernel through 4.14.8 allows local users to cause a denial of service (memory corruption) or possibly have unspecified other impact by leveraging the lack of stack-pointer alignment enforcement.
Vulnerability ID: CVE-2017-17856
CWE: CWE-119
Severity score: 10
Project: https://github.com/torvalds/linux
Published: 2017-12-27
File: kernel/bpf/verifier.c
Commit message: bpf: force strict alignment checks for stack pointers

Force strict alignment checks for stack pointers because the tracking of
stack spills relies on it; unaligned stack accesses can lead to corruption
of spilled registers, which is exploitable.

Fixes: f1174f77b50c ("bpf/verifier: rework value tracking")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Commit author: Jann Horn

Vulnerable version (before fix):
 static int check_ptr_alignment(struct bpf_verifier_env *env, 		break; 	case PTR_TO_STACK: 		pointer_desc = "stack "; 		break; 	default: 		break;

Fixed version (after fix):
 static int check_ptr_alignment(struct bpf_verifier_env *env, 		break; 	case PTR_TO_STACK: 		pointer_desc = "stack "; 		/* The stack spill tracking logic in check_stack_write() 		 * and check_stack_read() relies on stack accesses being 		 * aligned. 		 */ 		strict = true; 		break; 	default: 		break;

Patch:
patch: @@ -1059,6 +1059,11 @@ static int check_ptr_alignment(struct bpf_verifier_env *env,
 		break;
 	case PTR_TO_STACK:
 		pointer_desc = "stack ";
+		/* The stack spill tracking logic in check_stack_write()
+		 * and check_stack_read() relies on stack accesses being
+		 * aligned.
+		 */
+		strict = true;
 		break;
 	default:
 		break;
path: kernel/bpf/verifier.c
Vulnerability: The check_stack_boundary function in kernel/bpf/verifier.c in the Linux kernel through 4.14.8 allows local users to cause a denial of service (memory corruption) or possibly have unspecified other impact by leveraging mishandling of invalid variable stack read operations.
Vulnerability ID: CVE-2017-17857
CWE: CWE-119
Severity score: 10
Project: https://github.com/torvalds/linux
Published: 2017-12-27
File: kernel/bpf/verifier.c
Commit message: bpf: fix missing error return in check_stack_boundary()

Prevent indirect stack accesses at non-constant addresses, which would
permit reading and corrupting spilled pointers.

Fixes: f1174f77b50c ("bpf/verifier: rework value tracking")
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Commit author: Jann Horn

Vulnerable version (before fix):
 static int check_stack_boundary(struct bpf_verifier_env *env, int regno, 		tnum_strn(tn_buf, sizeof(tn_buf), regs[regno].var_off); 		verbose(env, "invalid variable stack read R%d var_off=%s\n", 			regno, tn_buf); 	} 	off = regs[regno].off + regs[regno].var_off.value; 	if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 ||

Fixed version (after fix):
 static int check_stack_boundary(struct bpf_verifier_env *env, int regno, 		tnum_strn(tn_buf, sizeof(tn_buf), regs[regno].var_off); 		verbose(env, "invalid variable stack read R%d var_off=%s\n", 			regno, tn_buf); 		return -EACCES; 	} 	off = regs[regno].off + regs[regno].var_off.value; 	if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 ||

Patch:
patch: @@ -1303,6 +1303,7 @@ static int check_stack_boundary(struct bpf_verifier_env *env, int regno,
 		tnum_strn(tn_buf, sizeof(tn_buf), regs[regno].var_off);
 		verbose(env, "invalid variable stack read R%d var_off=%s\n",
 			regno, tn_buf);
+		return -EACCES;
 	}
 	off = regs[regno].off + regs[regno].var_off.value;
 	if (off >= 0 || off < -MAX_BPF_STACK || off + access_size > 0 ||
path: kernel/bpf/verifier.c
Vulnerability: The tcpmss_mangle_packet function in net/netfilter/xt_TCPMSS.c in the Linux kernel before 4.11, and 4.9.x before 4.9.36, allows remote attackers to cause a denial of service (use-after-free and memory corruption) or possibly have unspecified other impact by leveraging the presence of xt_TCPMSS in an iptables action.
Vulnerability ID: CVE-2017-18017
CWE: CWE-416
Severity score: 10
Project: https://github.com/torvalds/linux
Published: 2018-01-03
File: net/netfilter/xt_TCPMSS.c
Commit message: netfilter: xt_TCPMSS: add more sanity tests on tcph->doff

Denys provided an awesome KASAN report pointing to an use
after free in xt_TCPMSS

I have provided three patches to fix this issue, either in xt_TCPMSS or
in xt_tcpudp.c. It seems xt_TCPMSS patch has the smallest possible
impact.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Commit author: Eric Dumazet

Vulnerable version (before fix):
 tcpmss_mangle_packet(struct sk_buff *skb, 	tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); 	tcp_hdrlen = tcph->doff * 4;  	if (len < tcp_hdrlen) 		return -1;  	if (info->mss == XT_TCPMSS_CLAMP_PMTU) { tcpmss_mangle_packet(struct sk_buff *skb, 	if (len > tcp_hdrlen) 		return 0;  	/* 	 * MSS Option not found ?! add it.. 	 */

Fixed version (after fix):
 tcpmss_mangle_packet(struct sk_buff *skb, 	tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff); 	tcp_hdrlen = tcph->doff * 4;  	if (len < tcp_hdrlen || tcp_hdrlen < sizeof(struct tcphdr)) 		return -1;  	if (info->mss == XT_TCPMSS_CLAMP_PMTU) { tcpmss_mangle_packet(struct sk_buff *skb, 	if (len > tcp_hdrlen) 		return 0;  	/* tcph->doff has 4 bits, do not wrap it to 0 */ 	if (tcp_hdrlen >= 15 * 4) 		return 0;  	/* 	 * MSS Option not found ?! add it.. 	 */

Patch:
patch: @@ -104,7 +104,7 @@ tcpmss_mangle_packet(struct sk_buff *skb,
 	tcph = (struct tcphdr *)(skb_network_header(skb) + tcphoff);
 	tcp_hdrlen = tcph->doff * 4;
 
-	if (len < tcp_hdrlen)
+	if (len < tcp_hdrlen || tcp_hdrlen < sizeof(struct tcphdr))
 		return -1;
 
 	if (info->mss == XT_TCPMSS_CLAMP_PMTU) {
@@ -152,6 +152,10 @@ tcpmss_mangle_packet(struct sk_buff *skb,
 	if (len > tcp_hdrlen)
 		return 0;
 
+	/* tcph->doff has 4 bits, do not wrap it to 0 */
+	if (tcp_hdrlen >= 15 * 4)
+		return 0;
+
 	/*
 	 * MSS Option not found ?! add it..
 	 */
path: net/netfilter/xt_TCPMSS.c
Vulnerability: A double-free bug in the read_gif function in gifread.c in gifsicle 1.90 allows a remote attacker to cause a denial-of-service attack or unspecified other impact via a maliciously crafted file, because last_name is mishandled, a different vulnerability than CVE-2017-1000421.
Vulnerability ID: CVE-2017-18120
CWE: CWE-415
Severity score: 6.4
Project: https://github.com/kohler/gifsicle
Published: 2018-02-02
File: src/gifread.c
Commit message: gif_read: Set last_name = NULL unconditionally.

With a non-malicious GIF, last_name is set to NULL when a name
extension is followed by an image. Reported in #117, via
Debian, via a KAIST fuzzing program.
Commit author: Eddie Kohler

Vulnerable version (before fix):
 read_gif(Gif_Reader *grr, int read_flags,   Gif_DeleteArray(gfc.suffix);   Gif_DeleteArray(gfc.length);   gfc.gfi = 0;    if (gfs)     gfs->errors = gfc.errors[1];

Fixed version (after fix):
 read_gif(Gif_Reader *grr, int read_flags,   Gif_DeleteArray(gfc.suffix);   Gif_DeleteArray(gfc.length);   gfc.gfi = 0;   last_name = 0;    if (gfs)     gfs->errors = gfc.errors[1];

Patch:
patch: @@ -900,6 +900,7 @@ read_gif(Gif_Reader *grr, int read_flags,
   Gif_DeleteArray(gfc.suffix);
   Gif_DeleteArray(gfc.length);
   gfc.gfi = 0;
+  last_name = 0;
 
   if (gfs)
     gfs->errors = gfc.errors[1];
path: src/gifread.c
Vulnerability: The call parameter of /lib/exe/ajax.php in DokuWiki through 2017-02-19e does not properly encode user input, which leads to a reflected file download vulnerability, and allows remote attackers to run arbitrary programs.
Vulnerability ID: CVE-2017-18123
CWE: CWE-20
Severity score: 10
Project: https://github.com/splitbrain/dokuwiki
Published: 2018-02-03
File: lib/exe/ajax.php
Commit message: filter special chars from ajax call parameter. fixes #2019
Commit author: Andreas Gohr

Vulnerable version (before fix):
  //call the requested function if($INPUT->post->has('call')){     $call = $INPUT->post->str('call'); }else if($INPUT->get->has('call')){     $call = $INPUT->get->str('call'); }else{     exit; }

Fixed version (after fix):
  //call the requested function if($INPUT->post->has('call')){     $call = $INPUT->post->filter('utf8_stripspecials')->str('call'); }else if($INPUT->get->has('call')){     $call = $INPUT->get->filter('utf8_stripspecials')->str('call'); }else{     exit; }

Patch:
patch: @@ -15,9 +15,9 @@
 
 //call the requested function
 if($INPUT->post->has('call')){
-    $call = $INPUT->post->str('call');
+    $call = $INPUT->post->filter('utf8_stripspecials')->str('call');
 }else if($INPUT->get->has('call')){
-    $call = $INPUT->get->str('call');
+    $call = $INPUT->get->filter('utf8_stripspecials')->str('call');
 }else{
     exit;
 }
path: lib/exe/ajax.php
Vulnerability: In ARM mbed TLS before 2.7.0, there is a bounds-check bypass through an integer overflow in PSK identity parsing in the ssl_parse_client_psk_identity() function in library/ssl_srv.c.
Vulnerability ID: CVE-2017-18187
CWE: CWE-190
Severity score: 6.4
Project: https://github.com/ARMmbed/mbedtls
Published: 2018-02-14
File: library/ssl_srv.c
Commit message: Prevent bounds check bypass through overflow in PSK identity parsing

The check `if( *p + n > end )` in `ssl_parse_client_psk_identity` is
unsafe because `*p + n` might overflow, thus bypassing the check. As
`n` is a user-specified value up to 65K, this is relevant if the
library happens to be located in the last 65K of virtual memory.

This commit replaces the check by a safe version.
Commit author: Hanno Becker

Vulnerable version (before fix):
 static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha     /*      * Receive client pre-shared key identity name      */     if( *p + 2 > end )     {         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );         return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE ); static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha     n = ( (*p)[0] << 8 ) | (*p)[1];     *p += 2;      if( n < 1 || n > 65535 || *p + n > end )     {         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );         return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE );

Fixed version (after fix):
 static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha     /*      * Receive client pre-shared key identity name      */     if( end - *p < 2 )     {         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );         return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE ); static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha     n = ( (*p)[0] << 8 ) | (*p)[1];     *p += 2;      if( n < 1 || n > 65535 || n > (size_t) ( end - *p ) )     {         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );         return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE );

Patch:
patch: @@ -3436,7 +3436,7 @@ static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha
     /*
      * Receive client pre-shared key identity name
      */
-    if( *p + 2 > end )
+    if( end - *p < 2 )
     {
         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );
         return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE );
@@ -3445,7 +3445,7 @@ static int ssl_parse_client_psk_identity( mbedtls_ssl_context *ssl, unsigned cha
     n = ( (*p)[0] << 8 ) | (*p)[1];
     *p += 2;
 
-    if( n < 1 || n > 65535 || *p + n > end )
+    if( n < 1 || n > 65535 || n > (size_t) ( end - *p ) )
     {
         MBEDTLS_SSL_DEBUG_MSG( 1, ( "bad client key exchange message" ) );
         return( MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE );
path: library/ssl_srv.c
Vulnerability: fs/f2fs/extent_cache.c in the Linux kernel before 4.13 mishandles extent trees, which allows local users to cause a denial of service (BUG) via an application with multiple threads.
Vulnerability ID: CVE-2017-18193
CWE: CWE-119
Severity score: 6.9
Project: https://github.com/torvalds/linux
Published: 2018-02-22
File: fs/f2fs/extent_cache.c
Commit message: f2fs: fix a bug caused by NULL extent tree

Thread A:					Thread B:

-f2fs_remount
    -sbi->mount_opt.opt = 0;
						<--- -f2fs_iget
						         -do_read_inode
							     -f2fs_init_extent_tree
							         -F2FS_I(inode)->extent_tree is NULL
        -default_options && parse_options
	    -remount return
						<---  -f2fs_map_blocks
						          -f2fs_lookup_extent_tree
                                                              -f2fs_bug_on(sbi, !et);

The same problem with f2fs_new_inode.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Commit author: Yunlei He

Vulnerable version (before fix):
 static void __drop_largest_extent(struct inode *inode, }  /* return true, if inode page is changed */ bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) { 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 	struct extent_tree *et; bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) 	return false; }  static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, 							struct extent_info *ei) {

Fixed version (after fix):
 static void __drop_largest_extent(struct inode *inode, }  /* return true, if inode page is changed */ static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) { 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode); 	struct extent_tree *et; bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) 	return false; }  bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext) { 	bool ret =  __f2fs_init_extent_tree(inode, i_ext);  	if (!F2FS_I(inode)->extent_tree) 		set_inode_flag(inode, FI_NO_EXTENT);  	return ret; }  static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs, 							struct extent_info *ei) {

Patch:
patch: @@ -320,7 +320,7 @@ static void __drop_largest_extent(struct inode *inode,
 }
 
 /* return true, if inode page is changed */
-bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
+static bool __f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 {
 	struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
 	struct extent_tree *et;
@@ -358,6 +358,16 @@ bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
 	return false;
 }
 
+bool f2fs_init_extent_tree(struct inode *inode, struct f2fs_extent *i_ext)
+{
+	bool ret =  __f2fs_init_extent_tree(inode, i_ext);
+
+	if (!F2FS_I(inode)->extent_tree)
+		set_inode_flag(inode, FI_NO_EXTENT);
+
+	return ret;
+}
+
 static bool f2fs_lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
 							struct extent_info *ei)
 {
path: fs/f2fs/extent_cache.c