Re: [PATCH] ima: avoid appraise error for hash calc interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/11/19 11:23 AM, Patrick Callaghan wrote:

-		if (rbuf_len == 0)
+		if (rbuf_len == 0) {	/* unexpected EOF */
+			rc = -EINVAL;
  			break;
+		}
  		offset += rbuf_len;

Should there be an additional check to validate that (offset + rbuf_len) is less than i_size before calling cypto_shash_update (since rbuf_len is one of the parameters for this call)?

               if ((rbuf_len == 0) || (offset + rbuf_len >= i_size)) {
                        rc = -EINVAL;
                        break;
               }
               offset += rbuf_len;

  	       rc = crypto_shash_update(shash, rbuf, rbuf_len);

 -lakshmi




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux