Mitigate Baron SameEdit (CVE-2021-3156) vulnerability

sles 15.2
obsolete weakness #48

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

shadow-4.6/libmisc/ulimit.c

Context:

The highlighted line of code below is the trigger point of this particular Sles 15.2 obsolete weakness.

 #include <config.h>

#ident "$ Id$ "

#if HAVE_ULIMIT_H
#include <ulimit.h>
#ifndef UL_SETFSIZE
#ifdef UL_SFILLIM
#define UL_SETFSIZE UL_SFILLIM
#else
#define UL_SETFSIZE 2
#endif
#endif
#elif HAVE_SYS_RESOURCE_H
#include <sys/time.h>		/* for struct timeval on sunos4 */
/* XXX - is the above ok or should it be <time.h> on ultrix? */
#include <sys/resource.h>
#endif
#include "prototypes.h"

int set_filesize_limit (int blocks)
{
	int ret = -1;
#if HAVE_ULIMIT_H
	if (ulimit (UL_SETFSIZE, blocks) != -1) {
		ret = 0;
	}
#elif defined(RLIMIT_FSIZE)
	struct rlimit rlimit_fsize;

	rlimit_fsize.rlim_cur = 512L * blocks;
	rlimit_fsize.rlim_max = rlimit_fsize.rlim_cur;
	ret = setrlimit (RLIMIT_FSIZE, &rlimit_fsize);
#endif

	return ret;
}
 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.