|
From: AKASHI T. <tak...@li...> - 2014-08-04 06:29:12
|
On 08/01/2014 05:32 PM, Miroslav Vadkerti wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi Akashi,
>
> On 07/24/2014 08:02 AM, AKASHI Takahiro wrote:
>> On some architectures including arm64, system call numbers are defined in
>> /usr/include/asm-generic/unistd.h. This file contains irregular style of definitions like
>> #define __NR3264_truncate 45 #define __NR_truncate __NR3264_truncate (In fact, it's more
>> complicated.)
>>
>> This patch takes care of such cases.
>>
>> Signed-off-by: AKASHI Takahiro <tak...@li...> --- audit-test/utils/augrok | 15
>> +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/audit-test/utils/augrok b/audit-test/utils/augrok index 08f731a..f0542e5 100755
>> --- a/audit-test/utils/augrok +++ b/audit-test/utils/augrok @@ -113,8 +113,12 @@ sub new {
>> open(S, "gcc $m32 -E -dM /usr/include/syscall.h |") or die; my $line; while (defined($line =
>> <S>)) { - next unless $line =~ /^#define\s+__NR_(\w+)\s+(\w+|\(.*?\))/; -
>> $singleton->{$1} = $2; + if ($line =~ /^#define\s+__NR_(\w+)\s+(\w+|\(.*?\))/) { +
>> $singleton->{$1} = $2; + } + if ($line =~
>> /^#define\s+__NR3264_(\w+)\s+(\w+|\(.*?\))/) { + $singleton->{"3264_$1"} = $2; +
>> } } close S;
>>
>> @@ -139,6 +143,13 @@ sub new { $changed = 1; }
>>
>> + #define __NR_truncate __NR3264_truncate + if ($v =~
>> /^__NR3264_(\w+)$/ and + defined($new_v = $singleton->{"3264_$1"})) { +
>> $singleton->{$k} = $new_v; + $changed = 1; + }
>
> I just realized you wanted to do here elsif not only if.
Thanks.
> Won't work and augrok breaks on s390x on defines like:
> #define __NR_mq_getsetattr (__NR_mq_open+5)
> for example
>
> Could you please confirm that with this patch you are still fine?
tested-by: AKASHI Takahiro <tak...@li...>
> diff --git a/audit-test/utils/augrok b/audit-test/utils/augrok
> index a42cd21..973b85b 100755
> - --- a/audit-test/utils/augrok
> +++ b/audit-test/utils/augrok
> @@ -144,7 +144,7 @@ sub new {
> }
>
> #define __NR_truncate __NR3264_truncate
> - - if ($v =~ /^__NR3264_(\w+)$/ and
> + elsif ($v =~ /^__NR3264_(\w+)$/ and
> defined($new_v = $singleton->{"3264_$1"})) {
> $singleton->{$k} = $new_v;
> $changed = 1;
>
> Thanks and regards,
> /M
>
>
>> + # don't know how to handle this, hope it wasn't important else { print STDERR "Removing
>> syscall{$k} = $v\n" if $opt{'debug'};
>>
>
> - --
> Miroslav Vadkerti :: Senior Quality Assurance Engineer / RHCSS :: BaseOS QE - Security
> Phone +420 532 294 129 :: CR cell +420 776 864 252 :: SR cell +421 904 135 440
> IRC mvadkert at #qe #urt #brno #rpmdiff :: GnuPG ID 0x25881087 at pgp.mit.edu
> Red Hat s.r.o, Purkyňova 99/71, 612 45, Brno, Czech Republic
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJT21CZAAoJEBliWhMliBCHGeUIAJ9YUOq9RMx5Ojb2sxOyMya+
> 3sUXtHgHilZAra3x9Yg2OJDADPGO46NJ47FnqWSGTP/tZmr3ppCRCXGyYFqWPFr/
> r+f30K5vxs1YcyG7vIAj1838rds0M5c8PbXBrI2G+VT3c/1yzz96axcagQppzHvq
> +uE0kAuoHP6gkIt/g/Dqc7aIA709OXR/OT1eIt+KOX66wLo7MCMmDC+x1ZE2aORH
> CNHGB4SeGZKq3IaC1qiryAYIgBBMxTpHv+pz7Cb+vjCfx/o426Em+9fVBFXiY5mI
> fq8PnjW8jRdX36iRC4pMjRu98t0QRhTPa56LTKwQgaBUBwpOmbrxWDfqf7ei83k=
> =Gbyy
> -----END PGP SIGNATURE-----
>
|