* [kbd] Issue in kbd package
@ 2015-06-26 15:58 Guzman Mosqueda, Jose R
2015-06-28 22:11 ` Alexey Gladkov
0 siblings, 1 reply; 2+ messages in thread
From: Guzman Mosqueda, Jose R @ 2015-06-26 15:58 UTC (permalink / raw)
To: kbd
Hi all
I'm Jose R. Guzman from a security team at Intel.
We have included kbd package in a GNU-Linux project and I'm analyzing
the code to try to find some possible vulnerabilities, issues or risks.
Since I'm not too familiar with the package yet I think I have found an
issue and I'd like you to help me checking it. It could result in a
memory leak.
Package version: kbd-2.0.2
File: src/setfont.c
Function: static void loadnewfonts(int fd, char **ifiles, int ifilct,
int iunit, int hwunit, int no_m, int no_u)
Line: ~459
Description: There is a variable "bigfontbuf" that contains memory
allocated dynamically in a "for" loop by calling "xrealloc" function.
After the loop the variable is passed as parameter in "do_loadfont"
call, however I don't see any point where such memory get free befor
returning from function. Also variable is local and the pointer is not
stored in any other variable. So I think that is a memory leak. Is it?
Another issue that I found is a handler being not closed:
File: src/openvt.c
Function: static char *authenticate_user(int curvt)
Line: ~119
Description: There is a variable "dp" used to store a file handler of a
proc dir. I don't see any point inside the function where such handler
is freed after being used.
I really appreciate if someone can take a look and tell me whether they
are really issues or not.
Thanks in advance.
Regards,
Jose R.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [kbd] Issue in kbd package
2015-06-26 15:58 [kbd] Issue in kbd package Guzman Mosqueda, Jose R
@ 2015-06-28 22:11 ` Alexey Gladkov
0 siblings, 0 replies; 2+ messages in thread
From: Alexey Gladkov @ 2015-06-28 22:11 UTC (permalink / raw)
To: Linux console tools development discussion; +Cc: jose.r.guzman.mosqueda
On 26.06.2015 18:58, Guzman Mosqueda, Jose R wrote:
>
> Hi all
>
> I'm Jose R. Guzman from a security team at Intel.
> We have included kbd package in a GNU-Linux project and I'm analyzing
> the code to try to find some possible vulnerabilities, issues or risks.
>
> Since I'm not too familiar with the package yet I think I have found an
> issue and I'd like you to help me checking it. It could result in a
> memory leak.
>
> Package version: kbd-2.0.2
> File: src/setfont.c
> Function: static void loadnewfonts(int fd, char **ifiles, int ifilct,
> int iunit, int hwunit, int no_m, int no_u)
> Line: ~459
> Description: There is a variable "bigfontbuf" that contains memory
> allocated dynamically in a "for" loop by calling "xrealloc" function.
> After the loop the variable is passed as parameter in "do_loadfont"
> call, however I don't see any point where such memory get free befor
> returning from function. Also variable is local and the pointer is not
> stored in any other variable. So I think that is a memory leak. Is it?
>
> Another issue that I found is a handler being not closed:
> File: src/openvt.c
> Function: static char *authenticate_user(int curvt)
> Line: ~119
> Description: There is a variable "dp" used to store a file handler of a
> proc dir. I don't see any point inside the function where such handler
> is freed after being used.
>
> I really appreciate if someone can take a look and tell me whether they
> are really issues or not.
You are right. Fixed in the master.
http://git.kernel.org/cgit/linux/kernel/git/legion/kbd.git
--
Rgrds, legion
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-28 22:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 15:58 [kbd] Issue in kbd package Guzman Mosqueda, Jose R
2015-06-28 22:11 ` Alexey Gladkov
Linux console tools development discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/kbd/0 kbd/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 kbd kbd/ http://lore.altlinux.org/kbd \
kbd@lists.altlinux.org kbd@lists.altlinux.ru kbd@lists.altlinux.com
public-inbox-index kbd
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.kbd
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git