Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1d7a2c3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "crypto: msm: restrict value of num_fds to QCEDEV_MAX_BUFFERS"

parents 4641a7e2 2ffd3645
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/*
 * QTI CE device driver.
 *
 * Copyright (c) 2010-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1918,6 +1918,11 @@ static inline long qcedev_ioctl(struct file *file,
				goto exit_free_qcedev_areq;
			}

			if (map_buf.num_fds > QCEDEV_MAX_BUFFERS) {
				err = -EINVAL;
				goto exit_free_qcedev_areq;
			}

			for (i = 0; i < map_buf.num_fds; i++) {
				err = qcedev_check_and_map_buffer(handle,
						map_buf.fd[i],